Skip to main content

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

Before running prepare-mining, provers must first create a state file using the interactive setup wizard:
boundless rewards setup
The setup wizard will configure the rewards module (RPC URL, staking address, reward address) and create a new state file at a path you specify. It also stores the state file location in your config so that subsequent commands can find it automatically.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.
Please note that this state file is very important and it should be kept in a durable location.Loss of this state file will result in the loss of all work that is not submitted for the respective rewards address, meaning rewards for any work done since the last submit-mining will be lost.In this scenario, a new rewards address must be specified for Bento, and Bento should be restarted to allow further work to be recorded properly against the new rewards address. To avoid this scenario, it is recommended to store the state file in a durable location.
Once the state file is created via setup, provers can aggregate work proofs by running:
boundless rewards prepare-mining
prepare-mining aggregates all work proofs from Bento and stores the combined proof to the state file. This uses Bento to generate the aggregated work proof; therefore, make sure to have Bento running locally or specify a valid Bento API URL endpoint via --work-receipt-bento-api-url. This process is entirely local (i.e. it does not send any transaction).You can also pass --state-file ${STATE_FILE_LOCATION} explicitly if needed. If the state file location changes, make sure to update it by running boundless rewards setup again.
4

Submit the aggregated work proof onchain

After running prepare-mining, provers are ready to submit onchain with:
boundless rewards submit-mining
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.