It calculates sqrt
using an RPC server implemented in Rust.
protoc
from herescarb
from herelambdaworks/provers/cairo
from here for proving only. As of February 2024, the tested revision isfed12d6
.
- Start the hints server:
- Rust:
cd rust; cargo run
- Javascript:
cd js; npm install; npm start
- Rust:
- Run
scarb hints-run --oracle-server http://127.0.0.1:3000 --layout all_cairo
If the circuit requires built-ins, it's possible to add the flag --layout <VALUE>
It's possible to generate trace and memory files when running the circuit
by adding the flags --trace-file <PATH> --memory-file <PATH>
.
If the intention is to generate and verify a proof, execute scarb hints-run
with the flag --proof-mode
.
The proof can be generated and verified using lambdaworks/provers/cairo
.
The command to generate the proof is: platinum-prover prove <TRACE_FILE> <MEMORY_FILE> <PROOF_FILE>
.
The command to verify a proof is: platinum-prover verify <PROOF_FILE>
.
The command for running tests is: scarb hints-test --oracle-server http://127.0.0.1:3000 --layout all_cairo
Proof generation and verification has been tested exclusively with lambdaworks-fed12d6
. Other versions may generate invalid proofs.
To install the prover, execute the following commands:
git clone https://github.com/lambdaclass/lambdaworks.git
cd lambdaworks
git checkout fed12d674418e4f09bc843b71bc90008a85b1aed
cd provers/cairo
cargo install --path . --locked --features=cli,instruments,parallel