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

BlockDAG

BlockDAG - how can work done in parallel stay connected?

A new block does not reach every computer on the network at the same moment.

One miner may find a block, and before another miner hears about it, that second miner may also find a block built on the same earlier history.

Now two valid blocks exist, and neither miner knew about the other block when it was created.

The question is:

What should happen to both of them?

Two blocks can be created before either miner knows about the other

Imagine two miners know the same earlier history.

One miner finds a new block and publishes it.

The information begins traveling through the network.

Before it reaches another miner, that second miner also finds a new block.

The two blocks do not need to be created at exactly the same second.

The second block only needs to be found before news of the first block reaches the miner that created it.

On a single chain, the two blocks create two branches

In a traditional Blockchain, each block continues from one previous block.

So if two blocks continue from the same past, two branches appear.

Miners may build on one branch or the other.

Eventually one main chain has to become the history the network continues from.

In Bitcoin, accumulated work helps determine which branch remains the main chain.

The block on the other branch may be completely valid and still remain outside the main chain.

Kaspa can keep both blocks connected

Kaspa uses a different structure.

A new block can reference more than one previous block.

That means a later block can effectively say:

“I know about both of these blocks, and I am building from both of them.”

The work performed on the two parallel blocks does not have to disappear simply because they were created at the same time from the network’s point of view.

It can remain connected to history.

This structure is called a BlockDAG.

Two parallel blocks share an earlier history. A later block references both. Arrows point toward the earlier blocks being referenced.

Why is this no longer a traditional Blockchain?

A traditional Blockchain can mostly be drawn as a line:

Block → Block → Block → Block

A BlockDAG can contain several blocks created in parallel, and later blocks can connect to several of them.

So history looks more like a network of relationships between blocks than one straight line.

What does DAG mean?

The name sounds harder than the idea.

D - Directed

Each connection points in one direction - from a newer block toward the past it knows about.

A - Acyclic

You cannot follow the links backward and eventually return to the same block where you started.

G - Graph

A collection of things connected to one another. Here, those things are blocks.

So:

DAG = Directed Acyclic Graph.

You do not need to memorize the definition to understand the key idea:

Blocks can be created in parallel and remain connected.

Why is that useful?

The more frequently blocks are created, the more likely it is that a miner will find a block before hearing about another block that was already found elsewhere.

If only one branch can remain part of the main structure each time this happens, some work done in parallel does not continue with the main history.

BlockDAG lets Kaspa keep more of that parallel work connected.

That is an important part of operating at a high block rate.

But keeping both blocks still does not solve everything

Imagine one block contains a transaction where Emma pays Liam.

A parallel block contains a transaction where Emma tries to use the same money to pay Olivia.

Both blocks can remain in the structure.

But both payments cannot be accepted.

So another question remains:

In what order should the blocks and their transactions be checked?

BlockDAG tells us how the blocks are connected.

By itself, it does not yet tell us their agreed order.

So what does BlockDAG actually do?

It preserves relationships between blocks created in parallel instead of immediately forcing everything into one straight line.

In simple terms:

Blockchain: mostly one chain of blocks.

BlockDAG: can keep parallel blocks connected to the same history.

But once we have the graph, all computers still need a way to reach the same order.

Kaspa uses GHOSTDAG for that.

Sources

External sources are in English.