Conversation
Very elegant proposal, I like it! Another way of looking at the prefix, is that it can be treated as an "implicit" prefix. If, for some reason, applications have issues with "bitcoincash:" as a prefix, they can just handle the data portion. The "bitcoincash" is added for the checksum, so that should eliminate problems of ambiguous address formats. In any case, it's nice to avoid the redundant double-prefix, such as "bitcoin:" and "bc1" in bech32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice.
A couple of minor nits and some question (prefix and payload padding, case normalization relating to the QR encoding).
cashaddr.md
Outdated
|
||
This document describes proposed address format to be used on Bitcoin Cash. It is a base32 encoded format using BCH codes as checksum and that can be used directly in links or QR codes. | ||
|
||
This format reuse the work done for Bech32[[1]](#bip173) and is similar is some aspects, but improves on others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This format reuse the work done for Bech32[1] and is similar is some aspects, but improves on others.
Typos:
reuses
is similar in some aspects
cashaddr.md
Outdated
|
||
## Abstract | ||
|
||
This document describes proposed address format to be used on Bitcoin Cash. It is a base32 encoded format using BCH codes as checksum and that can be used directly in links or QR codes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describes a proposed address format
cashaddr.md
Outdated
|
||
## Abstract | ||
|
||
This document describes proposed address format to be used on Bitcoin Cash. It is a base32 encoded format using BCH codes as checksum and that can be used directly in links or QR codes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to give a reference to type out the acronym for BCH and give a reference link when the acronym is first introduced in this spec. It's easily confused with current ticker used widely for Bitcoin Cash.
Bose–Chaudhuri–Hocquenghem (BCH)
|
||
The version byte's most signficant bit is reserved and must be 0. The 4 next bits indicate the type of address and the 3 least significant bits indicate the size of the hash. | ||
|
||
| Size bits | Hash size in bits | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the paragraph above mentions that the type bits come first, it would be smoother to put the type bits explanation & table first instead of the hash bits.
cashaddr.md
Outdated
|
||
#### Hash | ||
|
||
The hash part really deserve not much explaination as its meaning is dependent on the version field. It is the hash that represents the data, namely a hash of the public key for P2KH and the hash of the reedemScript for P2SH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The part that readers will probably want to know is "how is this hash calculated".
Link to other spec would be good.
Some typo corrections:
deserves
explanation
cashaddr.md
Outdated
The data to be fed are: | ||
1. The lower 5 bits of each characters of the prefix. | ||
2. A zero for the separator. | ||
3. The payload by chunks of 5 bits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"in chunks of"
I think the spec should clarify how payload needs to be padded to split into 5-bit chunks
cashaddr.md
Outdated
} | ||
```` | ||
|
||
The data to be fed are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pretty clear what is meant, but I would still suggest to make it clearer:
-> The checksum is calculated over the following data:
cashaddr.md
Outdated
|
||
Lower case is preferred for cashaddr, but uppercase is accepted. A mixture of lower case and uppercase must be rejected. | ||
|
||
Allowing for uppercase ensure that the address can be encoded effisciently in QR codes using the alphanumeric mode[[2]](#alphanumqr). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why not normalize everything to uppercase before checksum computations?
Also typo:
efficiently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't chance anything, the text is not what is checksummed.
|
||
## Uppercase/lowercase | ||
|
||
Lower case is preferred for cashaddr, but uppercase is accepted. A mixture of lower case and uppercase must be rejected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See question on paragraph below
|
||
In some contexts, such as payment URLs or QR codes, the addresses are currently prefixed with `bitcoincash:`. In these contexts, the address must not be double prefixed. | ||
|
||
## References |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As indicated, a good reference for BCH codes linked to introduction would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in recent update.
A Copay dev says they may cancel their new address format starting with https://github.com/bitpay/copay/issues/6899#issuecomment-337210359 |
Updated the spec. |
cashaddr.md
Outdated
|
||
## References | ||
|
||
<a name="bch">[2]</a> https://en.wikipedia.org/wiki/BCH_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[2] -> [1]
cashaddr.md
Outdated
The checksum is calculated over the following data: | ||
1. The lower 5 bits of each characters of the prefix. | ||
2. A zero for the separator (5 zero bits). | ||
3. The payload by chunks of 5 bits. The payload is padded with zero bits up t the point where it is a multiple of 5 bits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up t -> up to
cashaddr.md
Outdated
|
||
The prefix indicates the network on which this addess is valid. It is set to `bitcoincash` for Bitcoin Cash main net, `xbctest` for bitcoin cash testnet and `xbcreg` for bitcoin cash regtest. | ||
|
||
The prefix is followed by the spearator `:`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spearator -> separator
Updated as per comments. I'll merge as @ftrader accepted and that comment are taken care of. |
the document is lacking motivation? |
I don't have a CLUE what you guys are talking about, but it sure makes me nervous about the whole thing. |
No description provided.