Miniscript support in Output Descriptors #24148 (Part 1) #36
Replies: 1 comment
-
SummaryThis PR bitcoin/bitcoin#24148 introduces the miniscript mechanism into Bitcoin core's QuestionsWhat is a Miniscript?A Miniscript is a subset of Bitcoin Scripts that are analyzable, composable, capable of generic signing, and provide certain guarantees against the sanity and validity of the resulting Bitcoin scripts. A Each miniscripts chunk is called a for example, in miniscript (it's a "Policy", which is a subsequent higher layer representation of miniscript but used here for brevity)
This top-level miniscript is made out of two miniscript fragments.
where
more details on miniscript here: https://bitcoin.sipa.be/miniscript/ What is a Policy?A policy is a high-level description on top of a miniscript, to make writing a miniscript easier. Policies are more human-readable and writable. Policies are compiled into a miniscript. One policy can be compiled into multiple valid miniscripts. The compiler chooses specific optimization, primarily by minimizing spending cost, and uses that to choose the most optimal miniscript from all the possible solutions. A quick playground Policy for the miniscript compiler is available here: https://bitcoin.sipa.be/miniscript/ What is Descriptor?A descriptor is a string that "describes" a specific sequence of This is also useful for passing around spending policies across wallet boundaries. Because descriptors and miniscripts combined with BIP32 Xpub derivation are all standards in the Bitcoin industry, any wallet software adhering to these standards can communicate spending policies with each other. This is a crucial step in wallet operation for complex Bitcoin scriptings involving multiple parties and is currently a major UX hurdle. Descriptor + Miniscript + Bip32 fixes it. A descriptor string looks like A descriptor with 2-of-2 multisig, with two specific public keys, contained in P2WSH script_pubkey looks as below:
More details on descriptors here: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md Why are they useful?
What is min.sc?min.sc is a web app running on top of rust-miniscript, which exposes a high-level policy writing language and can compile policy into miniscript. Try out min.sc here: https://min.sc/ Useful tutorials.
Bonus from BravesIf you have gone through miniscripts and descriptors and feel courageous to try more, below are a few ideas.
|
Beta Was this translation helpful? Give feedback.
-
Session Details
[Wallet][Miniscript]
[python][c++]
Summary
In this PR we will dive deep into miniscripts. What are they, why they are useful, and how they were added into Bitcoin Core.
This is the first part for a 2 part miniscript PR review series.
Learnings
Beta Was this translation helpful? Give feedback.
All reactions