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

bug: BN254 mpcsetup "phase2Evaluations" file not encoded properly #1136

Open
irfanbozkurt opened this issue May 21, 2024 · 0 comments
Open

Comments

@irfanbozkurt
Copy link

Description

semaphore-mtb-setup is a tool to conduct phase2 section of the mpc trusted setup for BN254 groth16 circuits.

Steps of MPC require all artifact files to be decoded & encoded properly.

One of these artifacts is the output of "InitPhase2" function: Phase2Evaluations. This artifact is used in the end when extracting pkey and vkey, being passed as an input to "ExtractKeys" function.

vkey has a parameter "G1.K" that directly comes from the "G1.VKK" parameter of a Phase2Evaluations instance. However, Phase2Evaluations's marshalling code lacks this parameter, and this causes vkey to have "G1.K" as an empty list.

Eventually, a proof generated by outputted pkey can't be verified with the outputted vkey.

Expected Behavior

ExtractKeys yields a verifier key where "G1.K" is a list with length #public_variables.

Actual Behavior

ExtractKeys yields a verifier key where "G1.K" is an empty list.

Possible Fix

Adding "G1.VKK" as a parameter to marshalling logic of Phase2Evaluations was enough to verify a proof created by corresponding pkey.

Steps to Reproduce

  1. Pull semaphore-phase2-setup (a fork of semaphore-mtb-setup mentioned above)
  2. Follow the steps in README to initialize the ceremony and perform contributions.
  3. Follow the steps in README to extract the keys and prove an example circuit
  4. Try to verify it with corresponding vkey, and possibly print the aforementioned parameter of vkey.

Context

I was trying to simulate a phase2 ceremony and I wasn't able to verify a given proof.

Your Environment

  • gnark version used : v0.10.0
  • gnark-crypto version used: v0.12.2
  • go version (e.g. 1.20.6): 1.21.4
  • Operating System and version: MacOS 14.4.1
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 a pull request may close this issue.

1 participant