mirror of
https://github.com/bitcoin/bips.git
synced 2025-05-12 12:03:29 +00:00
BIP112/114 example fix
This commit is contained in:
parent
ae70f3ec69
commit
7478ee3260
@ -138,10 +138,10 @@ A simple output, paying to Alice might then look like:
|
|||||||
|
|
||||||
HASH160 <revokehash> EQUAL
|
HASH160 <revokehash> EQUAL
|
||||||
IF
|
IF
|
||||||
<Bob key hash>
|
<Bob's pubkey>
|
||||||
ELSE
|
ELSE
|
||||||
"24h" CHECKSEQUENCEVERIFY DROP
|
"24h" CHECKSEQUENCEVERIFY DROP
|
||||||
<Alice key hash>
|
<Alice's pubkey>
|
||||||
ENDIF
|
ENDIF
|
||||||
CHECKSIG
|
CHECKSIG
|
||||||
|
|
||||||
@ -153,10 +153,10 @@ With CHECKLOCKTIMEVERIFY, this would look like:
|
|||||||
|
|
||||||
HASH160 <revokehash> EQUAL
|
HASH160 <revokehash> EQUAL
|
||||||
IF
|
IF
|
||||||
<Bob key hash>
|
<Bob's pubkey>
|
||||||
ELSE
|
ELSE
|
||||||
"2015/12/15" CHECKLOCKTIMEVERIFY DROP
|
"2015/12/15" CHECKLOCKTIMEVERIFY DROP
|
||||||
<Alice key hash>
|
<Alice's pubkey>
|
||||||
ENDIF
|
ENDIF
|
||||||
CHECKSIG
|
CHECKSIG
|
||||||
|
|
||||||
@ -181,13 +181,13 @@ Alice might look like the following in Alice's commitment transaction:
|
|||||||
IF
|
IF
|
||||||
"24h" CHECKSEQUENCEVERIFY
|
"24h" CHECKSEQUENCEVERIFY
|
||||||
2DROP
|
2DROP
|
||||||
<Alice key hash>
|
<Alice's pubkey>
|
||||||
ELSE
|
ELSE
|
||||||
<Commit-Revocation-Hash> EQUAL
|
<Commit-Revocation-Hash> EQUAL
|
||||||
NOTIF
|
NOTIF
|
||||||
"2015/10/20 10:33" CHECKLOCKTIMEVERIFY DROP
|
"2015/10/20 10:33" CHECKLOCKTIMEVERIFY DROP
|
||||||
ENDIF
|
ENDIF
|
||||||
<Bob key hash>
|
<Bob's pubkey>
|
||||||
ENDIF
|
ENDIF
|
||||||
CHECKSIG
|
CHECKSIG
|
||||||
|
|
||||||
@ -196,12 +196,12 @@ and correspondingly in Bob's commitment transaction:
|
|||||||
HASH160 DUP <R-HASH> EQUAL
|
HASH160 DUP <R-HASH> EQUAL
|
||||||
SWAP <Commit-Revocation-Hash> EQUAL ADD
|
SWAP <Commit-Revocation-Hash> EQUAL ADD
|
||||||
IF
|
IF
|
||||||
<Alice key hash>
|
<Alice's pubkey>
|
||||||
ELSE
|
ELSE
|
||||||
"2015/10/20 10:33" CHECKLOCKTIMEVERIFY
|
"2015/10/20 10:33" CHECKLOCKTIMEVERIFY
|
||||||
"24h" CHECKSEQUENCEVERIFY
|
"24h" CHECKSEQUENCEVERIFY
|
||||||
2DROP
|
2DROP
|
||||||
<Bob key hash>
|
<Bob's pubkey>
|
||||||
ENDIF
|
ENDIF
|
||||||
CHECKSIG
|
CHECKSIG
|
||||||
|
|
||||||
|
@ -96,20 +96,20 @@ The following is the "Hashed TIme-Lock Contract" example in [[bip-0112.mediawiki
|
|||||||
IF
|
IF
|
||||||
"24h" CHECKSEQUENCEVERIFY
|
"24h" CHECKSEQUENCEVERIFY
|
||||||
2DROP
|
2DROP
|
||||||
<Alice key hash>
|
<Alice's pubkey>
|
||||||
ELSE
|
ELSE
|
||||||
<Commit-Revocation-Hash> EQUAL
|
<Commit-Revocation-Hash> EQUAL
|
||||||
NOTIF
|
NOTIF
|
||||||
"Timestamp" CHECKLOCKTIMEVERIFY DROP
|
"Timestamp" CHECKLOCKTIMEVERIFY DROP
|
||||||
ENDIF
|
ENDIF
|
||||||
<Bob key hash>
|
<Bob's pubkey>
|
||||||
ENDIF
|
ENDIF
|
||||||
CHECKSIG
|
CHECKSIG
|
||||||
|
|
||||||
To create a MAST Root, it is flattened to 3 mutually exclusive branches:
|
To create a MAST Root, it is flattened to 3 mutually exclusive branches:
|
||||||
HASH160 <R-HASH> EQUALVERIFY "24h" CHECKSEQUENCEVERIFY DROP <Alice key hash> CHECKSIG
|
HASH160 <R-HASH> EQUALVERIFY "24h" CHECKSEQUENCEVERIFY DROP <Alice's pubkey> CHECKSIG
|
||||||
HASH160 <Commit-Revocation-Hash> EQUALVERIFY <Bob key hash> CHECKSIG
|
HASH160 <Commit-Revocation-Hash> EQUALVERIFY <Bob's pubkey> CHECKSIG
|
||||||
"Timestamp" CHECKLOCKTIMEVERIFY DROP <Bob key hash> CHECKSIG
|
"Timestamp" CHECKLOCKTIMEVERIFY DROP <Bob's pubkey> CHECKSIG
|
||||||
|
|
||||||
which significantly improves readability and reduces the witness size when it is redeemed.
|
which significantly improves readability and reduces the witness size when it is redeemed.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user