Definition
SIGHASH (signature hash type) is a one-byte flag attached to the end of every Bitcoin signature that declares exactly which parts of a transaction that signature is committing to. By varying the flag, a signer can pin down the whole transaction or deliberately leave parts open for others to modify — the mechanism that makes collaborative and conditional transactions possible.
The base flags
Three base types control how outputs are signed. SIGHASH_ALL (0x01), the overwhelming default, commits to all inputs and all outputs — the signature is void if anything changes. SIGHASH_NONE (0x02) signs the inputs but no outputs, so the funds' destination is left mutable. SIGHASH_SINGLE (0x03) commits only to the single output at the same index as the signing input, letting other outputs be altered.
The ANYONECANPAY modifier
The flag SIGHASH_ANYONECANPAY (0x80) is OR-ed onto a base type. It restricts the signature to commit to only its own input, allowing anyone to add further inputs afterward. Combined with SIGHASH_SINGLE or SIGHASH_NONE it enables crowdfunding-style and atomic-swap constructions where multiple parties assemble one transaction.
In legacy and SegWit v0 scripts the sighash byte rides along with the DER-encoded signature checked by OP_CHECKSIG; under Taproot and Tapscript the digest is computed differently and supports a new default that commits to all inputs' amounts. Most wallets only ever use SIGHASH_ALL, but the other modes are the quiet plumbing behind PSBTs, payment batching, and many Lightning and DLC constructions. Misusing them — especially SIGHASH_SINGLE with no matching output — has historically caused real fund losses, so they are wielded carefully.
In Simple Terms
SIGHASH (signature hash type) is a one-byte flag attached to the end of every Bitcoin signature that declares exactly which parts of a transaction that…
