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

add: IPA Proof and Multiproof Ser/De #350

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

agnxsh
Copy link
Collaborator

@agnxsh agnxsh commented Jan 23, 2024

Fixes #349

IPA Proofs in Verkle consists of

  1. a Left array of 8 Base Field points, a Right array of 8 Base Field points,

  2. and a Scalar Field element.

During serialization the format goes as follows:

L[0] (32 - byte array) L[1] (32 - byte array) .... L[7] (32 - byte array) ..... R[0] (32 - byte array) ... R[7] (32 - byte array) A (32 - byte array)

Which means the size of the byte array should be :

32 * 8 (for Left half) + 32 * 8 (for Right half) + 32 * 1 (for Scalar) = 32 * 17 = 544 elements in the byte array.

  • Note that checks like Subgroup check for Banderwagon Points for Base Field elements in L and R, and checks for a valid scalar checking the Banderwagon Curve Order is mandatory. They are all checked in the further low level functions

  • Note that check for Lexicographically Largest criteria for the Y - coordinate of the Twisted Edward Banderwagon point is also mandatory and, is pre-checked within this function from the deserialize function.

Multiproofs in Verkle have a format of

  1. The queried Base Field where the Vector Commitment opening is created, consider this as the equivalent to the Merkle Path in usual Merkle Trees.

  2. The entire IPAProof which is exactly a 576 byte array, go through serializeIPAProof for the breakdown

The format of serialization is as:

Query Point (32 - byte array) .... IPAProof (544 - byte array) = 32 + 544 = 576 elements in the byte array

Copy link
Owner

@mratsim mratsim left a comment

Choose a reason for hiding this comment

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

Thanks!

@mratsim mratsim merged commit daafe8e into mratsim:master Jan 23, 2024
16 checks passed
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.

IPAProof and Multiproof Ser/De
2 participants