Skip to main content

Questions tagged [miniscript]

Miniscript is a structured representation of Bitcoin script which allows wallets to be more dynamic about the scripts they use.

Filter by
Sorted by
Tagged with
16 votes
3 answers
2k views

What does Bitcoin policy language offer the developer that Miniscript doesn't? What is the difference between Bitcoin policy language and Miniscript?

I understand that policy language compiles to Miniscript and Miniscript is encoded (correction) to Bitcoin Script. This is also a great resource on Miniscript: http://bitcoin.sipa.be/miniscript/ But I ...
Michael Folkson's user avatar
8 votes
1 answer
318 views

In theory could we skip the proposed Taproot soft fork, activate Simplicity instead and use Simplicity to write the equivalent of Taproot scripts?

In theory could we skip the proposed Taproot soft fork, activate Simplicity instead and use Simplicity to write the equivalent of Taproot scripts? Or does Simplicity need more development and ...
Michael Folkson's user avatar
7 votes
3 answers
502 views

Multisig where one of the keys specifically is required?

Is it possible to make a multisig wallet that requires one of the keys specifically and any of the other ones in order to sign a transaction? For example, let's say I have a 2-of-3 multisig that has ...
rosstripi's user avatar
  • 203
5 votes
1 answer
349 views

What is Tapscript?

What is Tapscript? How is it different from script? Is it the same thing as "Leaf script"? How does it relate to Witness Script, miniscript and any other type of script used in Bitcoin ...
Lee's user avatar
  • 877
5 votes
1 answer
223 views

Why does Miniscript add an extra size check for hash preimage comparisons?

When I input the following miniscript into https://bitcoin.sipa.be/miniscript/: and(pk(claimant_pk),sha256(H)) I get the following Script: <claimant_pk> OP_CHECKSIGVERIFY OP_SIZE <20> ...
Sachin Meier's user avatar
5 votes
1 answer
90 views

Error when doing a getdescriptorinfo on a Miniscript descriptor (V24.0.1)

I'm trying to play around with miniscript and import them into Bitcoin Core v24.0.1. I created the following descriptor in https://miniscript.fun and tried to validate it in Bitcoin Core bitcoin-cli ...
francois's user avatar
  • 103
5 votes
1 answer
220 views

How do I set up a time-decay multisig?

I want to set up a multisig that requires fewer signatures as time goes by. Let T be some time in the future (e.g. a year from now). Before T, 2/3 signatures are required to unlock the UTXO (send ...
Yoda's user avatar
  • 51
4 votes
1 answer
258 views

When is a Miniscript solution malleable?

I'm having some trouble understanding malleability in miniscript. Specifically I cannot get why some solutions can be used instead of other. I think using an example may help. Say, for instance, this ...
landabaso's user avatar
  • 248
4 votes
1 answer
181 views

Where can I find the miniscript policy language specification?

I would like to understand how miniscript works by coding it myself. As I started studying it, I realized that miniscript is more or less a 1-for-1 abstraction of a subset of Script and that the ...
Jimmy Song's user avatar
  • 7,759
4 votes
2 answers
218 views

Conditional MULTISIG transaction

I need a bitcoin lock script that will require my key and 1 of 4 other people. For example, If my key is present and one of the 4 other keys are also present, transaction can be claimed. If my key is ...
Anıl's user avatar
  • 41
4 votes
1 answer
417 views

Which wallets or libraries besides core support (or will support) P2TR descriptors?

I want to help test the WIP Bitcoin Dev Kit "Add support for Taproot and tr() descriptors", PR #593 against other implementations besides Bitcoin Core (already testing again Core 22.0). In ...
Not Mandatory's user avatar
3 votes
2 answers
389 views

Why isn't it possible to add an OP_RETURN (or some arbitrary script) inside a taproot script path with a descriptor?

I'm reading the Bitcoin Core's descriptor documentation and I noticed that the raw() SCRIPT expression can only be used at descriptor top-level. Indeed when called with this descriptor ...
Sosthène's user avatar
  • 643
3 votes
1 answer
236 views

How do descriptors work with miniscript in the library bitcoinerLab?

What I want is to be able to spend the funds from an address, either with its private key or with the private key of another address that I designate in the policy. As I understand it, it works like ...
Chupitastiiks's user avatar
3 votes
1 answer
237 views

Can output descriptors be used to encode any Miniscript expression?

Output descriptors provide a standard to make address bodies more exchangeable between various wallet implementations. It seems that an output descriptor can be used to encode any Miniscript ...
Murch's user avatar
  • 76k
3 votes
1 answer
87 views

Should the Policy to Miniscript compiler(s) be considered as deterministic and is this the end goal?

Should the Policy to Miniscript compiler(s) be considered as deterministic and is this the end goal? This question was asked by Jeremy Rubin on ##miniscript on IRC and has been paraphrased. For basic ...
Michael Folkson's user avatar
3 votes
1 answer
105 views

With Miniscript why is it not possible to invert conditions with something like not()?

This question was asked by Luke Childs (@lukechilds) on Twitter. In Miniscript would it be possible to invert conditions with something like not()? Could you essentially create a younger() out of not(...
Michael Folkson's user avatar
3 votes
1 answer
72 views

How do I write a script such that my funds are locked in a 2-of-2 multisig that converts into a 1-of-2 multisig after 365 days?

I would like my Bitcoin to have the extra security that a 2-of-2 multisig provides. With a single sig I am worried that if a single key gets hacked I will lose my funds. However, with a 2-of-2 ...
Michael Folkson's user avatar
2 votes
2 answers
167 views

What Policy does the Liana wallet use? Why would I use this Policy?

I was looking at Wizardsardine's Liana wallet repo (beta software). What is the Policy and associated Miniscript that is used by this wallet? Why would I use this Policy? What is fixed and what is ...
Michael Folkson's user avatar
2 votes
2 answers
111 views

What is a sane Miniscript? How does it differ to a valid Miniscript?

What is a sane Miniscript? How does it differ to a valid Miniscript? This was asked during a Bitcoin Core PR review club on Miniscript hosted by stickies-v on May 18th 2022.
Michael Folkson's user avatar
2 votes
1 answer
101 views

What is the relationship between the Minsc language and Policy language?

Quoting from the Minsc website "Minsc is a high-level scripting language...based on the Miniscript Policy language with additional features and syntactic sugar sprinkled on top including ...
Michael Folkson's user avatar
2 votes
0 answers
28 views

Simplicity vs Miniscript [duplicate]

It is clear that both simplicity and Miniscript aims to extend and improve upon the bitcoin script. However what are the differences between them and the pros and cons they both have against the other?...
Miyamoto Musashi's user avatar
1 vote
1 answer
89 views

Miniscript or_i, d: - do they always imply a witness input?

The question: is the following description of the behavior of these fragments correct? The or_i fragment and d: wrappers all have an IF in their script that does not take the value from the argument(s)...
Dmitry Petukhov's user avatar
1 vote
2 answers
247 views

How would one turn a Miniscript tree into a Taproot tree with Taproot'd Miniscript?

How would one turn a Miniscript "tree" into a Taproot tree with Taproot'd Miniscript? (To be clear unlike a Taproot tree a Miniscript tree likely would't be surfaced to the user. Breaking ...
Michael Folkson's user avatar
1 vote
2 answers
172 views

how to open the miniscript designer?

I've read Bitcoin Core 24 brings a miniscript visual programmer. Had a look, didn't find it. Is that true? How to check it out?
Mercedes's user avatar
  • 824
1 vote
1 answer
195 views

Difference and resources for Miniscript and Simplicity?

I have read about that it is a language for writing Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing and more. http://bitcoin.sipa.be/miniscript/ is helpful but ...
BlueTang's user avatar
1 vote
1 answer
70 views

Why has the Miniscript for this particular Policy changed over the past few months?

The "A 3-of-3 that turns into a 2-of-3 after 90 days" policy: thresh(3,pk(key_1),pk(key_2),pk(key_3),older(12960)) compiled to this Miniscript a few months ago: thresh(3,pk(key_1),s:pk(key_2)...
Michael Folkson's user avatar
1 vote
2 answers
350 views

Loops in bitcoin scripting

According to this Q&A there are no loops in bitcoin script: The Bitcoin scripting system is purposefully not Turing-complete - why? I was reading the comments in a reddit post and realized few for ...
user avatar
1 vote
1 answer
155 views

Is there anything specific to the design of the Sapio language that makes it well suited to writing covenant scripts?

I think I understand at a high level the goals of both CheckTemplateVerify (CTV, BIP 119) and the Sapio language. Is there anything specific to the design of the Sapio language that makes it well ...
Michael Folkson's user avatar
1 vote
0 answers
34 views

Miniscript exercise for 3of4 multisig that turns into a 2of4 where 2 specific keys only can spend

I was trying to write this script (miniscript) or(multi(3,pk(key_1),pk(key_2),pk(key_3),pk(key_4)),and(older(12960),multi(2,pk(key_3),pk(key_4)))) where it's a 3of4 multisig which turns into a 2of4 (...
Ziya_Sadr's user avatar
1 vote
0 answers
87 views

Bitcoin Script - Beautify

My question is if something exists to do the job in the opposite direction of miniscript. Miniscript's intention is to help:     ...writing (a subset of) Bitcoin Scripts in a structured way, enabling ...
Vlad Stan's user avatar
0 votes
1 answer
35 views

and(older(10),pk(A)) malleable if top-level, can it be top-level? EDIT: not malleable, was mistaken

$ ./miniscript and(older(10),pk(A)) X 110.0000000000 37 and_v(v:pk(A),older(10)) and(older(10),pk(A)) and_v(v:pk(A),older(10)) 1 scriptlen=37 maxops=2 type=B safe=yes nonmal=yes dissat=...
Dmitry Petukhov's user avatar
0 votes
0 answers
43 views

Can one wallet support many descriptors?

Say I wanted to handle many different complex spending scripts in my wallet using descriptors, is that be possible?
btc-descriptor's user avatar
0 votes
0 answers
59 views

Export a taproot multisig wallet

I have created a wallet, added a descriptors to make it multisig with tr(KI, multi_a(2,pub1,pub2,pub3) command. Now, I want to import this to some UI but since the wallet doesn't have a private key I ...
Shadow's user avatar
  • 9
0 votes
1 answer
35 views

What is the difference between semantic policy and concrete policy in a Miniscript context?

What is the difference between semantic policy and concrete policy in a Miniscript context? The difference between Policy and Miniscript is defined here.
Michael Folkson's user avatar
0 votes
1 answer
75 views

What is a Miniscript fragment? And what should I call the underscore letter?

An example Miniscript is: and_v(or_c(pk(B),or_c(pk(C),v:older(1000))),pk(A)) (Generated using this Miniscript site). What would a fragment be here? What should I call the underscore letter (_v)? And ...
Michael Folkson's user avatar