[ad_1]
Some believe that the future of cryptocurrency payments networks lies in an altogether different architecture – directed acyclic graphs (or DAGs).
A DAG is a different kind of data structure – think of it like a database that connects different pieces of information together. “Directed acyclic graph” is a loaded term, so let’s start by breaking it down.
A Directed Acyclic Graph.
Conceptually, DAGs look something like the above. They’re made up of vertices (the spheres) and the edges (the lines connecting them). They’re directed because they head in one direction (you can see this illustrated with the arrows). They’re acyclic (i.e., not cyclic) because the vertices don’t loop back on themselves – if you start at one point and follow the graph, you can’t return to that same point. This will become clearer shortly.
Such data structures are generally used to model data. You might rely on a DAG in scientific or medical fields to observe the relationship between variables and to determine how they impact each other. For instance, you could take things like nutrition, sleep cycles, and physical symptoms, so that you can draw links between them to establish how they affect a patient.
For a new transaction to be added, it must build on top of older ones. Suppose that Alice creates a new transaction. For it to be acknowledged, this transaction must reference previous ones. A bit like how a block in Bitcoin references the one that came before it, but there are multiple transactions referenced.
In some systems, an algorithm will select which transactions (or “tips”) a new transaction must build on. Tips more likely to be selected are those that have more accumulated weight – a measure of how many confirmations the path to the tip has.
The transactions that Alice will build on top of are unconfirmed. But once Alice references them, they become confirmed. Alice’s transaction is now unconfirmed, so someone else must build on top of it before it’s accepted.
Users are more likely to confirm transactions with a “heavier” weight so that the system keeps growing. Otherwise, there would be nothing stopping users from continuously building on older transactions.
DAGs also have a mechanism to prevent double-spending. It’s sort of similar, but without miners. When a node confirms older transactions, they assess a whole path back to the DAG’s very first transaction to be sure that the sender has a sufficient balance. There could be multiple paths, but only one needs to be verified.
If users build on an invalid path, they run the risk of their own transaction being ignored. Theirs could be legitimate, but because the previous one wasn’t, no one will want to extend that particular path.
It seems unintuitive at first – couldn’t you end up in a situation where multiple branches that aren’t aware of each other exist? Then, couldn’t people spend the same funds on these different branches?
That’s indeed a possibility, but it’s resolved with a selection algorithm that favors tips with a heavier accumulated weight. That means that, over time, you’ll end up with a branch that is much stronger than the rest. Weaker ones will be abandoned, and the network will continue building on the heaviest one.
This might seem like it leads to bad user experience. But that isn’t the case. If Alice sends Bob 10 MagicDAGTokens, she doesn’t need to worry about selecting the right tips of the graph. Under the hood, her wallet might do the following:
- Select heavy tips (remember, these are the ones with the most accumulated confirmations).
- Follow the path back through previous transactions to make sure the tips have a sufficient balance to spend.
- Once satisfied, they add their transaction to the DAG, confirming the transactions they’re built on.
To Alice, this will just look like the regular cryptocurrency workflow. She enters Bob’s address and the amount she wants to spend, then presses send. The list above is the Proof of Work that every participant runs when creating a transaction.
Pros of DAGs
Speed
No mining
No transaction fees
No scalability issues
Cons of DAGs
Not entirely decentralized
Protocols that rely on DAGs have various elements of centralization. For some, it’s supposedly a short-term solution to bootstrap the network, but it remains to be seen whether DAGs can thrive without the intervention of third-parties. If not, they open themselves up to attack vectors that could eventually cripple their networks.
Not tested at scale
Though DAG-based cryptocurrencies have been around for a few years, they have a long way to go before seeing widespread use. As such, it’s difficult to predict what incentives users might have to exploit the system in the future.
[ad_2]
Source link