Skip to content

Conversation

@MarcosNicolau
Copy link
Member

@MarcosNicolau MarcosNicolau commented Aug 28, 2025

Description

Changes how public inputs are passed to Circom.

Previously, public inputs were provided as the UTF-8 bytes of the input.json file generated during proof creation. This approach made proofs unusable for on-chain verification, since the verification data would be committing to raw JSON bytes. Computing the same commitment in Solidity to verify the public inputs would be either impossible or prohibitively expensive, as it would require parsing JSON on-chain.

Now, public inputs are passed as big ints modulo 2^254, to make sure they stay within the prover field. This matches the actual data type used internally by the verifier. However, Circom’s Go verifier did not originally expose the necessary function to supply raw inputs, so we maintain a fork of the circom-go-verifier repository where these functions are made public. See: https://github.com/yetanotherco/go-rapidsnark

How to test

  1. Start Ethereum Package
make ethereum_package_start
  1. Start batcher
cargo clean --manifest-path ./crates/batcher/Cargo.toml
make batcher_start_ethereum_package
  1. Start aggregator
make aggregator_start_ethereum_package ENVIRONMENT=devnet
  1. Start operator

Note: You need to rebuild ffis

make build_all_ffi
make operator_full_registration CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml ENVIRONMENT=devnet
make operator_start CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml ENVIRONMENT=devnet
  1. Start explorer
make explorer_clean_db
make explorer_start
  1. Send proofs
make aligned_install_compiling
make batcher_send_circom_groth16_bn256_task
make batcher_send_circom_groth16_bn256_burst
make batcher_send_circom_groth16_bn256_no_pub_input_task
make batcher_send_circom_groth16_bn256_no_pub_input_burst
  1. Check the proofs are verified in the explorer (http://localhost:4000/)

Type of change

  • Bug fix

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

Copy link
Contributor

@MauroToscano MauroToscano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panics seems a bit strange, are we sure the user cannot send something with an invalid size and panic the code ?

@MarcosNicolau
Copy link
Member Author

Panics seems a bit strange, are we sure the user cannot send something with an invalid size and panic the code ?

You are right, I missed that, solved in 6067e86.

Copy link
Contributor

@MauroToscano MauroToscano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing case of no public inputs

@MarcosNicolau
Copy link
Member Author

Missing case of no public inputs

Added them in be11294.

@MarcosNicolau MarcosNicolau added this pull request to the merge queue Sep 1, 2025
Merged via the queue into staging with commit 6ead110 Sep 1, 2025
5 checks passed
@MarcosNicolau MarcosNicolau deleted the fix/circom-public-inputs branch September 1, 2025 14:12
@MauroToscano MauroToscano restored the fix/circom-public-inputs branch September 1, 2025 18:39
@MauroToscano MauroToscano deleted the fix/circom-public-inputs branch September 1, 2025 19:10
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.

4 participants