Skip to content

Instantly share code, notes, and snippets.

@reardencode
Created February 12, 2024 05:26
Show Gist options
  • Save reardencode/12bb55a1db5bae9db775170059737d24 to your computer and use it in GitHub Desktop.
Save reardencode/12bb55a1db5bae9db775170059737d24 to your computer and use it in GitHub Desktop.
CTV-CSFS-IK-VAULT symmetry
quine-script = IF TOALTSTACK TOALTSTACK DROP CTV IK CSFS VERIFY FROMALTSTACK DUP 3 SWAP VAULT FROMALTSTACK CLTV ELSE 2DROP CTV ENDIF
state-n-hash { nLockTime(S+n), out(contract, amount(A)+amount(B)) }
settlement-n-hash { nSequence(2w), out(A, amount-n(A)), out(B, amount-n(B)) }
S = 500000000
IK = A+B
Script = CTV IK CSFS VERIFY <quine-script> DUP 3 SWAP VAULT <S+1> CLTV
Tree = Script
Stack = 0 -1 0 <settlement-1-hash> <S+2> <sig> <state-1-hash>
Contract-n
<settlement-m-hash>
<S+n+1>
<quine-script>
IF
0 -1 0 <S+n+1> <settlement-n-hash> <sig> <state-n-hash> <settlement-m-hash> <S+n+1> <quine-script> | TOALTSTACK TOALTSTACK DROP CTV IK CSFS VERIFY FROMALTSTACK DUP 3 SWAP VAULT FROMALTSTACK CLTV
ELSE
<settlement-m-hash> <S+n+1> <quine-script> | 2DROP CTV
ENDIF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment