Academy Author ◦ 02 Feb 2023 ◦ 7 min read

What is Directed Acyclic Graph (DAG)?

What is Directed Acyclic Graph (DAG)?

Today, absolutely all cryptocurrencies that are built on the blockchain face one serious problem — which is scalability.

In the centralized payment world, companies like Visa have accustomed us to fast, instant transactions. And until the cryptocurrency community solves this issue, we actually cannot move on. This is the second serious problem that cryptographers faced on the way to universal recognition of cryptocurrencies. The first is of course security, but this is a topic for another time.

All of you have heard more than once about such solutions as the Lightning network for Bitcoin and Sharding for Ethereum. Each solution solves the same problem in different ways — the time of production of the block. Blocks are fundamental components in the blockchain and the speed of the entire network depends on the rate of production of the block.

DAG vs Blockchain

The advent of blockchain technology in the global financial market was one of the main events last year. Supporters of absolute democracy and criticism of the fiat system sighed with relief when Bitcoin began to gain momentum. Here it is — a completely decentralized currency! Banks and authorities will no longer be able to control and manage citizens' funds. Not having time to recover from the noise of the cryptocurrency "dad," another headliner entered the arena — Ethereum with its decentralized applications. The ICO boom and the famous CryptoKitties did their job and Ethereum, in general, unreasonably, began to be called blockchain 2.0

But the technology is evolving very quickly and soon new cryptocurrencies with a different technology called DAG appear on the market, which is already based on solving the problem of scalability and high commissions. Now we are seeing a trend in which new projects prefer DAG solutions, instead of the usual blocks. Some even timidly declare that DAG is a generation of blockchain 3.0 (mistakenly) and that the future of cryptocurrencies is precisely in this technology. Well, let's figure it out.

What Is DAG?

First, DAG is a type of distributed registry technology that differs from blockchain in record structure and asynchronism. Many mistakenly believe that DAG is a type of blockchain or some new consensus. Both blockchain and DAG are different solutions to distributed registry technology or as it’s called in white papers — ledger.

Blockchain and DAG can be called close relatives, but they solve their problems in different ways. Therefore, as it was said above,the statement "DAG — generation of blockchains 3.0" is erroneous. DAG is not a blockchain at all, it is a registry without blocks. In the next section, we will indirectly compare blockchain and DAG, and for now, let's look at how this technology works.

DAG (directed acyclic graph) is an oriented graph in which there are no directed cycles.

Let's first figure out what a non-directional cyclic graph is.

A non-directional cyclic graph is a graph (or network of connected nodes) where information can be transmitted from one node (circle) to another along different edges (straight lines). There are many different ways in which information can leave a node, pass through other nodes, and return to the original node. When this occurs with a node that occurs more than once, the graph can be defined as cyclic.

But we're interested in acyclic graphs. Acyclic graphs are graphs that do not have cycles.

This means that it is impossible to overcome the entire graph by starting with one edge. The edges of the directed graph go only one way. This graph is a topological sort where all the nodes are in a certain order. Such a system has no cycles — you will never come to the beginning of the same node.

Now let's figure out what directional means.

If we give the direction of the edge (so that they function as a one-way street for information) and guarantee that no nodes connect to any of the other nodes already in their series, our previously cyclic graph can now be turned into a directed acyclic graph.

Thus, the DAG functions as a network of interconnected branches growing outward in several directions. Transactions can be confirmed an order of magnitude faster, remaining decentralized, since each one confirms only the previous one.

In DAG, each transaction refers to previous (parent) hashes, signing them and including them in its composition. In this way, a "tree" of transactions is formed, where each of them is confirmed and unchanged.

Pros and Cons of DAG

In the beginning, we will go through the three graves of the modern cryptocurrency industry: scalability, security, and cost.

  • Speed and scalability. The DAG technology appeared as a result of the inability of the blockchain to cope with heavy loads and network congestion. As mentioned earlier, this problem has become a catalyst for the development of DAG, so we boldly write this factor in the plus. In DAG, only nodes are transaction controllers and validators, not blocks. The information is in transactions, which means they are very fast. In theory, we are talking about millions of transactions per second.
  • Security. In DAG, all transactions are always checked by other codes, and sometimes repeatedly. This increases the reliability of payments and reduces the likelihood of "double spending." In cryptocurrencies without blockchain, this is achieved through direct and indirect confirmations, the strict description of which is individual for each cryptocurrency. In theory, security should be higher, but now it is difficult to say for sure. In any case, for now, the security of DAG is at least not inferior to blockchain technology.
  • Transaction cost. The DAG algorithm is ideal for a micropayment system because it has "almost zero" fees. Thanks to its architecture and the lack of miners in the network, DAG-based network users will be able to send transactions with literally penny commissions or without them at all.

Transaction confirmation and consensus. When sending a transaction to the network, the user must first confirm (fail) at least one, but more often two records from previous ones. Thus, users themselves serve the network each time they send a transaction. Therefore, DAG usually does not have miners and craftsmen. But some participants must determine the order of all records since, without an exact order, a "double spending" attack is still possible. The presence of these participants and the process of validation of transactions by users — together form an algorithm for consensus on records in DAG networks. Each cryptocurrency has its own decisions on the use of these very participants, but it is logical to assume that the more of them there are, the more decentralized the network itself and cryptocurrency as a whole will look.

At the moment, DAG technology has no pronounced disadvantages. However, just like the first blockchain Bitcoin, before it began to conquer the world, the technology is not run-in, you can even say raw. So, the first serious DAG checks will take place after mass recognition in the market and the first hacker attacks. Now you can just rejoice because the progress of the cryptocurrency market is very rapid.

Cryptocurrencies Based on DAG

According to the network, for the first time, the idea of ​ creating a DAG crypto without a blockchain was voiced on DAG in 2015, by one of the foreign developers. However, that project was not implemented, but the idea even then seemed interesting to many developers.

IOTA

Perhaps the most popular DAG coin is IOTA. They use Tangle technology at its core, which, in turn, is also based on DAG. The vision of IOTA and DAG led to Tangle. The design of IOTA graphics is even wider — according to White Paper, it looks like a directional acyclic graph in 3D. Each transaction in Tangle needs to confirm any two previous transactions that are randomly selected by the network. Also, the algorithm of this cryptocurrency, connected to DAG, made it possible to create even offline parts of the network. When you connect to the Internet, these blocks become part of the common "blockchain." Simply put, the developers "twisted" their DAG by optimizing it for the Internet of Things and called it Tangle.

Nano

Another notorious cryptocurrency on DAG is Nano. As you remember from the reviews, the Nano project used to have a different name, and the first beta implementation was published back in 2014. Nano uses a new block-lattice architecture, where each account has its chain and reaches consensus through delegated Proof. It turns out that the Nano block lattice, like the entire project, is based on DAG. Nano is one of the first DAG projects, in its classic form.

Byteball Bytes

The Byteball cryptocurrency project takes advantage of DAG to build an ecosystem of smart contracts for quick payments and storage of financial data: currency, ownership, debt, shares, and more. This is not a blockchain project, but one based on the design of DAG, already working and has a good and user-friendly wallet. Byteball is good when it comes to peer-to-peer smart contracts. Byteball users can use risk-free conditional smart payments: all you need to do is set the condition when the recipient receives the money. If this condition is not met, your money will automatically be sent back to you — a very simple algorithm based on DAG. For example, Byteball allows you to buy or sell peer-to-peer insurance on your platform using smart contracts.

All these cryptocurrencies are safely traded on the market and have quite successful listings.

Surely there are more cryptocurrencies that somehow use DAG technology. 

All the main checks of this technology are still ahead, now it promises us many new opportunities. However, so far it is just a trend that has every chance of becoming something big.