Run the Prover
Prerequisites
-
Ensure that Rust is installed.
-
Install and switch to the stable toolchain:
rustup self update
rustup install stable
rustup default stable
Setting Up the Prover
-
Clone the Prover Source Code:
Clone the prover's source code. Instructions to disable CUDA are provided if you are not using a GPU.
git clone https://github.com/marlinprotocol/kalypso-oyster-attestation-verifier-risczero
CPU-Only SetupIf you wish to join the market using a CPU only, you need to disable/remove the cuda feature in the host/Cargo.toml file. A CPU-only prover may take hours to generate a proof.
host/Cargo.toml[dependencies]
methods = { path = "../methods" }
risc0-zkvm = { version = "1.1.2", features = ["cuda"] } -
Build the Prover:
cd kalypso-oyster-attestation-verifier-risczero
cargo build --releaseYou should now have the following two executables:
./target/release/host
- Use host to benchmark your setup../target/release/kalypso-attestation-prover
- The main executable that will receive proving requests.
Benchmark Your Setup
Once the prover is built successfully, you need to benchmark it. To do so, run:
time "./target/release/host --url http://3.110.146.109:1500/attestation/raw"
http://3.110.146.109:1500/attestation/raw returns a sample attestation from an enclave. Attestations from any other Nitro Enclave can be used as well. Experimentation to determine worst-case time bounds is recommended.
Note down the time taken to generate the proof.
This command should print the proving time for the described setup. In the example log below, the real time is 12 minutes 45 seconds.
real 12m45.459s
user 45m16.517s
sys 1m31.499s
Start the Prover
-
Configure Environment Variables:
Create a
.env
file and add the following details:.envGENERATOR_ADDRESS=<<your operator address>>
GAS_KEY=<<your gas key>>
HTTP_RPC_URL=<<arbitrum-sepolia rpc url>>
MARKET_ID=3
PROOF_MARKETPLACE_ADDRESS=0xfa2AAcA897C4AB956625B72ac678b3CB5450a154
GENERATOR_REGISTRY_ADDRESS=0xdC33E074d2b055171e56887D79678136B4505Dec
ENTITY_KEY_REGISTRY_ADDRESS=0x457d42573096b339ba48be576e9db4fc5f186091
START_BLOCK=96699799
CHAIN_ID=421614
MAX_PARALLEL_PROOFS=1
IVS_URL=http://3.110.146.109:3030
PROVER_URL=http://localhost:3030/api/generateProof
Please ensure that you have properly configured the following variables in your .env
file:
-
Start the Prover:
Run the prover using the following command:
./target/release/kalypso-attestation-prover
You can now proceed to register the prover with Kalypso.
Field Descriptions
- GENERATOR_ADDRESS: Address of the Operator.
- MARKET_ID: Market ID of this RiscZero-based attestation verification market (which is 3).
- HTTP_RPC_URL: Arbitrum Sepolia RPC URL.
- PROOF_MARKETPLACE_ADDRESS: Address of the Proof Marketplace Contract.
- GENERATOR_REGISTRY_ADDRESS: Address of the Generator Registry Contract.
- ENTITY_KEY_REGISTRY_ADDRESS: Address of the Entity Key Registry Contract.
- START_BLOCK: Block number from which the prover starts looking for pending jobs.
- CHAIN_ID: Chain ID of the Arbitrum Sepolia Network.
- MAX_PARALLEL_PROOFS: Maximum number of parallel proofs the prover can process. (Set to 1 for best results in testnet.)
- IVS_URL: Input Verification Service for the RiscZero-based attestation verification market.
- PROVER_URL: Used by internal tools. Don't change this for now.