You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using rust-miniscript to work with taproot multi-signature scripts. I have a Descriptor<String> which defines the descriptor with a human readable placeholder keys and then I use a Translator with a map I maintain between these Strings and a concrete XOnlyPublicKey. When I apply the Translator I know have a Descriptor<XOnlyPublicKey>.
However, now if I want to use a PSBT to construct a transaction spending these inputs I need to the .update_with_descriptor_unchecked(...) interface which expects a descriptor of the form Descriptor<DefiniteDescriptorKey>.
My problem is how does rust-miniscript expect me to turn a Descriptor<XOnlyPublicKey> or Descriptor<PublicKey> into a Descriptor<DefiniteDescriptorKey>?
The only way I could figure out to do it was to serialize my Descriptor<XOnlyPublicKey> and use the FromStr interface to re-parse it as a Descriptor<DefiniteDescriptorKey>.
Similarly DescriptorPublicKey doesn't have a way to externally construct its Single variant other than with FromStr.
It feels like there needs to be an interface for constructing DefiniteDescriptorKey and DescriptorPublicKey directly from the rust-bitcoin key data structures rather than requiring a serialization-deserialization roundtrip.
The text was updated successfully, but these errors were encountered:
I am using rust-miniscript to work with taproot multi-signature scripts. I have a
Descriptor<String>
which defines the descriptor with a human readable placeholder keys and then I use a Translator with a map I maintain between these Strings and a concrete XOnlyPublicKey. When I apply the Translator I know have aDescriptor<XOnlyPublicKey>
.However, now if I want to use a PSBT to construct a transaction spending these inputs I need to the
.update_with_descriptor_unchecked(...)
interface which expects a descriptor of the formDescriptor<DefiniteDescriptorKey>
.My problem is how does
rust-miniscript
expect me to turn aDescriptor<XOnlyPublicKey>
orDescriptor<PublicKey>
into aDescriptor<DefiniteDescriptorKey>
?The only way I could figure out to do it was to serialize my
Descriptor<XOnlyPublicKey>
and use theFromStr
interface to re-parse it as aDescriptor<DefiniteDescriptorKey>
.Similarly
DescriptorPublicKey
doesn't have a way to externally construct itsSingle
variant other than withFromStr
.It feels like there needs to be an interface for constructing
DefiniteDescriptorKey
andDescriptorPublicKey
directly from the rust-bitcoin key data structures rather than requiring a serialization-deserialization roundtrip.The text was updated successfully, but these errors were encountered: