Understanding the Conflux Tree-Graph Consensus Algorithm

Conflux Network
Conflux Network
Published in
5 min readApr 22, 2021

TL;DR

Conflux is based on a novel Tree-Graph consensus mechanism that optimizes for security and scalability, without sacrificing decentralization.The Tree-Graph architecture allows parallel processing of blocks and transactions, while eventually forming a final serial chain. This feature contrasts other well-known networks like Bitcoin and Ethereum, which process blocks strictly one-by-one, and is what gives Conflux its speed and scalability.

Blockchain’s Scalability Conundrum

Cryptocurrency networks like Bitcoin and Ethereum have been touted as the future of the financial system. However, as these networks have grown, one persistent problem has become increasingly clear: scalability.

For example, the Bitcoin and Ethereum networks are very limited in terms of the number of transactions that they can process at any given moment. The Bitcoin network processes an average of seven transactions per second (TPS); Ethereum processes 30–40 TPS. In times of high traffic, transactions on both networks can take hours to complete. Additionally, fees on these networks, most notably Ethereum gas fees, have priced out many users.

Conflux’s Tree-Graph Architecture: The Solution to Blockchain’s Scalability Woes

Conflux. a PoW chain, is built with a unique Tree-Graph consensus mechanism—a dynamic block structure used to facilitate the processing of 3000–6000 TPS without sacrificing decentralization or security. How does it work? Unlike the Bitcoin and Ethereum blockchains, which are linear in nature, Conflux’s Tree-Graph structure is divergent. Bitcoin and Ethereum can only confirm one block at any given time. Conflux’s Tree-Graph, by contrast, can confirm multiple blocks concurrently. This parallel processing of blocks and transactions, lowers confirmation times, and substantially increases transaction throughput.

In order to accomplish this, the precise chronological order of each transaction block on Conflux must be determined successfully. The Tree-Graph utilizes a unique algorithm to determine which transactions will be added to the block structure first. In this way, the Tree-Graph turns blockchain’s complex scalability problem into a simple sequencing equation.

The Interconnected and Dynamic Relationships Between Transaction Blocks

How does the Tree-Graph determine the chronological order of transactions? The answer to this question has to do with the way that blocks are organized on the Conflux network. Unlike Bitcoin and Ethereum, Conflux’s blocks don’t form a linear “chain”; instead, they form a multifaceted and interconnected series of blocks. This is how the “Tree-Graph” gets its name: it consists of an web of transaction blocks that form a graph. These transaction blocks are recorded in a hierarchical structure known as a tree.

The Tree-Graph is a Directed Acyclic Graph (DAG). In a DAG, connections between data points (in this case, transaction blocks) are called “edges.” In the Tree-Graph, an edge is formed every time one block refers to, or references, another block.

There are two kinds of edge that a Tree-Graph block can have: a parent edge and a reference edge. Parent edges are formed between a new block and another block that came before it. When a miner prepares to confirm a new block, they must choose one previous block to function as the parent block. Each block can only have one parent edge.

Parent edges are formed when a new block references a single block that came before it. In this image, each parent edge is represented by an arrow.

In addition to the parent edge, each new, unreferenced block can also reference other unreferenced blocks. These references form reference edges. These provide more information about which transactions happened first. When a new block forms a reference edge with another block, the edge indicates that the referenced block came before the newly added block. Not all blocks in the Tree-Graph have reference edges.

Reference edges are formed between new, non-referenced blocks to provide data about which blocks occurred first.

Once a block of transaction data forms a parent edge and any relevant reference edges, the transaction is sequenced and recorded in the Tree-Graph’s block structure. Sequencing on the network is crucial: it is the primary way that transactions are confirmed and recorded. Establishing transaction validity through sequencing means that double-spend attacks are virtually impossible on Conflux.

How Does the Conflux Sequencing Algorithm Work?

How is sequence determined in the Tree-Graph? It all comes down to Conflux’s sequencing algorithm, which operates in several phases. First, the Conflux protocol determines which sequence of blocks is the “main chain,” or Pivot Chain. The Pivot Chain is chosen according to the Heaviest Chain Rule, which favors the sequence of blocks with the most reference edges.

The Pivot Chain is the sequence of blocks that has the most reference edges. (Source:

Once the Pivot Chain has been selected, the rest of the blocks are sequenced based on their reference edges. For example, in the above image, Block F references Block B. This means that when Block F was created, it “witnessed” Block B. Therefore, Block B was created before Block F.

If two reference blocks appear to have been created at the same time (for example, Blocks B and D), Conflux determines the sequence of these blocks using something called an Epoch. An Epoch is a certain time period, or phase, in the Tree-Graph’s life cycle.

For example, in the image above, Block A is in Epoch 0. Each subsequent block in the parent chain has its own Epoch: Block C = Epoch 1, Block G = Epoch 2, Block J = Epoch 3, and so on. If a block is not on the Pivot Chain, its Epoch is determined by the first Pivot Chain block that directly or indirectly references it. For example, Block F is in Epoch 3 because of Block J’s reference to it.

Video: Conflux: Visualization of the Tree-Graph (TG)

Therefore, the sequencing algorithm on Conflux has two main steps: first, to sequence Epochs on the Pivot Chain, and second, to sequence all of the blocks within each Epoch.

Summary

The unique Tree-Graph consensus mechanism is Conflux’s unique and breakthrough solution to blockchain’s ongoing scalability problem. This positions Conflux to support protocols and dApps that require speed at scale. And as the only regulatory compliant, public, and permissionless blockchain in China, Conflux is truly a borderless transactional and technological bridge for globally-minded crypto projects.

--

--

Conflux Network
Conflux Network

Conflux is a PoW + PoS hybrid first layer consensus blockchain for dApps that require speed at scale, without sacrificing decentralization.