Skip to content

Conversation

Austin-Fulbright
Copy link

@Austin-Fulbright Austin-Fulbright commented Jul 25, 2025

Add Export button to the USB Storage menu that exports the same data displayed in the QR equivalent (Options -> Export Xpub) to a file on JadeLink.

Exports descriptor in this format: wpkh([0f056943/84h/0h/0h]xpub6CaWStGvcXqM8BH3Grg4Ae1SrRhXPN67Sr3HJoEZLmz51QaR9a7wSD5gRBVtTSH7mKsfoAEScB8jRPsWX1VBayBFYKUNwG7JqhWczbq4U99/<0;1>/*)

The file written to the USB storage will be titled jade-xpub.txt.

NOTE: This feature uses most of the functions implemented inside qrmode.c that are responsible for opening and saving xpub options. For that reason it also uses the same storage as the qrmode to save xpub options. It might be reasonable to create a more general implementation of the xpub options flow that can be shared by the qrmode and usbmode, to avoid confusion.

@Austin-Fulbright Austin-Fulbright changed the title Feature export xpub Feature export xpub to file Jul 25, 2025
@bitcoinhelp
Copy link

Tested this out, working great. Nice @Austin-Fulbright !

Would be great to get this in an upcoming release, let me know when you have the bandwidth to review @jgriffiths

@bitcoinhelp
Copy link

bitcoinhelp commented Jul 25, 2025

Importing the resulting .txt file to Sparrow and Bluewallet works fine, but Nunchuk is throwing an error and must be looking for something different perhaps. In contact with their team and investigating other platforms to see if there is a more widely accepted format/file type to export this as

@Austin-Fulbright
Copy link
Author

@bitcoinhelp Yeah I am not sure why that is but we are exporting as a single line file formatted using this code:

	int n = snprintf(descriptor, sizeof(descriptor),
			"%s([%s/%s]%s/0/*)%s",
			prefix,
			fphex,
			pathstr + 2,   /* drop leading "m/" */
			xpub,
			prefix[0]=='s' && strchr(prefix,'(') ? ")" : "");

I might have something mixed up here but I think this is the standard format.

@Austin-Fulbright
Copy link
Author

Austin-Fulbright commented Jul 25, 2025

That is actually probably super confusing and not helpful. More generally the format I am using is:

<script> ( [ <fingerprint> / <derivation> ] <xpub> / 0 /* ) [optional_closing_paren]

at least that is how it should work.

@bitcoinhelp
Copy link

Yeah the fact that it works fine with Sparrow/Bluewallet makes me think Nunchuk is looking for something maybe slightly different than standard.

It also works fine copying the file contents and pasting to the Blockstream app, but not importing directly. Believe its just not looking for a .txt file, shouldn't be hard to add

@jgriffiths
Copy link
Collaborator

Hi @Austin-Fulbright thanks for this! I'll review once our next release is out of beta which should be very soon.

Could your rebase this branch on master to get rid of the merge commits?

@Austin-Fulbright
Copy link
Author

@jgriffiths Sounds good! Thanks.

Rebased just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants