Use a bellman::Proof
instead of a byte array in Groth16Proof
#3179
Labels
A-cryptography
Area: Cryptography related
C-cleanup
Category: This is a cleanup
C-enhancement
Category: This is an improvement
Motivation
We use a byte array in the
Groth16Proof
struct. However, not every byte array is a well-formed proof (i.e. the encoding of three field elements, as enforced by thebellman
package). For improved type safety, it would be better to usebellman::Proof
inside it and parse the proof while parsing the transaction.However, this requires a lot of code changes:
Arbitrary
implementation must be changed to generate random well-formed proofs.For this reason, it was postponed for later.
Specifications
Designs
To generate a well-formed proof, you will need to generate 3 field elements: one in G1, second in G2, third in G1 again. See this snippet for reference:
zebra/zebra-consensus/src/transaction/tests.rs
Lines 1956 to 1960 in 81727d7
Related Work
The text was updated successfully, but these errors were encountered: