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

Update identifiers specified in CIP5 with prefixed bech32 encoding #295

Closed
3 tasks
rhyslbw opened this issue Sep 10, 2020 · 11 comments
Closed
3 tasks

Update identifiers specified in CIP5 with prefixed bech32 encoding #295

rhyslbw opened this issue Sep 10, 2020 · 11 comments
Assignees

Comments

@rhyslbw
Copy link
Contributor

rhyslbw commented Sep 10, 2020

Other tools and services are in the process of implementing CIP5, despite it's draft status, so to ensure we're presenting a consistent value, it would be good timing to implement here:

Applicable Prefixes

  • pool
  • pool_vk
  • vrf_vk
@erikd
Copy link
Contributor

erikd commented Sep 10, 2020

db-sync uses the address rendering from cardano-api which is in the cardano-node repository. Transferring this ticket to that repo.

@erikd erikd transferred this issue from IntersectMBO/cardano-db-sync Sep 10, 2020
@rhyslbw
Copy link
Contributor Author

rhyslbw commented Sep 11, 2020

@erikd Are these not already implemented in the API library?

@intricate
Copy link

@rhyslbw: Yes, the API already has support for the Bech32 prefixes specified in CIP5 (including the ones you've listed).

@dcoutts
Copy link
Contributor

dcoutts commented Sep 15, 2020

We recently audited the cardano-api for compliance with CIP5.

@rhyslbw
Copy link
Contributor Author

rhyslbw commented Sep 16, 2020

Thanks @intricate and @dcoutts. Please transfer this issue back to cardano-db-sync as I don't have maintainer capabilities to do it myself

@intricate intricate transferred this issue from IntersectMBO/cardano-node Sep 16, 2020
@erikd
Copy link
Contributor

erikd commented Sep 17, 2020

Assuming cardano-api is doing the right thing, this should just work now (5.0.0 tag).

@rhyslbw
Copy link
Contributor Author

rhyslbw commented Sep 17, 2020

@erikd

SELECT * from pool_hash LIMIT 5
1	\x153806dbcd134ddee69a8c5204e38ac80448f62342f8c23cfe4b7edf
2	\x0f292fcaa02b8b2f9b3c8f9fd8e0bb21abedb692a6d5058df3ef2735
3	\xc1ede3cc9133209466774d4826044e408db13d6fe6df751a73500f16
4	\x01df29429173d263c7533a22742dae19f16a08798b7a57873c34cf58
5	\x6b6164af70861c5537cc9c8e50fdae35139ca2c8c6fbb42e8b7e6bfb

@erikd
Copy link
Contributor

erikd commented Sep 17, 2020

Oh, this is not just about addresses! Ok, yes, they might need to be stored both as hex and as Bech32.

As for the others, I have found block.vrf_key and pool_update.vrf_key . Is that the ones?

@rhyslbw
Copy link
Contributor Author

rhyslbw commented Sep 17, 2020

I have found block.vrf_key and pool_update.vrf_key . Is that the ones?

Yes, these are the prefixes and their allocations as per the CIP

  • pool_vk Pool operator verification key
  • vrf_vk VRF verification key

@erikd
Copy link
Contributor

erikd commented Oct 8, 2020

I am not currently aware of any queries that use the raw ByteString version of these fields, so I could just switch then to using the Bech32 encoding rather than duplicating them. Does that make sense?

@erikd
Copy link
Contributor

erikd commented Oct 9, 2020

Ok, block.vrk_key has a Bech32 prefix and hence an encoding.

pool_update.vrf_key does not have a Bech32 prefix.

erikd added a commit that referenced this issue Oct 11, 2020
In this case we store both the raw hex and Bech32 encoded version.

Closes: #295
@erikd erikd closed this as completed in a503bb9 Oct 12, 2020
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

No branches or pull requests

4 participants