Skip to content

Instantly share code, notes, and snippets.

@DesWurstes
Last active May 12, 2018 22:53
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save DesWurstes/bba4222c8b6253b940096fcede97e17a to your computer and use it in GitHub Desktop.
Save DesWurstes/bba4222c8b6253b940096fcede97e17a to your computer and use it in GitHub Desktop.

The new Bitcoin Cash address format ("Cash Address")

On ~January 14, the Bitcoin Cash clients will (we expect huge adoption) switch to the new Cash Address address format.

Related to Bech32?

Bech32 is the name of the address format proposed by Core developers (for SegWit addresses,BIP 173. It consists of 32 different characters, and "Bech" sounds like "Base" while keeping the error-correction algorithm "BCH" (or Bitcoin Cash ticker!) in mind. Bitcoin Cash will use a slightly different Bech32 address format, which is called "Cash Address".

So what?

Here's how the typical addresses will look like:

  • bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a (P2PKH - 1...)

  • bitcoincash:pr95sy3j9xwd2ap32xkykttr4cvcu7as4yc93ky28e (P2SH - 3...)

  • P2PKH addresses will start with q while P2SH addresses will start with p.

  • Their length will be 54 characters.

  • QR encoding requires it to be uppercase (BITCONCASH:QP...6A). It'll be accepted by wallets, as long as it's not mixed-case.

Why not use BitPay's format?

Here is why Bech32 is better than BitPay's or the old one:

  • It uses a very strong checksum which ensure detection of up to 6 errors in an address and 8 in ‘burst’.

  • It encode more compactly in QR codes as it allows the use of the alphanumeric mode.

  • It is much faster to encode and decode than the previous format, which is important for systems having to handle a large number of addresses.

(Quote: deadalnix)

More importantly,

  • We don't need to change the address format to prevent people from sending to Cash addresses. Bitcoin Cash is the real Bitcoin, and Bitcoin Cash sent to SegWit addresses can be recovered with the help of BCH miners. We need this format for the advantages.

Why use the format invented by Core devs?

It doesn't matter who they are. What they've invented matters.

A softfork? Impact on security?

No, no forks are needed. Nothing consensus related. As before, the security isn't reduced, the public key is still hashed.

Implementations for programmers

How can I help?

  • Tell the news websites

  • Tell the Bitcoin Cash wallet developers (You can start with this list)

Specs: https://github.com/Bitcoin-UAHF/spec/blob/master/cashaddr.md

Jan 14 ref: https://lists.linuxfoundation.org/pipermail/bitcoin-ml/2017-November/000472.html

@paOol
Copy link

paOol commented Dec 31, 2017

Javascript implementation, please.

@DesWurstes
Copy link
Author

DesWurstes commented Jan 5, 2018

@PhGalaz
Copy link

PhGalaz commented May 12, 2018

php please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment