Skip to main content

Sighash | Bitcoin Glossary | Mapping Bitcoin

Sighash

Protocolo

Also known as: signature hash type, SIGHASH flag

A flag that determines which parts of a Bitcoin transaction are covered by a digital signature. Different sighash types (ALL, NONE, SINGLE, ANYONECANPAY) provide flexibility in how transactions can be modified after signing, enabling advanced use cases.

Overview

A sighash (signature hash) flag is a byte appended to each signature in a Bitcoin transaction that specifies which parts of the transaction the signature commits to. By varying the sighash flag, signers can choose to lock down the entire transaction or leave certain parts modifiable by others. This flexibility enables advanced transaction patterns like crowdfunding, open payments, and collaborative transaction building.

Sighash Types

Sighash Flags and What They Cover:

SIGHASH_ALL (0x01) — Default, most common
┌────────────────────────────────┐
│ Signs: ALL inputs + ALL outputs│
│ Nothing can be changed         │
│ "I agree to this exact tx"     │
└────────────────────────────────┘

SIGHASH_NONE (0x02)
┌────────────────────────────────┐
│ Signs: ALL inputs, NO outputs  │
│ Anyone can change where funds  │
│ go after signing               │
│ "I authorize spending my input,│
│  don't care about destination" │
└────────────────────────────────┘

SIGHASH_SINGLE (0x03)
┌────────────────────────────────┐
│ Signs: ALL inputs + ONE output │
│ (same index as the input)      │
│ Other outputs can be added     │
│ "I want my specific output,    │
│  the rest is flexible"         │
└────────────────────────────────┘

ANYONECANPAY modifier (0x80) — Can combine with above:
┌────────────────────────────────┐
│ Signs: ONLY the signer's input │
│ Other inputs can be added      │
│ "Others can contribute inputs" │
└────────────────────────────────┘

Combined Flags

The ANYONECANPAY modifier can be combined with any of the three base types:

FlagHexInputs SignedOutputs Signed
ALL0x01AllAll
NONE0x02AllNone
SINGLE0x03AllOne (matching index)
ALL|ANYONECANPAY0x81One (own)All
NONE|ANYONECANPAY0x82One (own)None
SINGLE|ANYONECANPAY0x83One (own)One (matching index)

Practical Use Cases

  • SIGHASH_ALL — Standard payments where the signer wants to lock down the entire transaction. Used in the vast majority of Bitcoin transactions.
  • ALL|ANYONECANPAY — Crowdfunding: the creator defines the output (recipient and amount), and multiple donors each sign their own input. Once enough inputs are collected, the transaction is valid.
  • SINGLE|ANYONECANPAY — Each signer commits to their own input-output pair, allowing a group to collaboratively build a transaction. Useful in certain CoinJoin constructions.
  • NONE — Rarely used, as it allows anyone to redirect the funds. Could theoretically be used in protocols where the output destination is determined later.

Taproot Sighash Changes

The Taproot upgrade introduced SIGHASH_DEFAULT (0x00), which behaves like SIGHASH_ALL but saves one byte by not appending the flag to the signature. Taproot also added the SIGHASH_ANYPREVOUT proposal (BIP118, not yet activated) which would allow signatures that do not commit to the specific input UTXO, enabling Eltoo/LN-Symmetry channel designs.

Common Misconception

Many users assume that all signatures work the same way in Bitcoin. In reality, the sighash flag gives the signer fine-grained control over what they are authorizing. However, using non-default sighash types requires careful understanding, as incorrect use can result in funds being redirectable by third parties.