Skip to content

Conversation

mysteryon88
Copy link

Description

Issue: #1582

  • added snarkjs backend
  • added ExportVerifyingKey(io.Writer) for VerifyingKey
  • added ExportProof([]string, io.Writer) for Proof
  • supported curves: BLS12-381 and BN254

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

To verify the changes I implemented the following integration test workflow:

  1. Clone the demo repository
git clone https://github.com/mysteryon88/gnark-example
  1. Install npm dependencies (for snarkjs tests)
npm install
  1. Replace gnark with the updated version (containing the new export methods).

Either by using the fork/branch directly in go.mod:

replace github.com/consensys/gnark => github.com/<your-username>/gnark <branch>
  1. Run Go tests to generate JSON files
go test ./cubic -v -run TestCubicBLS12_381
go test ./cubic -v -run TestCubicBN254

After this step, the following files are produced:

  • keys/verification_key_.json
  • proofs/proof_.json
  1. Run npm test to verify proofs with snarkjs
npm test

How has this been benchmarked?

The newly added export functions are only used when explicitly called and do not affect the core proving or verification logic. They perform simple serialization to JSON and therefore should not impact the overall performance of the library.

Environment:

  • Windows 10 Pro (64-bit)
  • Intel i7-12700H
  • 32 GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…s-compatible JSON

- added ExportVerifyingKey(io.Writer) for VerifyingKey
- added ExportProof([]string, io.Writer) for Proof
- supported curves: BLS12-381 and BN254
Copy link

cursor bot commented Aug 21, 2025

🚨 Bugbot Trial Expired

Your team's Bugbot trial has expired. Please contact your team administrator to turn on the paid plan to continue using Bugbot.

A team admin can activate the plan in the Cursor dashboard.

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 this pull request may close these issues.

1 participant