add: IPA Proof and Multiproof Ser/De #350
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #349
IPA Proofs in Verkle consists of
a Left array of 8 Base Field points, a Right array of 8 Base Field points,
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
The queried Base Field where the Vector Commitment
opening
is created, consider this as the equivalent to theMerkle Path
in usual Merkle Trees.The entire IPAProof which is exactly a 576 byte array, go through
serializeIPAProof
for the breakdownThe format of serialization is as:
Query Point (32 - byte array) .... IPAProof (544 - byte array) = 32 + 544 = 576 elements in the byte array