New answers tagged

2 votes
Accepted

Incorrect Transaction ID being calculated for a p2wpkh transaction

The problem appears to be the lines where you encode the number of inputs and outputs: let inputs_length: u32 = inputs.len() as u32; tx.extend_from_slice(&inputs_length.to_le_bytes()); ... ...
Ava Chow's user avatar
  • 69.8k
0 votes
Accepted

I Get "Non-canonical DER signature" Error

As the error message says, your signature is not DER encoded. An ECDSA signature is composed of two integers, R and s. DER is a method of encoding them. DER for a signature specifies that the ...
Ava Chow's user avatar
  • 69.8k
2 votes
Accepted

the purpose of the field before signature in P2WPKH

It is the number of witness items in the witness stack of input #0 of the transaction. See BIP144 for the serialization format used by segwit transactions: the only witness objects type supported are ...
Pieter Wuille's user avatar

Top 50 recent answers are included