-
Notifications
You must be signed in to change notification settings - Fork 82
Feature export xpub to file #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature export xpub to file #246
Conversation
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 |
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 |
@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. |
That is actually probably super confusing and not helpful. More generally the format I am using is:
at least that is how it should work. |
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 |
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? |
4b886f2
to
c639a09
Compare
@jgriffiths Sounds good! Thanks. Rebased just now. |
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.