Skip to content
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

CIP5 - Common Bech32 Prefixes #6

Merged
merged 3 commits into from
Aug 4, 2020
Merged

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented May 28, 2020

draft proposal for CIP-5

@KtorZ KtorZ changed the title draft proposal for CIP-5 CIP-5 Common Bech32 Prefixes May 28, 2020
@KtorZ KtorZ changed the title CIP-5 Common Bech32 Prefixes CIP5 - Common Bech32 Prefixes May 28, 2020
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, bech32 has a quite low limit on its maximum size (90 bytes encoded right?), so it will be unsuitable for any of the larger things, such as most of the certificates. Indeed wouldn't it be unsuitable for extended keys too?

CIP5/README.md Outdated Show resolved Hide resolved
CIP5/README.md Outdated
Comment on lines 30 to 33
| `ed25519_pub` | An Ed25519 public key |
| `ed25519_prv` | An Ed25519 private key |
| `ed25519_xpub` | An Ed25519 extended public key |
| `ed25519_xprv` | An Ed25519 extended private key |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ones do not need to be short, since they are not addresses. I think it is very useful for these keys to include a key "role", or key "type", which is not about the cryptography, but about the purpose of the key. This is to detect and prevent accidentally using a key made for one thing for another. For example to avoid using a stake key as a payment key, or a pool key as a payment key etc etc. We do this in the cardano-cli now and it has saved us from operator error many many times already.

I'll add a full list here later.

@SebastienGllmt
Copy link
Contributor

SebastienGllmt commented May 29, 2020

You may want to mention https://github.com/satoshilabs/slips/blob/master/slip-0173.md

@KtorZ KtorZ self-assigned this May 29, 2020
@KtorZ
Copy link
Member Author

KtorZ commented Jul 1, 2020

As I understand it, bech32 has a quite low limit on its maximum size (90 bytes encoded right?), so it will be unsuitable for any of the larger things, such as most of the certificates. Indeed wouldn't it be unsuitable for extended keys too?

@dcoutts this is partially correct. Bech32 embedded error-detection works very well for chain smaller than 90 characters, but it is said to work reasonably well up to 1024 characters. Above 89 characters, the probability of detecting errors becomes a bit smaller, yet remains okay.

@ilap
Copy link

ilap commented Jul 20, 2020

I would prefer smaller HRPs like in the SLIP-173 @SebastienGllmt mentioned also, the "addr" common prefix is too general for the users especially when there would be native multi-asset tokens available for Cardano very soon.

Other reason is having less complex QR codes for the native currency and tokens.
Bech32 has 23 chars and 9 numbers, which can be used in HRP too, that would allow a very compact QR code for a hash28 token addresses as that mode can use only the 32-chars as a character set. As and example ca1xxxxxxx as c and a int the bech32 character set.

Also, we need to distinguish between the wallet- and the chain addresses (serialised keys, hash scripts etc on chain as an example). The wallet addresses are just for humans i.e. wallet users etc. for giving some meaning to or just wrap these chain-addresses.
But, as an example a user could choose his/her wallet address' prefix anyway(in a wallet that have that feature), as it won't affect the real on-chain addresses, meaning addr1xxxx or this_is_my1xxxx can refer to the exactly the same address on the chain.

Anyway, see detailed QR examples for different character sets used with bech32

Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to move into draft status. More comments can still be incorporated.

Copy link
Contributor

@crptmppt crptmppt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go as Draft

@dcoutts dcoutts merged commit 834cd29 into cardano-foundation:master Aug 4, 2020
stevenj referenced this pull request in input-output-hk/catalyst-CIPs Jun 19, 2023
Minimum changes to generalize description and explains how to use it in any voting system (not just catalyst). Small fixes, typos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants