-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
implement output script descriptors #5694
Comments
It would make sense to implement PSBT support before this: #4615 |
Consider the below 2of2 multisig example. This is how Bitcoin Core / HWI is describing a "wallet": two descriptors, one for change ("internal"), one for receiving addresses
Here is how in Electrum you would currently create an analogous wallet:
Note that instead of an "intermediate xpub", the user can opt to e.g. enter their seed words, and we generate the xpub from that in that case. Further note that in this case, we show the user the intermediate xpub at this point; so that they can save/share their own xpubs with other cosigners. It is not clear how we could change this flow to end up using output script descriptors. Also note that e.g. the checksum in the output script descriptor is only there for the "full"/"ready" descriptor. So whatever partial strings cosigners are sharing with each other would likely not fully be protected with a checksum. We could maybe show individual users something like this? Problems(?) with this though:
(Or obviously we could change the whole wizard flow, but to what??) |
Given that output descriptors, being more extensible, will likely eventually become the default, this seems a problem of transition. The following comments suggest one approach and may be of use:
|
You seem to be missing the point. There does not seem to exist a format for an output descriptor "for a cosigner". Output descriptors can be used when all the cosigners are known but seemingly not before. This is the concern I was expressing above.
Well that's the thing; I don't think it is.
Yes, that is one point that would make this change rather urgent... :/ |
Apologies, I did miss the point, and assumed your suggestion of a partial output descriptor (without a script) was reasonable. That said, it is perhaps more generally compatible at this time to show the three fields separately for each cosigner, and the output descriptor at the end. |
We should consider implementing support for output script descriptors.
See:
These would most likely replace the ypubs/zpubs we currently use (deprecate them).
These would allow e.g. importing and spending from p2pk scripts, or non-HD multisig scripts.
Perhaps more importantly however, when handling PSBTs, signers will often want a derivation path prefix for an xpub and the root xpub's fingerprint. This data is not contained in ypubs/zpubs. Hence, e.g. a wallet created from a zpub cannot create a PSBT that a coldcard will sign; and it's even worse in case of multisig wallets (see #5672 (comment)).
Unfortunately Ypubs/Zpubs don't map neatly onto output script descriptors. An output script descriptor describes the whole output script, so e.g. often contains multiple xpubs. Hence a Zpub is basically a partial descriptor.
Further, our wallet code given an xpub always creates an
m/0/i
,m/1/j
hierarchy (where the latter is for change); but this can only be described via two output script descriptors, not one.The above means we might have to change the wizard (UI) flow, for example.
To illustrate, see example taken from HWI docs:
The text was updated successfully, but these errors were encountered: