This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<n> <c> <e> // n, c = RSA key len, e = 3 bytes | |
| n e c | | |
TUCK | n e c e | 512 | 1024 | |
1 | n e c e 1 | | |
AND | n e c 0/1 | 257 | 513 | |
IF | n e c | | |
DUP | n e c c | 512 | 1024 | |
ELSE | n e c | | |
1 | n e c 1 | | |
ENDIF | n e c c/1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ECPairFactory } = require('ecpair'); | |
const btc = require('./src'); | |
const ecc = require('tiny-secp256k1'); | |
const { secp256k1, schnorr } = require('@noble/curves/secp256k1'); | |
const psbtutils = require('./src/psbt/psbtutils'); | |
const { reverseBuffer } = require('./src/bufferutils'); | |
const { REVERSE_OPS: rOps } = require('./src/ops'); | |
btc.initEccLib(ecc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
VAULT quine:
op | stack |
---|---|
START |
{1,0,<release_sig>} |
<counter> |
<counter> {1,0,<release_sig>} |
<leaf-update-script-body> |
<leaf-update-script-body> <counter> {1,-1,<release_sig>} |
TOALTSTACK |
<counter> {1,0} |
DUP |
<counter> <counter> {1,0,<release_sig>} |
NOTIF |
<counter> <release_sig> |
This proposal is an alternative to [bip119][] and [bip118][], providing the functionality of both proposals with minimal additional overhead in many cases, while clearing certain objections to both, and opening clear upgrade paths.
This is, in essence, an initially constrained version of Russel O'Connor's [OP_TXHASH+OP_CSFS proposal][].