Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Open CashAddr #266
This pull request provides a revision of CashAddr that intends to make the specification less ambiguous while, at the same time, allowing CashAddr to be used as a general form of address encoding on Bitcoin Cash. The changes can be summed up as:
This revision makes previously invalid payloads now valid (eg.
After a brief review of some libraries, although theoretically less backward compatible it seems this revision is, in practice, as backwards compatible as the one in PR #259. Most libraries are limited to the 3 Bitcoin Cash networks and their corresponding address prefixes.
In this specification new address schemes, like stealth addresses, could look like this:
There is a slight conceptual error in this one. You write:
However actually it's structured like this:
In other words, the checksum is appended after conversion to base32.
The distinction is important in the case where the number of bits preceding checksum (8N) is not a multiple of 5. For example when we have normal P2PKH addresses (N = 21, so 168 bits) that leaves only 3 bits left over on the last base32 character of the payload. So if you look at the 9th-from-last character on such an address you'll see it only ever takes on one of 8 values: q, p, z, r, y, 9, x, 8, and not any of the other 24 values.
You're right about my error, the payload is not necessarily byte aligned (8N = 5M) and I assumed it was.
In that part I'm referring to the data, and not the representation, so I can also add the variable padding to the diagram as bellow. I believe it's important to make explicit that the encoded data is actually a series of bytes since, in general, there would no way to figure "P".
data padding checksum +------ ~ -------+--------+---------+ | N bytes | P bits | 40 bits | +------ ~ -------+--------+---------+
Regarding your example, just a note that, the 8 possible characters are actually q, y, g, v, s, 5, c, and u.