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

Decide and define PublicKeys, PrivateKeys and Signatures serialization Strategy #15186

Closed
Tracked by #15216
mxtartaglia-sl opened this issue Aug 28, 2024 · 1 comment
Closed
Tracked by #15216
Assignees
Labels
Platform Tickets pertaining to the platform

Comments

@mxtartaglia-sl
Copy link
Contributor

mxtartaglia-sl commented Aug 28, 2024

EcPublicKeys, EcPrivateKeys and EcSignatures need to be stored in state. Therefore need to be serialized.
The underlying objects (Pairings GroupElements and FieldElements) will know how to serialize themselves into byte arrays with the provided serialization mechanism from arkworks: https://github.com/arkworks-rs/algebra/blob/master/serialize/README.md
That byte array that is already canonically serialized needs to be appended with a value (the signature schema + some reserved bytes if decided) and returned in a way that will assure that it is produced deterministically.
This will not be exposed to the library's users. They don't need to know that protobuf will be used internally.

A suggestion instead of having a protobuf structure directly in the code is to produce the ByteString https://protobuf.dev/reference/java/api-docs/com/google/protobuf/ByteString instead.

We should go over and talk about alternatives. We should also understand the effect of introducing something other than direct serialization for consumers of the signature and the ledger when reading the blockade.

@mxtartaglia-sl mxtartaglia-sl changed the title Decide and define Protobuf managment strategy for hedera-cryptography Decide and define Protobuf managment strategy for hedera-cryptography Aug 28, 2024
@mxtartaglia-sl mxtartaglia-sl added the Platform Tickets pertaining to the platform label Aug 28, 2024
@mxtartaglia-sl mxtartaglia-sl self-assigned this Sep 5, 2024
@mxtartaglia-sl mxtartaglia-sl changed the title Decide and define Protobuf managment strategy for hedera-cryptography Decide and define PublicKeys, PrivateKeys and Signatures serialization Strategy Sep 12, 2024
@mxtartaglia-sl
Copy link
Contributor Author

@edward-swirldslabs summarized the definitions here: https://swirldslabs.slack.com/archives/C0718FR2FPB/p1726158751700539
Image

Take aways:

  • Serialization continue as planned, we will use the returned serialization from arkworks and append 1 byte to define the signature schema
  • We need to converge the hashing mechanism to whatever can be used in S.C. possibly using KECCAK as hashing function + some encoding / mapping mechanism to the curve compatible with what can be produced in a s.c.
    This needs to be reviewed also by @rsinha . also cc: @AlfredoG87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Tickets pertaining to the platform
Projects
None yet
Development

No branches or pull requests

1 participant