<p>There are a lot of possibilities to write such script. This is the simpliest, but not the shortest one</p>

<pre><code>OP_IF
  lock2 OP_CLTV OP_DROP pubAlice OP_CHECKSIG
OP_ELSE
  OP_IF 
    OP_3 pubAlice pubBob pubCarol OP_3 
  OP_ELSE
    lock1 OP_CLTV OP_DROP OP_2 pubAlice pubCarol OP_2 
  OP_ENDIF
  OP_CHECKMULTISIG
OP_ENDIF 
</code></pre>

CC BY-SA 3.0
2017-07-23T23:38:08.813Z
Just to confirm, if lock2 expires, only Alice can spend, a transaction signed by Alice and Carol as required at lock1 or even signed by Alice, Bob and Carol as required with no lock time will not be accepted?
skydanc3r
CC BY-SA 3.0
2017-07-23T18:29:28.057Z
2017-07-23T18:29:28.057Z
amaclin
<p>Alice, Bob and Carol create a p2sh address that initially requires 3/3 signatures. After some time (lock1 using OP_CHECKLOCKTIMEVERIFY)  only Alice and Carol can spend and Bob is permanently forgot. After more time (lock2 using OP_CHECKLOCKTIMEVERIFY) Alice can spend alone. </p>

<p>How would a script like this look like?</p>

<script><p2sh>
Create an arbitrary script with two locktimes and p2sh
skydanc3r
# Create an arbitrary script with two locktimes and p2sh

(Asked by: username_0 on 2017-07-23)

Alice, Bob and Carol create a p2sh address that initially requires 3/3 signatures. After some time (lock1 using OP\_CHECKLOCKTIMEVERIFY) only Alice and Carol can spend and Bob is permanently forgot. After more time (lock2 using OP\_CHECKLOCKTIMEVERIFY) Alice can spend alone.

How would a script like this look like?

**Tags:** script, p2sh


---

## 1 answers

### Answer by username_1 on 2017-07-23. Score: 1 | Accepted answer

There are a lot of possibilities to write such script. This is the simpliest, but not the shortest one
OP_IF
  lock2 OP_CLTV OP_DROP pubAlice OP_CHECKSIG
OP_ELSE
  OP_IF 
    OP_3 pubAlice pubBob pubCarol OP_3 
  OP_ELSE
    lock1 OP_CLTV OP_DROP OP_2 pubAlice pubCarol OP_2 
  OP_ENDIF
  OP_CHECKMULTISIG
OP_ENDIF

> **Comments:**
> **username_0**: Just to confirm, if lock2 expires, only Alice can spend, a transaction signed by Alice and Carol as required at lock1 or even signed by Alice, Bob and Carol as required with no lock time will not be accepted?  

---

