For the proof to be valid, it is necessary that the group root passed as a parameter to the generateProof function matches the root returned by groth16.fullProve as a public signal.
There are two options for checking it:
The Semaphore proof keeps the public signals. And before verifying it devs will need to check that the root of the Semaphore proof matches the root of the group used to generate the proof (this is how V3 and current V4 work).
The Semaphore proof already returns the root that is expected to be correct (that of the group passed as a parameter). Devs will just need to verify the proof, which would fail if the roots don't match (this is how V4 will work, better DX).
Related Issue(s)
Fixes #842
Other information
Checklist
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[ ] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] I have run yarn format and yarn lint without getting any errors
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
Description
For the proof to be valid, it is necessary that the group root passed as a parameter to the
generateProof
function matches the root returned bygroth16.fullProve
as a public signal.There are two options for checking it:
Related Issue(s)
Fixes #842
Other information
Checklist
yarn format
andyarn lint
without getting any errors