Also known as SigHash, it is an instruction (in a transaction input) from a signer to a verifier to say “to get this to verify, you’ll need to construct a transaction template like this.” For each input in a transaction, a different hashtypeCode might be used.
It is defined in interpreter.h of the Bitcoin Core software:
/** Signature hash types/flags */
enum
{
SIGHASH_ALL = 1,
SIGHASH_NONE = 2,
SIGHASH_SINGLE = 3,
SIGHASH_ANYONECANPAY = 0x80,
};
From Raghav Sood:
SIGHASH_ANYONECANPAY is combined with the previous three via a bitwise
& (effectively addition in this case), for a total of six possible
values.
hashTypeCode |
hashTypeCode Identifier |
Tx fields used in signature |
|---|---|---|
0x01 |
SIGHASH_ALL |
All inputs and outputs. |
0x02 |
SIGHASH_NONE |
All inputs. No outputs. |
0x03 |
SIGHASH_SINGLE |
All input. One output. |
0x81 |
SIGHASH_ANYONECANPAY & SIGHASH_ALL |
One input. All outputs. |
0x82 |
SIGHASH_ANYONECANPAY & SIGHASH_NONE |
One input. No outputs. |
0x83 |
SIGHASH_ANYONECANPAY & SIGHASH_SINGLE |
One input and its corresponding output. |
The procedure is described at bitcoin.it
See also:
bitcoin.org










