This release is a pretty big one and includes several significant refactors:
- Eliminate recursion throughout (most of) the library, by writing iterative algorithms. Includes many small bugfixes.
- Eliminate many of the stringly typed errors; refactor
PolicyError - Rewrite the Taproot API based on feedback from Mike Tidwell's development of the "Capture the Bitcoin" competition at TABConf 6. (See #766.)
The full changelog:
- remove
Ctx::check_witnessand replaceMiniscript::parse_insanewithMiniscript::decode_consensus#871 - refactor data structures in the typechecker and fix some issues around thresholds #859
- fix multiple bugs in size estimation and limit enforcement for descriptors with uncompressed keys #849
- fix size estimation for Taproot control blocks in satisfactions #858
- Extend
GetKeyimpls and fix some bugs #851 #861 #862 #863 (backport in #860) - improve decoder from
Scriptimplementation and error type; renameparse_with_exttodecode_with_ext#845 - enforce that xpubs in descriptors have the same network #848
- fix malleability behavior in Taproot satisfier #826
- Fix
DefiniteDescriptorKey::newto forbid multipath keys and hardened derivations (which would cause assertion failures) #830 #839 (backports in #831 #832 #833 #833) - add
Descriptor::iter_pkto iterate over pubkeys in an arbitrary descriptor #823 - satisfy: pass public key to
lookup_tap_key_spend_sigto remind satisfier of the keyspend key #827 - plan: remove unused
AssetProvider::provider_lookup_tap_control_block_mapfrom trait #826 - Add conversions from
XOnlyPublicKeyto rust-miniscript descriptor keytypes #818 (backport in #819) - Fix crash in
parse_descriptor#809 (backport in #816) - Eliminate the stringly-typed errors from descriptor key parsing #804
- Rewrite the expression parser to be non-recursive, have much better error messages, and to be more correct. #773 #775 #778 #780 #784
- Remove the
no-stdandactual-serdefeatures #769 - Rewrite the Taproot API #751 #802 #807 #808 #815 #828 (includes bugfix for compiler crash with 0-probability policy fragments)
- Separate out many distinct "max size exceeded" errors #758 #760
- Fix spelling of
MaxWitnessItemsExceedederror variant #759 - Support conversion of multi-Xprivs into multi-Xpubs #757
- Split "witness size exceeded" error from "bare script size exceeded" #756
- Fix decoding WIF privkeys with BIP32 origins #753
- Allow compiling
pkdescriptors to keyspend-onlytrdescriptors #677 - Reduce "maximum pubkeys in multi_a" limit to 999 #746
- Remove
PartialEqfromErrorand introduceStaticDebugAndDisplaytrait to help with boxing errors #741 #801 - Fix lower limit of relative locktime #740
- Remove
TranslatePktrait; move generics onTranslatorto associated types #733 - Fix upper limit of absolute locktime #719
- Clean up Taproot compiler and policy errors #732
- Eliminate recursion throughout the library; extend the
TreeLiketrait; removeLiftableforTerminal#722 #724 #725 - Update MSRV to Rust 1.63 #719
- Silent fix for CVE-2025-43707 (crash on satisfaction of particularly crafted
threshfragments) #798
- Fix incorrect string serialization of
and_b#735
- Fix panics while decoding large miniscripts from script #712
- Update MSRV to Rust
v1.56.1#639 - Remove sketchy
LikelyFalseerror #645 - Drop the
Propertytrait entirely #652 - Improve compiler logic when deciding between conjunctions and
multi/multi_a#657 - Several locktime improvements #654
- Derive
Hashforpubitems #659 - Upgrade
bech32dependency tov0.11.0#661 - Return
Weighttype formax_weight_to_satisfymethods #664
- Remove recursion in
semanticmodule #612 - Remove generics from
Errorby making fragment aString#642 - Remove unused generic on
check_witness#644 - Add conditional formatting for
Terminal#651
- Remove
internalsdependency #631 - Introduce an example binary useful for profiling #646
- Refactor out
type_check#649 - Replace macros with traits, using trait bound trick #650
- Fix panics while decoding large miniscripts from script #712
- Explicitly track recursion depth in fragments #704
- Add the planning module #592
- Bump MSRV to 1.48 #569
- Upgrade
rust-bitcointo v0.31.0 #618 - Reduce binary bloat by removing generic param from type_check 584
- Add height to tap tree 588
- Improve
TapTreeAPI 617 - Remove "unstable" feature 482
- Remove hashbrown dependency 564
- Add method to convert expr_raw_pkh into pkh 557
- psbt: Rewrite input replacement to avoid forgetting fields 568
- Fix panics while decoding large miniscripts from script #712
- Explicitly track recursion depth in fragments #704
- Works with rust-bitcoin 0.30.0
- Add support for [multi-path descriptors] (https://github.com/rust-bitcoin/rust-miniscript#470)
- Fix bugs in max_satisfaction_weight
- DefiniteDescriptorKey: provide additional methods for converting to a DescriptorPublicKey (https://github.com/rust-bitcoin/rust-miniscript#492)
- Remove
DummyKey(https://github.com/rust-bitcoin/rust-miniscript#508) - Update TranslatePk trait to cleanly separate errors during translation itself and script context errors. PR
- Fixes to improve CI infrastructure with Nix support and bitcoind tests.
- Fix panics while decoding large miniscripts from script #712
- Explicitly track recursion depth in fragments #704
- Workaround for recursion bug in rustc #566
- Fixed a typing rule in
multi_afor taproot miniscript descriptors. Current typing rules incorrectly taggedmulti_awith thenproperty. Certain miniscripts of the formj:multi_acould could not spent without the first key. We could not find any evidence of these scripts being used in the wild. While this is technically a breaking change, any downstream users whose code would break by this change are already vulnerable.
- Fixed a bug dealing with dissatisfying pkh inside thresh
- Changed the signature of
Satisfier::lookup_raw_pkh_pkAPI. Only custom implementations ofSatisfierneed to be updated. The psbt APIs are unchanged. - Fixed a bug related to display of
raw_pk_h. These descriptors are experimental and only usable by opting viaExtParamswhile parsing string.
This release contains several significant API overhauls, as well as a bump of our MSRV from 1.29 to 1.41. Users are encouraged to update their compiler to 1.41 before updating to this version.
It includes more Taproot support, but users should be aware that Taproot support for Miniscript is not standardized and is subject to change in the future. See this gist for our thinking regarding this at the time of release.
- Works with bitcoin crate 0.29
- Correctly return an error when
SortedMultiis constructed with too many keys - Cleanly separate
experimental/insane miniscriptsfrom sane miniscripts. - allow disabling the checksum with
alternate Display - Correct
max_satisfaction_sizeoffrom_multi_afragment - Add
PsbtInputExttrait withupdate_with_descriptormethod andPsbtOutputExttrait - Rename several descriptor types to reduce redundancy
- Bump MSRV to 1.41 and edition to 2018
- Rename
as_publictoto_publicon some descriptor key types - Split fully derived
DescriptorPublicKeys into their own type followup - Remove the
DescriptorTraitin favor of theDescriptorenum - Fix signature costing to account for ECDSA vs Schnorr
- Add a Taproot-enabled compiler v1 v2 v3
- Rename
stackelemtostack_elemin the interpreter - Add
no-std - Reworked the
TranslatePkAPIs. Add a Translator trait to cleanly allow downstream users without dealing with APIs that accept function pointers. Also providestranslate_assoc_cloneandtranslate_assoc_failmacros for helping in writing code. - Updated
MiniscriptKey trait,#439 to accept associated types for Sha256, Hash256, Ripemd160 and Hash160. This allows users to write abstract miniscripts hashes as "sha256(H)" instead of specifying the entire hash in the string. that updates the psbt with descriptor bip32 paths. - Re-name
as_publicAPIs ->to_public - Significantly improve the timelock code with new rust-bitcoin APIs.
- rust-miniscript minor implementation detail:
PkHfragment now hasPkgeneric instead ofPk::Hash. This only concerns users that operate withMiniscriptKey = bitcoin::PublicKeyor users that use custom implementation ofMiniscriptKey. Users that useDescriptorPublicKeyneed not be concerned. See PR for details.- To elaborate, "pkh(<20-byte-hex>)" is no longer parsed by the
MiniscriptKey = bitcoin::PublicKey. This is consistent with the descriptor spec as defined. Parsing frombitcoin::Scriptfor pkh<20-byte-hex> is still supported, but the library would not analyze them. These raw descriptors are still in spec discussions. Rust-miniscript will support them once they are completely specified.
- To elaborate, "pkh(<20-byte-hex>)" is no longer parsed by the
- Fixed miniscript type system bug. This is a security vulnerability and users are strongly encouraged to upgrade. See this (link)[https://github.com/rust-bitcoin/rust-miniscript/pull/349/commits/db97c39afa4053c2c3917f04392f6e24964b3972] for details.
- Support for
trdescriptors with miniscript leaves and multi_a fragment - Changes to MiniscriptKey and ToPublicKey traits for x-only keys support
- Add
PsbtExttrait for psbt operationsPsbt::update_descadds information from a descriptor to a psbt. This figures out the type of the descriptor and adds corresponding redeem script/witness script and tap tree information
- Add
derived_descriptorAPI to Descriptor so that users no longer need to usetranslateAPIs. See examples/xpub_descriptorfor usage - Update
DescriptorTrait:script_codeandexplicit_scriptcan now fail because of taproot descriptors - Add
PreTaprootDescriptorandPreTaprootDescriptorTraitto support non-failing versions ofscript_codeandexplicit_scriptfor non taproot descriptors - Overhaul the interpreter API to provide simpler APIs
iter(prevouts)anditer_assume_sig()so that it no longer takes a closure input. - Add interpreter support for taproot transactions.
- Works with rust-bitcoin 0.28.0
- The
liftmethod on a Miniscript node was fixed. It would previously mix up theXandYargument of anandorfragment.
- bump
rust-bitcointo 0.27 - several bugfixes
- Remove
PkCtxfrom the API - Move descriptors into their own types, with an enum containing all of them
- Move descriptor functionality into a trait
- Remove
FromStrbound fromMiniscriptKeyandMiniscriptKey::Hash - Various
DescriptorPublicKeyimprovements - Allow hardened paths in
DescriptorPublicKey, remove directToPublicKeyimplementation - Change
OptiontoResultin all APIs - bump
rust-bitcointo 0.26
- Add support for parsing secret keys
- Add sortedmulti descriptor
- Added standardness and other sanity checks
- Cleaned up
Errortype and return values of most of the API - Overhauled
satisfied_constraintsmodule into a newInterpreterAPI
- Bump MSRV to 1.29
- Changes to the miniscript type system to detect an invalid
combination of heightlocks and timelocks
- Lift miniscripts can now fail. Earlier it always succeeded and gave the resulting Semantic Policy
- Compiler will not compile policies that contain at least one unspendable path
- Added support for Descriptor PublicKeys(xpub)
- Added a generic psbt finalizer and extractor
- Updated Satisfaction API for checking time/height before setting satisfaction
- Added a policy entailment API for more miniscript semantic analysis
- Added the following aliases to miniscript for ease of operations
- Rename
pktopk_k - Rename
thresh_mtomulti - Add alias
pk(K)=c:pk_k(K) - Add alias
pkh(K)=c:pk_h(K)
- Rename
- Fixed Miniscript parser bugs when decoding Hashlocks
- Added scriptContext(
LegacyandSegwitv0) to Miniscript. - Miscellaneous fixes against DoS attacks for heavy nesting.
- Fixed Satisfier bug that caused flipping of arguments for
and_vandand_nandand_or