Tech Blog

The Leading Technology: Why does SmartX choose DAG?

By 2020年1月13日 No Comments

Traditional blockchain technology has its advantages in decentralization, which is why it has received so much attention globally. However, its slow processing speed as well as its huge consumption of computing power are preventing it down being adopted in real business scenarios. Now, with DAG, new possibilities are emerging.

What is DAG?

DAG (Direct Acyclic Graph) is a common data structure. Due to its topological structure, it is widely used in cases such as dynamic planning and finding the shortest way when navigating as well as compressing data.

It is different from a traditional blockchain in the following ways:

  • Building component: Blockchain is built with “blocks”, DAG is built with transactions (TX);
  • Topology: Blockchain is a single chain that is constructed with blocks. Data can only be written according to the chronological order, which resembles a single-core processor running a single thread. Comparatively, DAG is a network of TX that allows different transactions to be simultaneously recorded, which resembles a multi-core processor running multiple threads;
  • Granularity: Every block on a blockchain records transactions from different users while every TX is for a single user’s transaction.

What are the advantages and problems of the current DAG technology?

Currently, the most famous DAG projects are IOTA, ByteBall and Nano. After IOTA reached fourth place in terms of market capitalisation, DAG started to attract attention from the broader industry. Here we provide an overview of the advantages and problems of the current DAG technology by examining these three projects.

IOTA

The most innovative thing about IOTA is Tangle. With Tangle, every transaction becomes an individual node of the network. This makes IOTA a blockchain that has neither a “block” nor “chain”. Every transaction makes references to two past transactions’ Hashes, thereby proving the authenticity of the last 2 transactions as well as the past transactions that these 2 transactions have made references to.

Another advantage of Tangle is that it can separate or integrate the transactions from the network easily. This kind of offline asynchronous processing ability is especially important for IoT.

However, IOTA has its own problems:

  • According to a report published by MIT, “Curl”, the Hash algorithm developed by IOTA, tends to produce values that clash, making it possible to produce fake digital signatures.
  • IOTA’s consensus mechanism determines that if someone is able to produce 1/3 of the transactions in the network, then theoretically, this person has the power to validate fake transactions. As IOTA doesn’t charge transaction fee, it has no means to galvanize miners and has to count on the community. Therefore, it is also subjected to DDoS attack and spam attacks.
  • In order to check the transactions for safety purpose, IOTA introduced a short-term remedy, Coordinator — a centralized component. However, IOTA hasn’t announced any plan on how to remove the Coordinator while ensuring the safety of a decentralized system in the future.

Byteball

Building on the foundation laid by DAGCoin, Byteball introduced the concept of mainchain and witness. Byteball’s mainchain is the optimal algorithm that can identify the shortest route to MCs verified by witnesses. The presence of mainchain created the time sequence which solves the problem of double spending.

Byteball’s problems:

  • The transaction time is uncertain as the mainchain algorithm is related to the frequency of publishes done by the witnesses.
  • Byteball store data in database and this limited the scalability and speed of Byteball due to the logic of SQL’s algorithm.

Nano

Nano creates a chain for each user which will be used solely to record this user’s transactions. Only the user can make changes to the transaction records and the account data is not shared among other users. This allows for all the transactions to be executed simultaneously. Hence, Nano is fast and it has umlimited scalability. Users on Nano can experience fast transaction confirmation with minimal resource being used.

One node on Nano can store the most updated ledgers of all the accounts in the network.When a transaction occurs, the sender will generate a “send tx” block which contains the amount being deducted from his account. At the same time, the receiver will generate a “receive tx” block to record that such an amount has been received. The sending and receiving can be done in a asynchronous manner and multiple transactions can be sent to the same account simultaneously. If the receiver is offline when the transaction is made, the undelivered transaction will be marked and sent to the receiver when he is back online.

The problem with Nano:

  • It is yet to be tested and evaluated by the industry. Its consensus mechanism may have flaws.

What is so special about SmartX’ B-DAG?

A typical B-DAG structure is:

  • G is the genesis block
  • M is the main block that is generated by the mining pool
  • MC is the main block that comes with the largest computing power in an epoch. Once a MC is produced, other M in the same epoch can’t become MC
  • TX stands for transaction

TX is the “block” in SmartX. MC will be randomly produced in each epoch and it makes references to all the transactions that were not reference by any other TX in the past. The combination of MC and TX represents the DAG structure as a whole. However, if we only look at the chain of MCs, it resembles the chain structure of Bitcoin, but more scattered. This structure was named B-DAG as it has the advantages of both the DAG and Blockchain technology.

Specifically, B-DAG has the following advantages:

  • It is easy to stay consistent. Every MC has to make references to the previous MC in the past Epoch. If not, it will be identified as an illegal MC.
  • B-DAG can allow transactions to be executed at every moment without pausing the system to create a block.Thus, it is much faster.

SmartX has made the important breakthrough in terms of real-life application and adoption. It is going to be the leading technology.