proofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflowproofofnonzeroinflo

difficulty

difficulty here is called work: the amount of tax, in bnb, that finds one block on average. it retargets every 16 blocks so that a block takes about 32 deliveries.

work now

where the current work sits between a thousandth of a bnb and a thousand bnb.

0.0010.010.11101001000bnb of tax per blockgenesis 0.25
work now
blocks to next retarget
deliveries in this window
projected next work

retargets

every change of work found in the last 160 blocks.

a retarget happens when a block whose height divides by 16 is found. the vault counts the deliveries the last 16 blocks took. 512 deliveries is the goal, 32 for each block. the new work is the old work times 512 divided by that count, held between a quarter and four times the old work.

after blockwork beforework afterfactordeliveries in windowclamp

the rule worked through

seven cases, computed from the formula.

work is not a guess about the market. it is feedback. the vault only asks one question every 16 blocks: how many deliveries did that take. the answer moves work up or down and nothing else does.

when trades get larger, each delivery carries more bnb and blocks arrive in fewer deliveries, so work rises until a block costs about 32 deliveries again. when trades get smaller, work falls. the chain keeps the same rhythm in deliveries whatever the size of the market.

one delivery can never be worth more than one block. if a single delivery is larger than the whole work, its chance is simply one.

new work = old work * 512 / deliveries in window

new work is held between old work / 4 and old work * 4

deliveries in 16 blocksraw factorfactor appliedwhat happened
648.004.00blocks came eight times too fast, clamped
1284.004.00blocks came four times too fast
2562.002.00blocks came twice too fast
5121.001.00on target
1,0240.500.50blocks came twice too slow
2,0480.250.25blocks came four times too slow
4,0960.130.25blocks came eight times too slow, clamped