Bitcoin transaction generally require at least one signature in order to be valid.
Signatures prove that the intended recipient(s) of the funds being spent were involved in the creation of the transaction.
Each signature is generated using a private key and indicates that the owner of that private key approves of certain data in the transaction.
This page describes how these signature are generated, given data to be signed and a private key.
For details on what data is signed when signing a transaction and how the signature is formatted, see Transaction Signing.
ECDSA, as defined in RFC 6979, can be thought of as taking three input parameters: the private key, the message to be signed, and a random value, k, taken from the same domain as a private key,
Generally with ECDSA, the message used is a hash of the data that is intended to be signed.
In the case of Bitcoin Cash, this is the hash of the transaction preimage for the context in which the signature will be provided (i.e. for a given position in a script).
It is also common, and recommended, to use a deterministic k value (defined in RFC 6979, section 3), which is dependent on the private key and the message being signed.
Using a deterministic k value guarantees that a different k will never be used to sign an identical message, a mistake which would reveal the user’s private key.
However, since it is impossible to know the method used to generate k without the user’s private key, it is impossible to enforce the use of this method.
The output of ECDSA is two values, r and s which can be used with the public key and message to verify the authenticity of the signature.
However, there are technically two valid s value that are possible, which are additive inverses (i.e.
s<sub>1</sub> + s<sub>2</sub> (mod p) = 0 (mod p)).
By convention, and since HF-20171113, the lower s value must be used (this is known as the “LOW_S” rule).
Schnorr signatures have been accepted in Bitcoin Cash since HF-20190515.
Details on the implementation of Schnorr used in Bitcoin Cash can be found here.
Of particular importance are the following points: