When you think of cryptocurrency, terms like "blockchain" or "distributed ledger technology" likely come to mind. Since Bitcoin's introduction, hundreds of other cryptocurrencies have emerged, most relying on a similar network architecture. Their data structures enable users to transfer value or interact with decentralized applications.
In a blockchain, new blocks are periodically added to a continuously growing chain. Each block connects to the previous one via a cryptographic link—specifically, a hash. These blocks contain recent transactions submitted by users.
However, there's often a waiting period between when a transaction is submitted and when it's included in a block. This is like waiting for a train at a station. Depending on the carriage size (block size) and the number of other waiting passengers (pending transactions), you might not even get on the next train—or the one after that. The time you wait for a transaction to be confirmed can range from seconds to hours.
For many, this is a reasonable trade-off. After all, this method offers high security without relying on a centralized coordinating authority. But critics argue that blockchain technology will eventually become obsolete. They believe the scalability issues inherent in blockchain will hinder mass adoption in the long run.
Some propose that the future of cryptocurrency payment networks will be built on a completely different architecture: the Directed Acyclic Graph, or DAG.
Understanding Directed Acyclic Graphs (DAG)
A DAG is a different type of data structure—imagine it as a database that connects different pieces of information. The concept of a directed acyclic graph is complex, so let's break it down.
Conceptually, a DAG consists of vertices (represented as spheres) and edges (the lines connecting them). They are directed because they move in one direction (often indicated by arrows). They are acyclic (meaning no cycles) because the vertices cannot form a loop. If you start at one point and follow the graph, you cannot return to your starting point.
This data structure is commonly used in data modeling. In scientific or medical fields, DAGs might map relationships between variables—like nutrition, sleep cycles, and physical symptoms—to determine how they affect a patient.
For our purposes, we're more interested in how they can help decentralized cryptocurrency networks achieve consensus.
How Does a DAG Work?
In a DAG-based cryptocurrency, each vertex in the structure represents a transaction. There is no concept of blocks, and no mining is required to expand the database. Instead of grouping transactions into blocks, each transaction builds directly upon previous ones.
When a node submits a transaction, it performs a small amount of Proof-of-Work. This helps protect the network from spam and also verifies previous transactions.
To add a new transaction, it must build upon older ones. Imagine Alice creates a new transaction. To confirm it, she must reference previous transactions—similar to a Bitcoin block referencing its predecessor, but this mechanism requires referencing multiple prior transactions at once.
In some systems, an algorithm selects which transactions (or "tips") a new transaction must build upon. Tips with higher cumulative weight—a measure of the number of confirmations along the path to that tip—are more likely to be chosen.
The transactions Alice builds upon are initially unconfirmed. But once she references them, they become confirmed. Her transaction now remains unconfirmed until others build upon it.
Users are more likely to confirm transactions with higher "weight," encouraging the system to grow consistently. This prevents users from continually building on very old transactions.
Preventing Double-Spending
Blockchains easily prevent double-spending. The same funds cannot be spent twice in a block—nodes can quickly detect such attempts and reject any block containing conflicting transactions. Since mining blocks is costly, miners are incentivized to play fair.
DAGs also have mechanisms to prevent double-spending. There are no miners, but when nodes confirm older transactions, they evaluate the entire path back to the DAG's first transaction to ensure the sender has sufficient balance. There might be multiple paths, but only one needs to be validated.
If a user builds on an invalid path, they risk their transaction being ignored. Their transaction might be legitimate, but if the previous one isn't, others will avoid extending that path.
At first glance, this might seem unintuitive. Couldn't multiple branches exist unaware of each other? Couldn't users spend the same funds on different branches?
This is a possibility, but it's resolved through a selection algorithm that favors tips with higher cumulative weight. Over time, one branch becomes significantly stronger than others. Weaker branches are abandoned, and the network continues building on the heaviest branch.
Transaction Confidence and Finality
As with blockchains, there's no absolute confirmation in a DAG—you can never be 100% certain a transaction won't be reversed. While highly unlikely, it's theoretically possible to "undo" a Bitcoin or Ethereum block, reversing all its transactions. The more blocks added after yours, the more confidence you have. That's why waiting for multiple confirmations is recommended.
In DAGs, like IOTA's Tangle, there's a concept of confirmation confidence. The selection algorithm runs multiple times—say, 100 simulations. You count how many times your transaction is directly or indirectly approved in the selected tips. A higher percentage means greater confidence that your transaction will remain final.
This might sound like a poor user experience, but it isn't. If Alice sends Bob 10 MagicDAGToken, she doesn't need to worry about choosing the right graph tips. Her wallet handles this in the background:
- Selecting tips with higher weight (those with the most cumulative confirmations).
- Tracing the path of previous transactions to ensure the tip has sufficient spendable balance.
- Adding the transaction to the DAG and confirming the previous ones once conditions are met.
To Alice, this looks like a normal cryptocurrency workflow. She enters Bob's address and the amount, then hits send. The list above represents the Proof-of-Work every participant runs when creating a transaction.
Advantages of DAGs in Cryptocurrency
Speed and Throughput
Free from block time limits, users can submit and process transactions at any time. As long as they confirm older transactions, there's no hard limit on the number of transactions per second the network can handle.
No Mining Required
DAGs don't use Proof-of-Work consensus in the traditional sense. Consequently, their carbon footprint is a fraction of that of cryptocurrencies relying on mining to secure a blockchain network.
Minimal to Zero Transaction Fees
With no miners, users typically don't need to pay fees to submit transactions. Some systems might require negligible fees for certain node types, but the cost is minimal. Free or low-fee transactions are ideal for microtransactions, where high network fees defeat the purpose.
Scalability
Unconstrained by block times, DAGs can process significantly more transactions per second than traditional blockchain networks. Many proponents believe this makes DAGs valuable for use cases involving the Internet of Things (IoT), where countless machines interact.
👉 Explore scalable blockchain solutions
Challenges and Disadvantages of DAGs
Potential Centralization Risks
Protocols relying on DAGs can have centralized elements. For some, this is a short-term solution to bootstrap the network. However, it remains to be seen if DAGs can thrive long-term without third-party intervention. If they fail, they could be exposed to attack vectors that might cripple the network.
Limited Real-World Testing
While DAG-based cryptocurrencies have been around for several years, they are still far from widespread adoption. This makes it difficult to predict how users might try to exploit the system in the future or what unforeseen challenges might arise.
Frequently Asked Questions
What is the main difference between a blockchain and a DAG?
Blockchain groups transactions into blocks that are chained sequentially. A DAG has no blocks; each transaction directly confirms previous ones, creating a graph-like structure. This can allow for higher throughput and no mining.
Are DAG-based cryptocurrencies truly fee-less?
Many aim to be fee-less for users, as there are no miners to compensate. However, some might impose negligible fees for network maintenance or to prevent spam. Always check the specific implementation.
Is a DAG more secure than a blockchain?
Both have security trade-offs. Blockchains benefit from the extensive security provided by mining and long-established consensus mechanisms. DAGs are newer and less battle-tested, but their structure offers unique advantages against certain attacks.
Can DAGs support smart contracts like Ethereum?
It depends on the implementation. Some DAG projects are exploring smart contract functionality, but it's more complex without a block-based structure. This area is still in development.
What are some examples of DAG-based cryptocurrencies?
Projects like IOTA (using the Tangle) and Nano have implemented DAG-inspired architectures. Each has unique features tailored to specific use cases, such as feeless microtransactions or IoT applications.
👉 Learn about advanced DAG implementations
Final Thoughts
Directed Acyclic Graphs present a fascinating alternative technology for building cryptocurrency networks. So far, few projects use this data structure, and the technology is not yet mature.
However, if they realize their potential, DAGs could power highly scalable ecosystems. The technology holds promise for applications requiring high throughput and minimal fees, such as IoT and microtransaction environments.