Descriptor Trait/Typeclass:
Table of API on along the rows, and columns showing the descriptor type. Each box represents
- y = always succeeds
- n = always fails
- yn = may succeed
All descriptors sh/wsh/shwsh/tr/bare support miniscript descriptors
API vs Desc type | bare pk/multi | pkh | sh | sh(wsh/wpkh) | wpkh | wsh | tr | rawtr | raw | addr | raw(pkh/wpkh/wsh/shwsh) |
---|---|---|---|---|---|---|---|---|---|---|---|
address | n | y | y | y | y | y | y | y | n | y | y |
script_pubkey | y | y | y | y | y | y | y | y | y | y | y |
unsigned_script_sig | y | y | y | y | y | y | y | y | y | n | y |
explicit_script | y | y | y | y | y | y | n | y | y | n | n |
satisfy | yn | yn | yn | yn | yn | yn | yn | yn | n | n | n |
max_satisfaction_weight | y | y | yn | yn | y | yn | yn | yn | n | n | n |
script_code | y | y | y | y | y | y | n | n | y | n | n |
unsigned_script_sig
is only useful in ShWsh transactions.explicit_script
is the inner script inside the descriptor excluding all the wrapping(sh/wsh/shwsh) etc. Useful formax_satisfaction_weight
returnsNone
when the underlying miniscript is impossible to satisfy.sh/wsh/tr
assume miniscript descriptors
- Introduce
WalletDescriptor
descriptors that have address and can used in common scenarios with high level tool (sendtoaddress
, QR codes etc). This includes all descriptors butbare
(top level)pk
,multi
.
- Taproot descriptors(
tr
) no longer have uniqueinner_script
, instead contain a vector of scripts. Taproot descriptors also don't have ascript_code
, but use a different algorithm to compute sighash
- Roughly solvable means that we should be able to produce witness for the descriptor given hashlock preimages, timelocks and secret keys.
- all
raw*
andaddr
descriptors, butrawtr
are non-solvable. Technically, it is possible to satisfyrawtr
using secret key corresponding to the output key.
- All descriptors with
raw*
andaddr
are partial as they hide some information about how the descriptor was constructed. This is not the case forrawtr
if the directly created from output key secret key without BIP341 tweaking. - The distinction between partial/full and solvable/non-solvable might not be worth it. It is partly confusing because
rawtr
is both a full descriptor and a partial descriptor
I agree. Since the descriptor must be specified using the descriptor language, if our satisfaction engine is "complete" then any full descriptor is solvable. And any partial descriptor isn't solvable. Therefore solvability <-> partiality.
If you are missing information to tell whether a script path exists, then it is partial. If you don't, then IMO you need to be able to represent it as a non-
raw
descriptor.