GHOSTDAG
Keeping every block raises a question a chain never had to answer: which blocks were mined by miners who were properly connected to the network, and which were mined off in a corner by someone who had not seen what everyone else had seen?
GHOSTDAG answers it by finding a large set of blocks that all saw each other — the blue set. Blocks left out are red.
The rule
Each block picks the parent with the highest blue score as its selected
parent, and inherits that parent’s blue set. It then walks the blocks it
merges and paints one blue if fewer than k blues sit in its anticone — the
blocks it neither descends from nor precedes, which is to say the blocks mined
without knowledge of it. A block that too many blues never saw is red.
There is a second half to the check that is easy to miss: admitting a candidate
must not push any existing blue block over k either. The constraint runs
both ways, which is why raising k sometimes changes the colouring in ways that
are not obvious from any single block.
What k means
Drag k to 0. Only a straight chain survives as blue — every parallel block is
excluded, which is essentially Bitcoin’s rule expressed in DAG terms. Raise it
and parallel blocks are welcomed in. At k = 4 only block K is left out; by
k = 6 even K fits.
K is the lagging block: it was mined on C alone, long after C, so six
blocks sit in its anticone. It is what a poorly-connected miner produces.
Real Kaspa derives k from the block rate and the network’s propagation delay,
so that honest, well-connected miners are practically never painted red.
Next
Colouring is not the goal. Ordering is — turning the coloured DAG into one sequence every node agrees on.