Skip to content

Commit 7a46e7b

Browse files
authored
Fix htlc scripts in Taproot article (#21)
1 parent b159bf8 commit 7a46e7b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

taproot-updates.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ The commitment transaction will then become:
136136
"tapleaf_1": "
137137
# funds go back to us via a second-stage HTLC-timeout transaction (which contains an absolute delay)
138138
# NB: we also need the remote signature, which prevents us from unilaterally changing the HTLC-timeout transaction
139-
<remote_htlcpubkey> OP_CHECKSIGVERIFY <local_htlcpubkey> OP_CHECKSIGVERIFY
139+
<local_htlcpubkey> OP_CHECKSIGVERIFY <remote_htlcpubkey> OP_CHECKSIGVERIFY
140140
1 OP_CHECKSEQUENCEVERIFY
141141
",
142142
"tapleaf_2": "
143143
# funds go to the remote node if it has the payment preimage.
144-
OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
144+
OP_SIZE 32 OP_EQUALVERIFY OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
145145
<remote_htlcpubkey>
146146
OP_CHECKSIGVERIFY
147147
1 OP_CHECKSEQUENCEVERIFY
@@ -159,8 +159,8 @@ The commitment transaction will then become:
159159
"tapleaf_1": "
160160
# funds go to us via a second-stage HTLC-success transaction once we have the payment preimage
161161
# NB: we also need the remote signature, which prevents us from unilaterally changing the HTLC-success transaction
162-
OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
163-
<remote_htlcpubkey> OP_CHECKSIGVERIFY <local_htlcpubkey> OP_CHECKSIGVERIFY
162+
OP_SIZE 32 OP_EQUALVERIFY OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
163+
<local_htlcpubkey> OP_CHECKSIGVERIFY <remote_htlcpubkey> OP_CHECKSIGVERIFY
164164
1 OP_CHECKSEQUENCEVERIFY
165165
",
166166
"tapleaf_2": "
@@ -195,7 +195,7 @@ A taproot HTLC-success transaction looks like:
195195
{
196196
"txid": "...",
197197
"vout": 42,
198-
"scriptSig": "<payment_preimage> <remotehtlcsig> <localhtlcsig>",
198+
"scriptSig": "<remotehtlcsig> <localhtlcsig> <payment_preimage>",
199199
"sequence": 1
200200
}
201201
],
@@ -318,7 +318,7 @@ We can see a few problems emerge from that two steps process:
318318
transactions that let the remote peer claim PTLCs from the local commitment
319319
* claiming successful PTLCs from the remote peer's commitment now requires using RBF and sighash
320320
flags similar to anchor outputs HTLC transactions (`sighash_single | sighash_anyonecanpay` trick)
321-
* before signing a commitment update, peers must obtain from their counterpary adaptor signatures
321+
* before signing a commitment update, peers must obtain from their counterparty adaptor signatures
322322
for their pending received PTLCs in the future remote commitment
323323

324324
Let's now detail a strawman, high-level proposal that enables PTLCs.

0 commit comments

Comments
 (0)