• Public
  • Public/Protected
  • All

Enumeration CashAddressVersionByte

The CashAddress specification standardizes the format of the version byte:

  • Most significant bit: reserved, must be 0
  • next 4 bits: Address Type
  • 3 least significant bits: Hash Size

Only two Address Type values are currently standardized:

  • 0 (0b0000): P2PKH
  • 1 (0b0001): P2SH

While both P2PKH and P2SH addresses always use 160 bit hashes, the CashAddress specification standardizes other sizes for future use (or use by other systems), see CashAddressSizeBit.

With these constraints, only two version byte values are currently standard.


Enumeration members

Enumeration members


P2PKH: = 0

Pay to Public Key Hash (P2PKH): 0b00000000

  • Most significant bit: 0 (reserved)
  • Address Type bits: 0000 (P2PKH)
  • Size bits: 000 (160 bits)


P2SH: = 8

Pay to Script Hash (P2SH): 0b00001000

  • Most significant bit: 0 (reserved)
  • Address Type bits: 0001 (P2SH)
  • Size bits: 000 (160 bits)

Generated using TypeDoc