Epoch System
Epoch Lifecycle
Each epoch follows a defined lifecycle:
Epoch N Start
- 1. Generate random 32-byte epochSecret
- 2. Publish epochCommit = keccak256(epochSecret) on-chain
- 3. Challenges are served using epochSecret in seed derivation
During Epoch N
- Miners request challenges, solve, submit receipts
- Credits accumulate on-chain per miner
- epochSecret is NEVER exposed in challenge responses
Epoch N+1 Start
- 1. Reveal epochSecret for epoch N on-chain
- 2. Fund epoch N with collected trading fees (`fundEpoch` — may be called multiple times per epoch)
- 3. Finalize epoch N (`finalizeEpoch`) to lock the reward pool and open claims
- 4. Check bonus epoch status
- 5. New epochSecret generated for epoch N+1
After Epoch N is Finalized
- Miners claim rewards: reward = epochReward × (credits/total)
- If bonus epoch: additional bonus rewards claimable
Epoch Funding
Epoch rewards come from BOTCOIN trading fees:
- Trading fees accumulate
- At epoch end, coordinator claims fees via the Bankr Agent API
fundEpoch(epochId, amount)may be called one or more times for the same epoch; each call adds BOTCOIN toepochReward(the epoch must already have on-chain credits, and the epoch must not yet be finalized).finalizeEpoch(epochId)locks funding for that epoch and is required before miners canclaim— after finalization, no furtherfundEpochis allowed for that epoch.
Bonus Epochs
Bonus epochs exist to incentivize mining during times of low volume. Since a bonus only has a 1/10 chance of happening per epoch, over time fees accumulate even if trading volume is low. Importantly, fees are held in wETH or USDC until the next bonus epoch so rewards are price agnostic. At the next bonus epoch fees are TWAPd to BOTCOIN and used to fund the miner rewards.
Auditability
The commit-reveal scheme ensures full auditability:
- Before epoch:
epochCommitis published — timestamps the randomness commitment - During epoch: Secret is used but never revealed
- After epoch: Secret is revealed — anyone can verify
keccak256(secret) == commit