Skip to content

Commit c700281

Browse files
committed
feat: circom example readme
1 parent cf6ae41 commit c700281

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

examples/circom/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Circom Example
2+
3+
This example demonstrates how to generate a Circom proof, submit it to **Aligned**, verify it on-chain, and read the public inputs from the proof.
4+
5+
The circuit is a simple Fibonacci example that outputs the result as a **public input**.
6+
7+
A Rust program is used to:
8+
9+
1. Run the Circom prover
10+
2. Submit the proof to **Aligned** for verification
11+
3. Once verified, send the verification data to the smart contract
12+
4. Update the contract state using the proof’s public input
13+
14+
## What this example showcases
15+
16+
- How to create a circuit in **Circom**
17+
- How to verify a Circom proof with **Aligned**
18+
- How to read and verify **public inputs** on-chain
19+
20+
## Project structure
21+
22+
- **`circuits/`**: the Circom circuit (Fibonacci example)
23+
- **`contracts/`**: the smart contract that update the fibonacci value with the Aligned verification
24+
- **`src/`** – Rust code to:
25+
- Run the prover
26+
- Submit the proof to Aligned
27+
- Send the resulting verification data to the contract
28+
- Update the contract state with the proof’s public output
29+
30+
## Requirements
31+
32+
- [snarkjs](https://github.com/iden3/snarkjs)
33+
- [circom compiler](https://docs.circom.io/)
34+
35+
## How to run it

0 commit comments

Comments
 (0)