A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

New answers tagged

2

From Elliptic Curve Cryptography perspective everything you sign is a "message" but the term "message" in bitcoin context means a random string that user wants to sign with his key (usually used for proof of ownership or something similar). This means when you use sign*message*withprivkey the code interprets the input as a string and signs it with a ...


0

In order to verify signatures, you need to feed btcdeb the two transactions (the relevant input transaction and the transaction spending the input) for it to be able to calculate the signature hash. Edit: as of January 18 2020, you can now feed it the signature and pubkey as a pair instead. You can also replace the signature and pubkey in the script with ...


2

From BIP143: If the ANYONECANPAY flag is not set, hashPrevouts is the double SHA256 of the serialization of all input outpoints; Otherwise, hashPrevouts is a uint256 of 0x0000......0000. All the details you need are in the BIP


3

DER The Distinguished Encoding Rules (DER) format is used to encode ECDSA signatures in Bitcoin. An ECDSA signature is generated using a private key and a hash of the signed message. It consists of two 32-byte numbers (r,s). As described by Pieter here the DER signature format has six components: 0x30 byte: header byte to indicate compound structure one ...


2

There are different formats used to encode public keys and signatures into binary (octet-streams). They are defined in Standards for Efficient Cryptography 1 (SEC). A public key is a point on an elliptic curve, consisting of an x and y coordinate. There needs to be a standard way for serializing these parts and deserializing them later. The standard defines ...


2

For signatures in P2WPKH and P2WSH spends, the sighash algorithm is described in BIP143. It is very different from the one used in legacy spends.


1

To elaborate on this part of Ugam Kamat's excellent answer: "When you sign the transaction with your private key, you include the hash of the entire transaction data as a message." The function that turns the transaction into a hash to be signed is not just any hash function; in the code it's called a "sighash" or "signature hash". Each signature contains ...


6

When you sign the transaction with your private key, you include the hash of the entire transaction data as a message. This means the signature which is generated is specific to that transaction itself and any modification to the transaction will render the signature invalid. In this case, the user who has signed the transaction has already specified the ...


1

Transaction do not need to be signed. They are if the locking script requires so, which is the most usual thing, but scripts redeemable without a signature can also be valid. That being said, a transaction redeeming from a script that does not requires a signature could be highly insecure, since a peer (or a miner) that receives so can easily change the ...


Top 50 recent answers are included