Skip to content

kroma-network/zkvm-prover-proxy

Repository files navigation

Kroma SP1 Prover

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.

Run a Prover Proxy

Environment Variables

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>

Run

> 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

API Overview

requestProve method

Register a request to generate a proof.

{
    "jsonrpc": "2.0",
    "method": "requestProve",
    "params": [<0xL2Hash>, <0xL1HeadHash>, <WitnessFromWitnessGenerator>],
    "id": 0
}

getProof method

It returns the witness after finishing to generate it.

{
    "jsonrpc": "2.0",
    "method": "getProof",
    "params": [<0xL2Hash>, <0xL1HeadHash>],
    "id": 0
}

Test

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

Build Docker Images

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

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published