This project provides ProverProxy
for users attempting to assert the validity of a specific block
on Optimism.
SuccinctLab’s SP1 offers a Network Prover that generates execution
proofs for general Rust program (Guest program). The ProverProxy
includes a client for the
SP1 Network Prover, requests
proof generation from the Network Prover using the input generated by the witness generator, and caches the generated proof in the database.
The API key issued by SP1 team must be set to run ProverProxy
. It is recommended to fill in
the following environment variables in the .env
file
SP1_PRIVATE_KEY=<NEED_TO_BE_ISSUED_FROM_SP1_TEAM>
> cargo run --bin prover-proxy --release -- --endpoint <IP_WITH_PORT> --data <DB_PATH>
# example
> cargo run --bin prover-proxy --release -- --endpoint 0.0.0.0:3030 --data /data/proof_store
Register a request to generate a proof.
{
"jsonrpc": "2.0",
"method": "requestProve",
"params": [<0xL2Hash>, <0xL1HeadHash>, <WitnessFromWitnessGenerator>],
"id": 0
}
It returns the witness after finishing to generate it.
{
"jsonrpc": "2.0",
"method": "getProof",
"params": [<0xL2Hash>, <0xL1HeadHash>],
"id": 0
}
This online test uses prover-proxy/tests/data/witness.json
as input to request a proof from the SP1 network prover.
The test requires the SP1_PRIVATE_KEY
to be set in the .env file.
The witness.json
file is generated by witness generator.
> just test-all
> just run-integration-tests <0xL2Hash> <0xL1HeadHash> <WitnessJson>
After running just test-all
, onchain-verification of the proof is possible through the following test.
> just run-onchain-verify
Inject the .env file described above.
> docker build -f docker/Dockerfile.proverproxy.ubuntu -t kromanetwork/zkvm-prover-proxy .
> docker run -itd --env-file .env -p 3031:3031 prover-proxy