DAGs — Not Blockchain, but better?

A topological ordering of a directed acyclic graph: every edge goes from earlier in the ordering (upper left) to later in the ordering (lower right). A directed graph is acyclic if and only if it has a topological ordering [Source: Wikipedia]

Blockchain is an amazing piece of technology, however, it is still not ready for global adoption. No one wants to wait for 10 minutes to pay for their coffee at Starbucks!

Although, a large number of blockchain technologies are underdevelopment, the current publicly available blockchain solutions are still at the exploratory stage. Unfortunately, no single blockchain technology is able to provide large scalability, fast finality and strong reliability simultaneously. One way to overcome these issues is to use DAG as an underlying data structure. It has found promising applications in many fields, such as scheduling, data processing networks, causal structures, data compressions etc. So what exactly is a DAG?

In a nutshell, blockchains are cryptographically verifiable single linked lists. A DAG is a different type of data structure. DAG stands for Directed Acyclic Graph. It’s an implementation of Graph and allows networks using it to circumvent some of the blockchain’s most daunting limitations like lack of scalability, flexibility and finality. In a DAG, all the nodes point in the same direction, thus acyclic, and no element can reference back to itself. It’s a data structure that only allows one-way flow of information. It’s mostly used in problems relating to data processing, scheduling and data compressing.

Due to the inefficiencies in the Proof-of-work(POW) and the Proof-of-Stake(POS) systems, it becomes difficult to reach a higher level of transactions per seconds that hampers the global adoption of blockchain as a technology. No one wants to spend 10 minutes just to pay for coffee! So DAG powered networks allow appending parallel running nodes as long as everything flows in the same direction.

Using DAG has a lot of benefits:

1. Quick transactions

Due to its blockless nature, the transactions run directly into the DAG networks. The whole process is much faster than those of blockchains based on PoW and PoS.

2. No mining involved

In a DAG system, there are no miners and there are no blocks, users confirm each other’s transactions via a process that confirms previous transactions with each new transaction. Because there are no blocks, there is no block size issue and therefore, the block scaling debate seen in currencies such as Bitcoin does not exist.

3. Friendly to small payments

With the advancement of DAG, we’re looking at a future where high functioning and minimum transaction fee chains are possible. That means users can send micro-payments without incurring heavy fees like that in Bitcoin or Ethereum.

Although, DAG is very flexible data-structure, it still has a lot of drawbacks.

1. No Global State

In Blockchain, every node is able to cross-check transactions against ledger history and can also check against the threat of double spending. However, as DAG follows a transaction-by-transaction approach, no global state exists. As the size of database increases, pruning is necessary but it’s basically taking a snapshot and enabling nodes to delete all transactions prior to that which is not optimal at all.

2. Double Spending

We can try solving this by sharding but while all shards still operate to the same protocol, they now only see parts of the ongoing transactions and associated history which causes a number of issues. Firstly, preventing double spending becomes difficult. For example, consider the DAG is split into ten parts and transaction is on the strongest tip of two of these shards. Unless there is a node that has the signt of both shards, the transactions will validate each of the two shards, thus causing a double spend.

3. Higher Costs

This issue becomes more prevalent as the DAG scales. The more shards there are, the less overlaps. The simple solution would be for all nodes to have to contact each other for each transactions they see but then costs will be the same for each node as all nodes will simply hold the entire DAG.

4. Vulnerable to Attack

DAGs are vulnerable to attacks which is due to the lack of constant mining and also because malicious actors only need to gain over 33% of the total hash power to be able to attack the network even before the network is sharded. In a DAG, decentralized security is traded for performance. One of the main selling points of Bitcoin was that it was a distributed network spread worldwide but a limited number of nodes in a DAG are much easier to attack than thousands spread worldwide.

5. Do not Guarantee & Secure Timestamps

DAG’s do not guarantee and secure timestamps which causes double spending and makes it difficult for applications built to run on the DAG that require an exact timestamp.

Find that out in our next article. Follow us on Twitter to stay updated.

Anything we missed or you would like to add? Please let us know through Twitter, and we’ll feature your article in our community blog!

Redefining how blockchain protocols work from the ground up