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

Once provers have run some jobs, they can create a new “state” file from work proofs stored in Bento using prepare-mining:
boundless rewards prepare-mining --new ${REWARD_ADDRESS} --state-file ${STATE_FILE_LOCATION}
where ${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.
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.
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 prepare-mining --state-file ${STATE_FILE_LOCATION}
or add the mining state file location to the rewards module config by running:
boundless rewards setup
which would store the state file location, such that provers can simply run:
boundless rewards prepare-mining
from now on. If the state file location changes, make sure to update the location in the config 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.