Directed Acyclic Graph (DAG) Explained

2,003

When you talk about cryptocurrencies, the first thing that comes to your mind is the use of Blockchain Technology or Distributed Ledger Technology. Bitcoin was the first cryptocurrency that came into existence that used Blockchain technology. After Bitcoin, many other cryptocurrencies came into existence and were built on similar network architecture. 

In the Blockchain Technology, a new block is added to the chain of blocks. Each block is connected through a cryptographic link. These blocks will have recent transactions that have been broadcast by the users. 

There is a certain amount of waiting period between a transaction being broadcast and its inclusion into the block. Based on the size of the block and the number of pending transactions, the waiting time may differ from seconds to hours for the transaction to be confirmed.

It provides high-level security, as it does not depend on any centralized coordinator. But, blockchain technology has an expiration date and it also faces scalability issues. Hence, detractors believe that these issues in blockchain technology will prevent its mass adoption. 

Some of them believe that the future of the cryptocurrency payment network relies on a different architecture called the Directed Acrylic Graphs (DAGs). 

Now, let’s understand more about what is DAG, how it works, and much more. 

What is Directed Acyclic Graph (DAG)?

The Directed Acyclic Graph is a synonym for Distributed Ledger Technology (DLT). The data structure of DAG is different which connects different pieces of information together. DAG helps solve various problems such as data processing, finding the best route for navigation, scheduling, and data compression. 

Directed Acyclic Graph (DAG)

The Directed Acyclic Graph looks similar to the above image. The DAGs are made up of vertices and edges. The direction of the lines heads in one direction as shown in the image above. They are acyclic, which means that the vertices don’t loop back on themselves. It means that if you start at one point in the graph, you cannot return to the same point. Such data structures are used in the scientific or medical field to analyze the connection between variables and determine their impact on each other. 

How does it work?

In a DAG-based cryptocurrency, each vertex will represent a transaction. DAG does not use blocks to store information, instead, it uses a node or a group of nodes which are developed simultaneously. A small proof-of-work operation is done when a node submits a transaction. When a new transaction is to be added, it is built on the older ones.

Let’s say Alice creates a new transaction, so as to acknowledge it, this transaction should reference the previous ones. In some systems, there are algorithms to select on which transaction a new transaction must be built. The transactions that Alice will build on top are still unconfirmed. But, once Alice references them, they will be confirmed. 

Now, Alice’s transaction will be unconfirmed until someone else will build on top of it before it’s accepted. Users will usually confirm those transactions which are heavier in weight so that the system keeps growing. 

DAGs will prevent double-spending. When a node confirms an older transaction, they test the whole path, with DAG’s very first transaction to make sure that the sender has sufficient balance. There are multiple paths involved, but only one path will be verified. 

If the users build an invalid path, then they will be in the risk of their own transaction being ignored. Even though the user’s path is legitimate, the previous one may not be, as a result of which, none of them will want to extend that particular path.  

Cryptocurrencies using DAG

Cryptocurrencies built on DAG are very few but they are growing day-by-day. Among various cryptocurrency projects using this framework, let’s have a look at the famous currencies which are IOTA, Nano, and ByteBall. 

IOTA

Internet of Things Applications (IOTA) was invented in 2016 and it was among the first start-ups to implement the “blockless blockchain”. IOTA uses a network of nodes and a group of nodes to fasten up the validation process. In IOTA, the users have to verify two transactions themselves. 

Everyone will participate in executing a consensus and will also contribute a small amount of power to maintain the network. Hence, the network will have a high level of decentralization with proper scalability. 

Nano

Nano is another cryptocurrency built on the DAG system. This currency is independent of blocks and uses nodes to connect. It uses a technology called block-lattice which is a combination of the DAG-based framework and the traditional blockchain.

In Nano, each user who has an individual wallet will get a blockchain and only the user can operate changes on it. To complete a transaction, both the sender and the receiver should perform an operation on the blockchain. 

ByteBall (Obyte)

ByteBall does not use blockchain technology, instead, it is built on the DAG model. Also, it doesn’t provide zero-fee transactions, because the network uses a validator system to cross-check the transactions on the blockchain. The consensus algorithm relies on reputed users who act as validators.

DAG Vs Blockchain

Now, let’s see how DAG differs from blockchain and why is it more advantageous than Blockchain. 

Mining

In the blockchain, participants mint new tokens using different consensus mechanisms. While in DAG the previous transactions will validate the succeeding one to achieve consensus. 

Transactions

In the blockchain, the scalability and transactions per second are limited. Whereas in acrylic graphs, the scalability and transactions per second are high. 

Data Structure

The data in the blockchain is structured in blocks in order of transactions which are validated by miners in the ecosystem. In DAG, the data structure follows the directed acyclic graph mechanism where each transaction is independent. 

Validation of Transactions

 In the blockchain, the miners will have the power to postpone a transaction or they can cancel the transaction. While in a Directed Acyclic Graph, the success of the present transaction relies on its ability to validate the previous two transactions. 

Time of Launch

Blockchain was launched in 2008. Whereas DAG came into existence in 2015. 

Cryptocurrencies using the platform

Top cryptocurrencies like Bitcoin and Ethereum use blockchain technology. Whereas currencies like NXT, IOTA, Nano, and ByteBall use the DAG system. 

Advantages of DAG

  • DAG offers efficient scalability and reduces user fees.
  • They are well suited for high-volume transactions, including micro and nano transactions.
  • The speed of DAG validation depends on the transaction volume.
  • DAG requires lower energy consumption, as it does not require miners and mining equipment. 

Disadvantages of DAG

  • If the transaction volume is smaller, then DAG may be vulnerable to attacks. 
  • DAG has not been purely decentralized yet. 

Final Word

The DAG model will become the Blockchain 3.0 after the Bitcoin and Ethereum revolutions. But deciding whether DAGs or Blockchain is the superior technology depends on the application. Different use cases will use blockchain or DAG as their better option. But neither of the systems can replace each other.