Recently, at an academic salon held by Trias and PKUSSM-OCTA Innovation Laboratory, Yuejian Fang, associate professor at Peking University, shared the theme of ‘Consideration of the value of the consensus algorithm based on graph structure DAG (Directed Acylic Graphs)’.

Yuejian Fang Associate professor, Peking University Doctor’s degree from Peking University Research direction: applied cryptography, big data platform and privacy protection, smart and parallel computing, etc. He has published many international conference and periodical papers, and has applied for a number of Chinese and American patents for his projects.

The following is the sharing content brought by professor Fang:

Research background of graph structure algorithm

As we all know, the existing consensus algorithms are not perfect. Bitcoin, for example, uses the PoW consensus algorithm. Due to serious efficiency problems faced by PoW algorithm, and bitcoin is limited to consensus algorithm and block capacity, it can handle only about 2000 transactions per minute. As a result, bitcoin networks are often congested.

The efficiency problem with bitcoin is that its verification requires a serial signature based on the longest chain. In the chain structures of the same dimension, blocks are generated in strict chronological order. Only after the broadcast of the previous block can the next block be generated, and all nodes are required to be jointly authenticated, which is a relatively long process.

To solve the problem. The introduction of graph structure DAG can reduce the requirement of block generation process on sequence and facilitate the parallelism of the block generation process. In other words, two or more blocks may be produced together. The Improved parallel block generation process will greatly improve the computational speed and break through the efficiency bottleneck of the consensus algorithm, but at the same time, it will also lead to redundancy or the generation of error blocks and other adverse effects, which requires the overall sorting and verification to screen it. Therefore, the key to consensus algorithm based on DAG lies in the relationship between nodes and the final selection of the correct block.

Let’s analyze some specific project algorithms.

Inclusive blockchain protocols

Inclusive blockchain protocols, proposed by Israeli scholars, can be regarded as the most basic DAG consensus algorithm. The only difference between this algorithm and the longest chain consensus algorithm is that it introduces DAG graph structure. Blocks are connected by the most basic parent-child nodes using the longest chain algorithm. According to the chronological relationship of blocks, the older blocks are selected when the chain length is the same.

Figure 1: The fraction of optimal throughput achieved in Inclusive and non-inclusive longest-chain protocols

Its efficiency is shown in the figure above. Red represents the optimal effect, blue represents the actual effect of graph computing, and green represents the unused effect.

Phantom

Blocks selected by the maximum K clustering algorithm are summarized as follows: DAG can only be added if the number of anti-cone nodes in its DAG graph is less than or equal to K.

In the figure below, the correct blocks are added to the DAG, which is marked blue. While the error blocks not added to the DAG are marked red, which may be malicious or redundant.

Figure 2: Schematic diagram of Phantom

Take the following figure as an example, node I, whose cone surface includes A, B, F, C and D, which can be reached. And the anti-cone nodes are all blue nodes except the nodes on the core, which are G and J. Nodes E, H and K are considered to be redundant, so they cannot be trusted.

In conclusion, the smaller the anti-cone of a node, the stronger its connection with other nodes. Its advantage is good scalability, but it cannot guarantee strong linear sorting. This is still difficult to prevent malicious mining and delayed release of the situation, the ability to resist these attacks is slightly inadequate.

Specture

Blocks are connected in a basic way, mainly through the blockchain voting algorithm, and blocks with more cone nodes are placed in front of them according to priority, and blocks are sorted in general. If two blocks collide, it selects the block in the front of the sorting position.

Now there are two blocks, X and Y, so how to determine the sequence of X and Y? Because blocks 6–8 can see block X, but they can’t see block Y, so they put X out front. Again, blocks 9–11 only see block Y, and they put block Y first. According to the figure structure, Block 12 believes that block X should be placed in the front, while block 1–5 agrees that block X in the front because more blocks in the structure believe that block X should be placed in the front.

Figure 3: Specture

Conflux

The algorithm joins by adding index connection. Index connection refers to the fact that other blocks(non-parent-child) found before this block are also joined together, thus greatly improving efficiency. It is reported that the Institute for Interdisciplinary Information Sciences of Tsinghua University once participated in an experiment in which they used 20,000 machine nodes in amazon EC2 cloud. It achieves a throughput reached 5.76GB/h, processing 6,400 transactions per second. The experiment attracted a lot of capital.

Its algorithm is still GHOST algorithm, similar to Ethereum. GHOST algorithm is a protocol for the selection of the main chain, the basic principle is to choose the maximum number of subtrees as a standard.

Snowflake to Avalanche

The project blocks are connected by the basic connection mode (parent-child block), selecting the appropriate transaction in a random query and the color confidence value based on two coloring of DAG graph.

Each node is initially colorless, randomly querying other nodes around them and make statistics on the colors of the surrounding nodes (red or blue). After querying K times, selecting the color with the largest number of statistical results as its own color, and add 1 to the confidence value of the changed color.

After the introduction of the DAG graph, each node will update the confidence value (plus 1) of the ancestor transactions and update the prefer transactions submitted by the ancestor when they change their colors.

If all ancestor transactions in a transaction (the parent node, or nodes above the parent node) are preferred, the transaction is of strong priority. The system will randomly select a node to query the transaction. If a strong priority is returned, the number of votes will be increased by 1.

When the number of votes for a transaction reaches a certain threshold, or the transaction passes a certain number of successful queries, the transaction is judged to be correct.

Associate professor Yuejian Fang introduced the algorithms of the above five projects briefly, and said that the research of graph structure algorithms is in the ascendant all over the world, and there are still many innovative emerging algorithms to be studied. Ming Wei, Trias CTO, also noted that many investment institutions in Silicon Valley have shifted their attention from AI to blockchain. Even now, there are still many people who equate blockchain with speculation. In fact, it isn’t. Like AI, cloud computing and big data, blockchain is a new technology in recent years, but the outside world gives it too many financial attributes.