← Back to Glossary

Sighash Flag

A sighash flag is a byte attached to every bitcoin signature declaring which parts of the transaction the signature commits to. The default, SIGHASH_ALL with value 0x01, signs all inputs and outputs, while alternatives such as SIGHASH_NONE, SIGHASH_SINGLE, and the ANYONECANPAY modifier deliberately leave parts of the transaction open to change after signing.

Why it matters

Sighash flags turn a signature from a simple approval into a policy statement about what the signer permits. Signing with ANYONECANPAY commits only to one's own input, letting strangers add theirs, which enables crowdfunding-style transactions where contributions accumulate toward a fixed payout. Protocol designers rely on these distinctions when building multi-party contracts, and wallets deliberately restrict unusual flags because careless combinations effectively hand value to whoever completes the transaction.

How it works

Before signing, the wallet assembles a digest of the transaction according to the chosen flag: SIGHASH_ALL hashes everything, SIGHASH_NONE omits all outputs, and SIGHASH_SINGLE pairs each input with only the output at the same position. Adding 0x80 for ANYONECANPAY drops all other inputs from the digest. Verifiers reconstruct the same digest when checking the signature, so any modification to a committed field invalidates it while uncommitted fields remain fungible. Taproot revised the digest construction in 2021 to close edge cases and add SIGHASH_DEFAULT, an implicit form of signing everything.

Ready to convert your gold to Bitcoin?

Get Your Free Kit →