Skip to content

Commit 1508253

Browse files
author
Antoine Riard
committed
Enforce MINIMALIF-compliant witness for spending revokable redeemscript
1 parent 0bc82ee commit 1508253

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum SpendableOutputDescriptor {
5454
/// The private key which should be used to sign the transaction is provided, as well as the
5555
/// full witness redeemScript which is hashed in the output script_pubkey.
5656
/// The witness in the spending input should be:
57-
/// <BIP 143 signature generated with the given key> <one zero byte aka OP_0>
57+
/// <BIP 143 signature generated with the given key> <empty vector> (MINIMALIF standard rule)
5858
/// <witness_script as provided>
5959
/// Note that the nSequence field in the input must be set to_self_delay (which corresponds to
6060
/// the transaction not being broadcastable until at least to_self_delay blocks after the input

lightning/src/ln/functional_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4009,7 +4009,7 @@ macro_rules! check_spendable_outputs {
40094009
let local_delaysig = secp_ctx.sign(&sighash, key);
40104010
spend_tx.input[0].witness.push(local_delaysig.serialize_der().to_vec());
40114011
spend_tx.input[0].witness[0].push(SigHashType::All as u8);
4012-
spend_tx.input[0].witness.push(vec!(0));
4012+
spend_tx.input[0].witness.push(vec!());
40134013
spend_tx.input[0].witness.push(witness_script.clone().into_bytes());
40144014
txn.push(spend_tx);
40154015
},

0 commit comments

Comments
 (0)