In EIP-255 , @karalabe proposes a PoA-scheme which reuses the current header-fields. The PoA-scheme has the following scheme to handle forks (caused by malicious minters or general latency):
If the number of authorized signers are N, and we allow each signer to mint 1 block out of K, then at any point in time N-K miners are allowed to mint. To avoid these racing for blocks, every signer would add a small random "offset" to the time it releases a new block. This ensures that small forks are rare, but occasionally still happen (as on the main net). If a signer is caught abusing it's authority and causing chaos, it can be voted out.
This gist outlines another scheme, by using the difficulty header.
The difficulty field in a block header is unused in a PoA scheme. Traditionally, the difficulty is used to define what
blocks are preferred, in the case of a fork. Two competing blocks/chains are effectively judged by difficulty, and the 'best' is chosen
as the canon one. Thus, difficulty (and total difficulty) is a metric of the quality of the chain.
In a PoA-scheme, the same semantic meaning (quality of chain) can be reused on the same field.
Scheme:
- With N minters,
- any minter is allowed to mine a block at any height
- A block mined by minter
Kat height (h % N == K) is consideredin-turn - A block mined by minter
Kat any other height is consideredout-of-turn. - An
in-turnblock must havedifficultyset to2 * X - An
out-of-turnblock must have difficulty set toX. Xis some constant, e.g. the genesis difficulty.
With this scheme, the 'best' chain will be the one where most minters mine in-turn, but if any minter(s) goes offline, remaining minters can continue
to mine the chain.