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

code: Compute signatures over a deterministic and canonical representation of the data #798

Open
romac opened this issue Jan 22, 2025 · 2 comments
Labels
code Code/implementation related
Milestone

Comments

@romac
Copy link
Member

romac commented Jan 22, 2025

Because Protobuf serialization is not canonical 1 2, data encoded using Protobuf should not be used for hashing, signatures, hashmap keys, etc.

This is the reason why the NEAR team developed borsh and we might want to switch to that for our to_sign_bytes implementation in the test and example apps.

Alternatives to Protobuf for canonical serialization

Footnotes

  1. https://github.com/protocolbuffers/protobuf/issues/3417

  2. https://protobuf.dev/programming-guides/serialization-not-canonical/)

@romac romac added the code Code/implementation related label Jan 22, 2025
@romac romac added this to the Phase 5 milestone Jan 22, 2025
@cason
Copy link
Contributor

cason commented Jan 22, 2025

In Comet this is pretty messy, lets try to find an elegant way of doing so.

@cason
Copy link
Contributor

cason commented Jan 22, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code/implementation related
Projects
None yet
Development

No branches or pull requests

2 participants