Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 1.88 KB

045.md

File metadata and controls

45 lines (40 loc) · 1.88 KB
BUIP045: Unified addresses format for BUIP037
Proposer: Amaury SÉCHET
Submitted: 2017-01-12
Status: draft

This is mostly an adaptation of Rusty Russel's work for BUIP037.

The address is composed of the following elements:

  1. Prefix for type, followed by colon. Currently "btc:" or "testnet:".
  2. The version field, encoded using z-base32
  3. The hash field, encoded using z-base32
  4. At least 35 bits for crc64-ecma, up to a multiple of 5 to reach a letter boundary. This covers the prefix (as ascii), the version and the hash.
  5. The final letter is the Damm algorithm check digit of the entire previous string, using the 32 way quasigroup formed by GF(2^5) and x^5 + x^2 + 1 as base polynomial and n = 2*x + y as generator.

Step 4 and 5 add 8 characters to the address, 7 for CRC and 1 for Damm, and ensure this

This has various advantages:

  • A unified address format for all current addresses and futures features to come.
  • Nicer looking than base58 - subjective but base58 addresses tends to be intimidating for newcomers.
  • Protected against errors via a CRC64.
  • Protected against any single character change via Damm.
  • As long as the number of version is kept under 64, the first letter indicate the type of address as it is the 5 most significant digit of the version.
  • Addresses are compact enough, 42 digit for 20B hash, 61 for 32B.

Example (I did not run CRC or Damm on them, just filled with random digits):
btc:yybul3unspd4bn2aji33natie5sd2iqsikrfgm8ejk (42 digits for a P2KH, 20B hash).
btc:b1ee6ceodhmo2d0rmr7utt31u0163kdoakirgoigsd112d5batlt2a (61 digits for a P2SH, 32B hash).