-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Bech32 Address Format #20
Conversation
An HRP of |
@cvarley100 the issue is that Bech32 addresses should not be longer than 90 chars. Legacy W-OTS addresses require 80 chars (49 bytes). This plus separator (1 char) plus checksum (6 chars) only leaves up to 3 chars for the HRP. Instead of violating this restriction of the Bech32 specification (and thus considerably weakening the error detection/correction), there are also some tricks to compress the W-OTS addresses down to 48 bytes, which would allow up to 4 char HRP. But this would require additional description, specs and also probably implementation of this mechanism. Unless there are some strong UX/PR reasons to go for |
@Wollac Why do we need a separator? Edit: Answering my own question:
|
That is just how the Bech32 standard is defined. |
All for the 3 char |
I like |
Traditionally, there is only one HRP per coin. This is exactly how other cryptos are handling it and I believe that this is also the intention behind the Bech32 spec:
On compromise could be to encode the
The address format described above is just a different encoding for the addresses. No information is lost during conversation. In theory, the wallet could still stick with the legacy format or convert it internally. |
@Wollac I really think we should go with I propose instead that we use a different identifier for wots, to differentiate it, and allow us to use |
I don't think this is an option. Bech32 and SLIP-0173 are standards that say that addresses must be at most 90 characters and that they have one human-readable denominator per coin. We should not break those requirements. @cvarley100 you have mentioned two aspects in your comment:
|
@Wollac Why do legacy addresses need to subscribe to bech32 encoding? |
Of course they don't need to be, they can be in Morse code or any other encoding. However, it is exactly the point of this RFC to have one common encoding for all current and future address types and versions. |
I'm not a fan of going to great lengths for the iota HRP. Especially since neither of the complications to achieve 48 byte address are very nice, unless the collision rate would be absolutely negligible. I see iota being better for our UX for sure, but I don't see it as that big a benefit. At the end of the day, we're building a protocol for the IoT. 🤷 |
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.
Here are a pair of very minor edits to grammar; please let me know if you have any questions about them!
-Charles
Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>
If WOTS does not need to be encoded; conversations with wallet people, various engineers and bizdev concluded that the most agreed is 4-char prefix: |
|
||
| Type | First byte | Address bytes | | ||
| ------- | ---------- | --------------------------------------------------------- | | ||
| Ed25519 | `0x01` | 32 bytes: The BLAKE2b-256 hash of the Ed25519 public key. | |
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 first and only supported address type (Ed25519) uses 1
instead of 0
. This tries to stay consistent with the address type in other RFCs, but should be unified once those types have been finalized.
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.
Should we just go forward, remove WOTS from the other RFCs and use 0 ?
@cvarley100 you can make the final call about the HRPs and we will adapt those! |
OK |
Rendered Version
Example Go implementation in wollac/iota-crypto-demo: