Signature Hash ALL
  • The signature hash marker determines which inputs and outputs of the transaction are endorsed.

  • The inputs & outputs of the transaction which are not endorsed can be modified after the endorsement is built.

  • Sighash ALL (0x01)
    • Endorses/Signs all inputs and outputs of transaction
    • Endorsement becomes invalid if these are modifed.
    • The serialised transaction sets other input scripts and sequences to 0.

Signature Hash NONE
  • Sighash NONE (0x02)
    • Endorses none of the outputs.
    • Outputs can be modified anytime after the endorsement is built.
    • The serialised transaction sets other input scripts and sequences to 0.
    • The serialised transaction sets outputs to 0.

Signature Hash SINGLE
  • Sighash SINGLE (0x03)
    • Endorses all inputs and single output of the same index.
    • Non-endorsed outputs can be modified anytime after the endorsement is built.
    • The serialised transaction sets other input scripts and sequences to 0.
    • The serialised transaction sets non-endorsed output fields to 0.

Signature Hash ANYONECANPAY
  • ANYONECANPAY is a sighash modifier, which is set to modify any of sighash types ALL|NONE|SINGLE.

  • It allows all other inputs to be modified.

  • It is applied to the marker: Sighash Byte|0x80

  • For example:
  • Sighash ALL|ANYONECANPAY (0x81)
    • Endorses/Signs single input and all outputs of transaction
    • The serialised transaction only includes single input, but all outputs.