Back to the start
Five ideas. Start wherever you like.

GHOSTDAG

GHOSTDAG - how do all Nodes reach the same order inside a BlockDAG?

A BlockDAG can keep blocks that were created in parallel inside the same structure.

But that is still not enough.

If two blocks were created in parallel, the graph can tell us:

"Both exist, and both connect to the same past."

By itself, it does not tell us:

Which one should come first when the transactions inside them are checked?

Kaspa uses GHOSTDAG for that.

Why do we need an order at all?

Imagine one block contains:

Emma → Liam: 30 KAS

A parallel block contains:

Emma → Olivia: the same 30 KAS

Both blocks can stay in the BlockDAG.

But both payments cannot be accepted.

For every computer to reach the same answer, they need to reach the same order.

If the payment to Liam comes first, the same money is no longer available for the payment to Olivia.

So:

Keeping the blocks is one problem.

Ordering them is another.

GHOSTDAG gives every Node the same rules for ordering the blocks

Each Node looks at the BlockDAG and applies the same GHOSTDAG rules.

Those rules look at:

how the blocks are connected, and the Proof of Work behind them.

Because the Nodes use the same rules, they can reach the same answer about how the history should be ordered.

It does not depend on:

"Which block reached my computer first?"

One Node may hear about one block first, while another Node hears about the other block first.

The order must come from the protocol rules, not from the local arrival order at one computer.

Numbers show one illustrative ordering of the connected blocks. This is not a GHOSTDAG calculation or a guarantee of acceptance; transaction rules still apply.

GHOSTDAG identifies a preferred path through the graph

You can think of the BlockDAG as a network of connected paths.

GHOSTDAG identifies a central preferred path according to the protocol rules and the Proof of Work behind the graph.

But it does not simply throw away everything that is not exactly on that path.

Blocks created in parallel can still be included in the overall ordering.

That is an important difference from a single-chain design where one main line eventually remains.

What are "Blue" and "Red" blocks?

GHOSTDAG classifies blocks as part of the way it analyzes the graph.

Some are classified Blue and some Red.

The names can be misleading if they are taken too literally:

Blue does not mean "good block."

Red does not mean "fake block" or "bad block."

The color describes the block's place in the GHOSTDAG calculation and its relationship to other blocks.

A Red block can still be a valid block created by an honest miner.

For a beginner, the important idea is:

The colors help GHOSTDAG organize work that happened in parallel.

You do not need the exact mathematics to understand the main idea.

GHOSTDAG is designed around a preselected bound for parallel work

If two honest miners work almost at the same time because information has not reached both of them yet, that is a normal network event.

GHOSTDAG is designed to handle a certain amount of this parallel work.

The protocol rules include a bound chosen in advance for the network conditions GHOSTDAG is designed around.

You do not need to remember a number to understand the point:

Kaspa does not assume that every block must reach everyone before the next block can be created.

The protocol is built to handle several blocks being created before information has had time to reach everyone.

After the order is known, the transactions still have to be checked

GHOSTDAG does not mean:

"Everything inside every block is accepted."

It helps determine an agreed order for the history.

Once there is an order, the Nodes still apply the transaction rules.

Back to the example:

  1. One block contains Emma → Liam: 30 KAS.
  2. A parallel block contains Emma → Olivia: the same 30 KAS.
  3. GHOSTDAG helps determine an agreed order between the blocks.
  4. The first transaction in that order can spend the money.
  5. When the second one is checked, the money is no longer available, so it cannot be accepted.

So it is useful to keep these jobs separate:

GHOSTDAG determines the order.

Transaction rules determine what is valid within that order.

This is what makes the BlockDAG useful as a shared history

Without GHOSTDAG, we would have a graph of connected blocks, but we would still need a way for all Nodes to use it as the same history.

In short:

BlockDAG tells us what is connected to what.

GHOSTDAG determines how that connected history should be ordered.

Transaction rules determine which actions are accepted within that order.

Why does this matter at a high block rate?

The more frequently blocks are created, the more natural it is for several blocks to be created before information about the others has reached every miner.

Instead of treating every such event as a problem where only one branch can remain, Kaspa can:

keep the parallel blocks connected, then order them with GHOSTDAG.

That is an important part of how Kaspa can operate at a high block rate.

Which leads to the next question:

If more blocks are created every second, what does that actually mean for transaction capacity and for the speed a user experiences?

Sources

External sources are in English.