A simple guide to explain what a directed acyclic graph (DAG) is in cryptocurrencies, how it is used and how it works.
DAG vs. Blockchain
Blockchains and DAGs both record transactions on a distributed ledger, albeit through different means.
Below is a quick comparison of the two in terms of benefits and drawbacks:
Pros of DAG
Suited for microtransactions and high volumes of transactionsEliminates the need for mining equipmentFees may be reduced significantlyLower energy consumption
Cons of DAG
Vulnerable to attacks due to low volume of transactions Still in its infancy; has not yet sustained high levels of decentralization
Pros of blockchain
Well-established and widely-used by cryptocurrencies like Bitcoin and EthereumTransparent and unalterable, highly-secureCost-effective for high-value transactions
Cons of blockchain
Demanding storage and network bandwidth requirementsLarge amounts of power consumedHigh transaction fees
At the end of the day, deciding on which model to use will depend on one’s business objectives. As we discussed, each model has its strengths and weaknesses, and either one can be more applicable depending on your requirements.
What is the role of DAG in blockchain?
DAG can be seen as a viable alternative to blockchain, although it still requires further fine-tuning. The DAG model seeks to improve common issues with blockchain technology such as cost, speed and scalability.
Technically, both technologies record transactions on a digital ledger and work towards the same goal. The differentiating factor between the two of them is mainly the structure each model uses to store data.
What crypto uses DAG?
It used to be unimaginable to think of cryptocurrencies without thinking of blockchain. With the DAG model, however, several cryptocurrencies have already been built using this technology.
Some examples are Obyte, IOTA, and Nano, to name a few. Although still relatively new, the DAG framework shows great potential. As mentioned, some projects have already used it successfully. The most well-known ones are:
Obyte or ByteBall is a cryptocurrency that is completely independent of the blockchain, having implemented the DAG framework. However, Obyte transactions still have a fee.
This is because the Obyte network utilizes a validator system that allows for double-checking of transactions. It makes use of a consensus algorithm that relies on witnesses. These witnesses are trusted and reputable users who act as validators.
Obyte also supports untraceable transactions, as well as unreachable contracts.
Internet of Things Applications, or IOTA, implemented its ‘blockless blockchain’ network in 2016. The idea behind IOTA is that all users effectively become miners. To validate one transaction, for example, a user has to verify two transactions.
IOTA uses a network composed of nodes and tangles, or groups of nodes, that serve to make the validation process faster and more efficient.
All users contribute a small amount of power for the network’s maintenance, and everybody participates in executing consensus as well. This allows the network to be highly decentralized and scalable at the same time.
Transactions have near-zero fees; hence, IOTA is considered a cost-effective alternative cryptocurrency for micro-payments.
Nano is also a cryptocurrency operating on the DAG system. Nano has independent blockchains connected by nodes and is called block-lattice technology. Technically, it’s a mix of DAG and blockchain.
Every user has an individual wallet and a blockchain. Only the user can execute changes on their own wallet/blockchain. Transactions are completed once the sender and receiver both perform operations on their respective blockchains.
Nano offers zero transaction fees, as well as high transaction speeds to its users.
What are DAGs used for?
The DAG model seeks to address two perceived weaknesses of blockchain technology, namely, decentralization and scalability. It seeks to improve security and usability as well.
On the Bitcoin blockchain or Ethereum platform, miners can only create one block at a time. Hence, new transactions can only be validated when the previous one is completed. The DAG model eliminates these blocks, adding transactions directly to the blockchain.
With the elimination of blocks, the DAG model won’t require mining. This means less power is required to support the network. DAGs also have several advantages, such as:
High transaction speeds unencumbered by block creationNo miners mean no transaction fees as wellLess energy consumption and environmental benefits compared to mining
Currently, though, the use of DAGs in crypto is still in the early stages. Unlike blockchains, they are still not fully decentralized. As such, they are primarily used for getting networks started, and not yet as a system that can be used to build a stable network.
How does a DAG work?
As mentioned, a directed acyclic graph is more efficient at data storage. Its structure is tree-like, with interconnected nodes as its ‘branches.’
Since each node can have more than one parent root, the model allows for more transactions to be validated simultaneously. This is because users do not have to wait for transactions to complete before processing a new one.
So in a directed acyclic graph, each new transaction has to reference previous transactions before getting accepted into the network. This is no different from how blocks on a blockchain also reference previous blocks. The rationale behind this is that a transaction can only be successfully confirmed when it is referenced by another transaction, and so on.
In a DAG, each vertex represents a transaction. There are no blocks, so mining is also not required. Transactions are built on top of one another instead of gathering them into blocks. Then, as previously mentioned, proof-of-work tasks are done whenever a node submits a transaction, to validate prior transactions and avoid spam.
By principle, new transactions are built on top of older ones in a DAG-based cryptocurrency. The main difference with blockchain is that in a DAG, multiple transactions can be referenced, instead of just one at a time.
Some systems have an algorithm that selects ‘tips’ or transactions to build on based on accumulated weight (or the number of confirmations leading up to the tip).
Double-spend protection in DAGs works with nodes confirming older transactions by assessing a path tracing back to the DAG’s first transaction. This confirms whether or not the sender has sufficient balance. Should a user build on an invalid path, then that transaction is at risk of being ignored.
Conflicts resulting from multiple paths are resolved via a selection algorithm that favors tips that have a heavier accumulated weight.
What is a directed acyclic graph (DAG) in crypto?
A directed acyclic graph or DAG is a data modeling or structuring tool typically used in cryptocurrencies.
Unlike a blockchain, which consists of blocks, directed acyclic graphs have vertices and edges. Thus, crypto transactions are recorded as vertices. These transactions are then recorded on top of one another. Similar to a blockchain, however, transactions are also submitted to the DAG via nodes. Proof-of-work (PoW) tasks are required of nodes to submit a transaction.
Simply put, whereas a blockchain system looks like a chain, DAG’s system looks more like a graph. The DAG model is currently seen in the industry as a possible substitute for blockchains in the future due to its efficiency in data storage and processing of online transactions.
The DAG model is seen as a possible solution to the current decentralization issue in crypto. With this model, miners will not have to compete for new blocks to add to the chain.
With nodes developed simultaneously, transactions can likewise be processed faster. Developers are eyeing DAG as a better, more secure solution that can improve a network’s usability once it becomes more scalable.