Create an arbitrary script with two locktimes and p2sh

1

1

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?

skydanc3r

Posted 2017-07-23T17:25:43.377

Reputation: 139

Answers

1

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 

amaclin

Posted 2017-07-23T17:25:43.377

Reputation: 5 763

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 2017-07-23T23:38:08.813