Skip to content

Enforce MINIMALIF-compliant witnesses #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightning/src/chain/keysinterface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub enum SpendableOutputDescriptor {
/// The private key which should be used to sign the transaction is provided, as well as the
/// full witness redeemScript which is hashed in the output script_pubkey.
/// The witness in the spending input should be:
/// <BIP 143 signature generated with the given key> <one zero byte aka OP_0>
/// <BIP 143 signature generated with the given key> <empty vector> (MINIMALIF standard rule)
/// <witness_script as provided>
/// Note that the nSequence field in the input must be set to_self_delay (which corresponds to
/// the transaction not being broadcastable until at least to_self_delay blocks after the input
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/functional_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4009,7 +4009,7 @@ macro_rules! check_spendable_outputs {
let local_delaysig = secp_ctx.sign(&sighash, key);
spend_tx.input[0].witness.push(local_delaysig.serialize_der().to_vec());
spend_tx.input[0].witness[0].push(SigHashType::All as u8);
spend_tx.input[0].witness.push(vec!(0));
spend_tx.input[0].witness.push(vec!());
spend_tx.input[0].witness.push(witness_script.clone().into_bytes());
txn.push(spend_tx);
},
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/onchaintx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
if let &Some(preimage) = preimage {
bumped_tx.input[i].witness.push(preimage.clone().0.to_vec());
} else {
bumped_tx.input[i].witness.push(vec![0]);
bumped_tx.input[i].witness.push(vec![]);
}
bumped_tx.input[i].witness.push(witness_script.clone().into_bytes());
log_trace!(self, "Going to broadcast Claim Transaction {} claiming remote {} htlc output {} from {} with new feerate {}...", bumped_tx.txid(), if preimage.is_some() { "offered" } else { "received" }, outp.vout, outp.txid, new_feerate);
Expand Down