Skip to content
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

Add full BIP32 derivation to PSBT #5955

Open
Sjors opened this issue Feb 13, 2020 · 3 comments
Open

Add full BIP32 derivation to PSBT #5955

Sjors opened this issue Feb 13, 2020 · 3 comments

Comments

@Sjors
Copy link

@Sjors Sjors commented Feb 13, 2020

Thanks to #5721 Electrum can now export PSBT files. I tried this with a multi-signature setup (3 imported Vpubs) and inspected it in Bitcoin Core with decodepsbt. Looks good at first glance, except for the derivation paths, which in Electrum are relative to the xpub, not relative to the master key.

There's a case to be made for that. Multisig wallets should commit to the xpubs of their cosigners anyway, so they might as well use relative derivation.

However it would be nice to at least have the option of using the full path and the master key fingerprint. Perhaps this could be achieved by adding two optional fields during wallet setup: root derivation and master key fingerprint.

@SomberNight

This comment has been minimized.

Copy link
Member

@SomberNight SomberNight commented Feb 13, 2020

the derivation paths, which in Electrum are relative to the xpub, not relative to the master key.

Indeed.

However it would be nice to at least have the option of using the full path and the master key fingerprint. Perhaps this could be achieved by adding two optional fields during wallet setup: root derivation and master key fingerprint.

You are right to notice that the wallet itself currently does not even have the full path (only has derivation suffix) and the root fingerprint -- at least in the case when only given an xpub. This would require changes to the wizard. See #5715

Even if the wallet had this information, one could argue there are cases where it would be better not to include it in the PSBT (better for privacy) -- just like whether the global xpubs fields should be populated. see #5672 (comment)

In some cases, e.g. when doing a coinjoin, it is best to strip almost all the fields (again, for privacy).
See #5440 (comment) for different flows (and what is included in each case)


I'm not sure how to proceed with this matter in general. I guess #5715 is the blocker.

@ecdsa

This comment has been minimized.

Copy link
Member

@ecdsa ecdsa commented Feb 13, 2020

why would that be nice?

@Sjors

This comment has been minimized.

Copy link
Author

@Sjors Sjors commented Feb 14, 2020

To be compatible with existing software and hardware. For example with HWI you can ask a device for an xpub at any derivation depth, but you can't give a device an xpub; it won't recognise it. Hardware wallets generally don't store an xpub to deriviation path mapping.

Even multi-sig wallets, they have a security need to store the xpub of their cosigners (most don't atm), but no need to store their own xpub (which they can and probably should derive from the seed each time).

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.