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
5 votes
1 answer
209 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
0 votes
0 answers
67 views

Bitcoin core cli importdescriptors (miniscript)

I created a miniscript descriptor and wanted to see how it looked like in core(testnet). So i ran: importdescriptors "[{"desc": "wsh(or_d(pk([658b6bd9/44'/1'/0'/0]...
Jim Quick's user avatar
0 votes
0 answers
66 views

How to sign a PSBT with BitcoinerLAB?

First of all, We are using bitcoinerLab. From the seed, we generate the Master Key, and with the path, we create the child key 0 (the parent's) and child key 1 (the child's). Now, from these keys, we ...
Chupitastiiks's user avatar
3 votes
1 answer
190 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
5 votes
1 answer
65 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
4 votes
2 answers
194 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
2 votes
2 answers
136 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
4 votes
1 answer
241 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
5 votes
1 answer
183 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
1 vote
2 answers
141 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
  • 795
1 vote
1 answer
62 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
3 votes
2 answers
304 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
  • 623
1 vote
2 answers
97 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
4 votes
1 answer
326 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
1 vote
2 answers
196 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
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
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
73 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
1 vote
2 answers
285 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
3 votes
1 answer
218 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
  • 72.8k
1 vote
1 answer
135 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
1 answer
193 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
0 answers
80 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
1 vote
1 answer
88 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
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
3 votes
1 answer
69 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
1 answer
100 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
3 votes
1 answer
83 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
8 votes
1 answer
317 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
3 votes
1 answer
101 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
4 votes
1 answer
174 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,749
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
7 votes
3 answers
476 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