Skip to main content

Module to_miniscript

Module to_miniscript 

Source
Expand description

v0.32 AST → miniscript::Descriptor<DescriptorPublicKey> converter.

Replaces the v0.14-era hand-rolled 5-shape allow-list with a generic converter that builds a miniscript Descriptor from any BIP-388-parseable md1 wire AST. Address derivation (crate::Descriptor::derive_address) delegates to this module then to miniscript::Descriptor::address.

Feature-gated behind derive (default-on).

Functions§

has_hardened_use_site
Returns true if ANY use-site path on d requires a hardened public derivation step — the descriptor-level baseline (d.use_site_path) OR any per-@N entry in d.tlv.use_site_path_overrides. “Hardened anywhere” means a hardened wildcard (/*h) OR any hardened Alternative inside a multipath group.
to_miniscript_descriptor
Convert an md1 Descriptor AST to a miniscript::Descriptor<DescriptorPublicKey> for chain (the multipath alt selector). The trailing wildcard /* remains for miniscript::Descriptor::at_derivation_index to resolve.
to_miniscript_descriptor_multipath
Convert an md1 Descriptor AST to a multipath miniscript::Descriptor<DescriptorPublicKey> — one key per @N carrying its FULL resolved use-site multipath group (<…;…>), not the single-chain collapse of to_miniscript_descriptor.