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
}
The test client using witness.json
generated by witness generator,
requests creation of a proof
through the ProverProxy
. Finally, the proof
is verified in the Verifier
Contract.
> git submodule update --init --recursive
> just run-integration-tests <0xL2Hash> <0xL1HeadHash> <WitnessJson>
Inject the .env file described above.
> make build-prover-proxy
> docker build -f docker/Dockerfile.proverproxy.ubuntu -t prover-proxy .
> docker run -itd --env-file .env -p 3031:3031 prover-proxy