Glossary·Technical

Signature Hash

The digest a signature actually signs, built from a chosen subset of the transaction. A flag names the subset, so a signature can commit to everything, to one output, or to only its own input.

Signing an input does not sign the transaction. It signs a serialisation of selected fields — version, inputs, outputs, lock time, the amount being spent — hashed twice, with a flag byte appended. The flag is also appended to the signature on the wire, so a verifier knows which digest to rebuild.

Four behaviours matter. ALL covers everything and is what nearly every payment uses. NONE covers no outputs, which authorises moving the coins anywhere. SINGLE covers one output. ANYONECANPAY restricts the input coverage to one, letting others be added freely.

The exotic combinations exist for collaborative transactions — an assurance contract where each contributor guarantees their own pair and nothing else — and they are dangerous outside those settings. A signature not covering the outputs leaves the fee, and the destinations, to whoever assembles the final transaction.

The legacy algorithm also has a defect worth knowing: with SINGLE, an input whose index exceeds the output count produces a digest of the constant 1, which anyone can reuse. SegWit and Taproot define the digest differently and do not have it; legacy inputs still do.

Where this comes up

Used in

Nearby terms

Reviewed Nov 2026