Step-by-step
1
Enable ZK mining within Bento
Please see Enabling ZK Mining.
2
Start Proving
Provers are now ready to run proving workloads with ZK mining enabled; this can be done by running a prover on the Boundless marketplace or elsewhere.For each proving job, R0VM will automatically generate work proofs. These work proofs track the total amount of proving work done (in cycles). Each epoch, provers will need to submit their accumulated work to the PoVW accounting smart contract. If provers DO NOT submit work each epoch, they will not receive any rewards for that epoch.To do this, provers must use the Boundless CLI and run the following three commands,
prepare-mining, submit-mining and claim-mining-rewards.3
Create and Update the State File
Once provers have run some jobs, they can create a new “state” file from work proofs stored in Bento using where or add the mining state file location to the rewards module config by running:which would store the state file location, such that provers can simply run:from now on. If the state file location changes, make sure to update the location in the config by running
prepare-mining:${STATE_FILE_LOCATION} is something like: ~/folder/state.bin.prepare-mining aggregates all work proofs and stores the combined proof to the state file. This uses Bento to generate the aggregated work proof (see prepare.rs); therefore, make sure to have Bento running locally or specify a valid Bento API URL endpoint via --bento-api-url. This process is entirely local (i.e. it does not send any transaction).The resultant state file keeps track of all work done so far for one reward address. Each reward address should have exactly one state file associated with it. Submitting work for a rewards address requires all previously submitted receipts to be included in the state file. The same state file must be used for submitting any additional work done by the associated rewards address. If two state files have the same rewards address, they will conflict during submit-mining because they will have different Merkle tree states.Provers only specify the --new ${REWARD_ADDRESS} flag once, this is necessary to create the state file for that specific rewards address. Once the state file is created, provers can run prepare-mining and specify the state file location directly:boundless rewards setup again.4
Submit the aggregated work proof onchain
After running
prepare-mining, provers are ready to submit onchain with:submit-mining also requires Bento for proving (see submit.rs). Therefore, make sure to have Bento running locally or specify a valid Bento API URL endpoint via --bento-api-url.