Repository navigation
feat(tokengen): add zkatsnark public parameters gen/update/print and ValidateForDeployment - #2595
Merged
Merged
Conversation
…arams Add PublicParams.ValidateForDeployment, mirroring zkatdlog, which reports open-policy mode (empty IssuerIdentities). Add setup.GeneratePublicParams plus ParseProofSystem/ParseCurve helpers so tokengen and the NWO generator build and set up zkatsnark public parameters the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
…neratePublicParams Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Add the zkatsnarkv1 tokengen package: - gen builds fully set-up ZKAT-SNARK public parameters (groth16, plonk or plonkfri; bn254 or bls12_381; MaxBits, precision, one or more idemix issuer keys, issuers, auditors, extras) via setup.GeneratePublicParams; - update replaces or appends (deduplicated) issuers and auditors, merges extras and optionally overrides the version without re-running setup; it rejects non-zkatsnark and keyless inputs; - both warn when PublicParams.ValidateForDeployment reports open-policy mode. pp print now also decodes zkatsnark public parameters. Document the commands and deployment checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
adecaro
force-pushed
the
zkatsnark/tokengen
branch
from
October 30, 2026 13:48
3e1005c to
429804e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds operator tooling for zkatsnark public parameters, and the open-policy deployment check that zkatdlog has. Until now, zkatsnark PPs could only be generated through the NWO integration generator.
tokengencould not generate them, update their issuers or auditors, or print them.This PR is part of the series of zkatsnark-vs-zkatdlog parity PRs against
feature/zkat-snark-driver(#2590, #2591, #2592, and others).Changes
PublicParams.ValidateForDeployment(new filepp/deployment.go): mirrors zkatdlog and returns an open-policy-mode error whenIssuerIdentitiesis empty.setup.GeneratePublicParams(new filesetup/generate.go): a shared builder that applies defaults, then overrides, then runsValidateandSetupAll. It comes withParseProofSystemandParseCurve. It rejects:MaxBitsoutside 1..64;MaxBits;integration/nwo/token/generators/pp/zkatsnarkv1now uses the shared builder, so the generation logic is no longer duplicated. This is in its own commit.tokengen pp gen zkatsnark.v1andtokengen pp update zkatsnark.v1subcommands:gentakes the proof system (groth16/plonk/plonkfri), curve,MaxBits, precision, idemix key, issuers, auditors and output path. It prints a notice about the chosen proof system's setup trust model, and a warning in open-policy mode, matching the existing drivers.updatereplaces issuers and auditors, or appends them with deduplication, without regenerating keys. It checks that the input is azkatsnark.v*PP, and it refuses a PP without circuit keys.printppnow knows the zkatsnark format.docs/drivers/zkatsnark.md,docs/public_parameters.md,cmd/tokengen/README.md.chorecommit syncsgolang.org/x/netin the zkatsnarkgo.mod. Without it, the module does not build on the base branch. Other parity branches carry the same commit.Testing
pp/deployment_test.goandsetup/generate_test.go;cmd/tokengen/cobra/pp/zkatsnarkv1gen/update tests, including a zkatdlog PP rejected with the identifier-mismatch error, a keyless PP rejected, append deduplication, and circuit keys preserved;printppandpp_test.go.TestZKATSNARKGenUpdatePrint: a gexec end-to-end test incmd/tokengen/main_test.gothat runs gen, then update, then print.The plan and the implementation were each reviewed by an independent agent.
Notes
cmd/tokengenis not inGO_PACKAGES, so the new tokengen tests do not run in CI. They were run locally.gencommands still print their own inline open-policy message instead of callingValidateForDeployment. Aligning them is left as a follow-up.🤖 Generated with Claude Code