Skip to content

Conversation

@hawkadrian
Copy link

@hawkadrian hawkadrian commented Nov 5, 2025

Adds example showing how to print constraints from compiled constraint system using type assertion and GetR1Cs()/GetSparseR1Cs() methods.

Fixes #1640


Note

Adds a new example package showing how to compile a circuit and print R1CS/SparseR1CS constraints and stats on BN254.

  • Examples:
    • examples/print_constraints:
      • Adds CubicCircuit (x^3 + x + 5 == y).
      • New examples to compile on BN254 with r1cs.NewBuilder and scs.NewBuilder, type-assert to cs_bn254.R1CS/SparseR1CS, fetch constraints via GetR1Cs/GetSparseR1Cs, and print system stats and each constraint using String().

Written by Cursor Bugbot for commit 3a0227a. This will update automatically on new commits. Configure here.

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.

docs: add example how to print constraints in compiled constraint system

1 participant