Mining Walkthrough
Enable ZK mining within Bento
Please see Enabling ZK Mining.
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
, submit
and claim
.
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
:
boundless povw prepare --new ${REWARD_ADDRESS} --state ${STATE_FILE_LOCATION} --from-bento
where ${STATE_FILE_LOCATION}
is something like: ~/folder/state.bin
.
prepare
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
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
and use the state file like so:
boundless povw prepare --state ${STATE_FILE_LOCATION} --from-bento
Submit the aggregated work proof onchain
After running prepare
, provers are ready to submit onchain with:
boundless povw submit --state ${STATE_FILE_LOCATION} --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY} --povw-private-key ${POVW_PRIVATE_KEY}
where the PRIVATE_KEY
is a private key for an Ethereum wallet with enough funds to cover gas costs, and POVW_PRIVATE_KEY
is the private key for the rewards address.
submit
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
.