<p>I was trying to write this script (miniscript)</p>
<p>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))))</p>
<p>where it's a 3of4 multisig which turns into a 2of4 (only key 3 and key 4) after 90 days..</p>
<p>it gives a &quot;compile error&quot; on bitcoin.sipa.be/miniscript/</p>
<p>I also wrote this:
or(9@thresh(3,pk(key_1),pk(key_2),pk(key_3),pk(key_4)),and(older(12960),thresh(2,pk(key_3),pk(key_4))))</p>
<p>but it gives &quot;duplicate keys&quot; error</p>
<p>what am I doing wrong ?</p>
<p>also, what the correct code would look like?</p>

CC BY-SA 4.0
2024-04-21T22:50:57.503Z
The second branch is a 2-of-2, not 2-of-4, is that what you want?
Vojtěch Strnad
CC BY-SA 4.0
2024-04-22T13:01:13.910Z
yes I want 2 of 2 but specifically only key 3 and 4 must sign
Ziya_Sadr
CC BY-SA 4.0
2024-04-22T13:15:03.310Z
@Ziya_Sadr If you get a compile error, you're not writing Miniscript, but policy language (the compiler on my site compiles policy to Miniscript). "multi" does not exist in the policy language.
Pieter Wuille
<script><miniscript>
Miniscript exercise for 3of4 multisig that turns into a 2of4 where 2 specific keys only can spend
Ziya_Sadr
# Miniscript exercise for 3of4 multisig that turns into a 2of4 where 2 specific keys only can spend

(Asked by: username_0 on 2024-04-21)

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 (only key 3 and key 4) after 90 days..

it gives a "compile error" on bitcoin.sipa.be/miniscript/

I also wrote this:
or(9@thresh(3,pk(key\_1),pk(key\_2),pk(key\_3),pk(key\_4)),and(older(12960),thresh(2,pk(key\_3),pk(key\_4))))

but it gives "duplicate keys" error

what am I doing wrong ?

also, what the correct code would look like?

**Tags:** script, miniscript

> **Comments:**
> **username_1**: The second branch is a 2-of-2, not 2-of-4, is that what you want?  
> **username_0**: yes I want 2 of 2 but specifically only key 3 and 4 must sign  
> **username_2**: @username_0 If you get a compile error, you're not writing Miniscript, but policy language (the compiler on my site compiles policy to Miniscript). "multi" does not exist in the policy language.  

---

## 0 answers

