Blockchain vs. DAG – an overview


Cryptocurrencies record transactions on a distributed ledger – a decentralised database – but not all distributed ledger technologies (DLTs) were created equal.

Blockchain Technology & The “Trilemma”

Traditionally, cryptocurrencies run on a blockchain: a linear chain of blocks in an unalterable (A.K.A immutable), chronological order. Each block contains a set number of transactions, and each block is cryptographically linked to the previous block(s) using a unique code known as a hash to prevent tampering:

The architecture of a blockchain. Blockchain technology currently powers the vast majority of cryptocurrencies, including BTC, ETH, XRP, SOL, XLM, XTZ and ALGO.

Blockchain is an extremely secure and proven technology. Consensus (i.e. deciding what to write in each block) is achieved by validating blocks one at a time. For example, BTC’s consensus mechanism is the miner-dependent Proof-of-Work (PoW) protocol.

However, given their linear “one after another” structure – blockchains suffer from an array of problems. Vitalik coined the phrase “blockchain trilemma” to describe the inability to build or difficulty in building a blockchain that is simultaneously: (i) decentralised (ii) scalable and (iii) secure – without compromising on any individual facet.

e.g.: ETH is highly decentralised, secure but can only process ~30 transactions per second (TPS) – meaning it is not scalable and transaction fees are high as users must effectively ‘compete’ for space in each block.

Solving the Trilemma – New Consensus or New DLT?

Several solutions to the blockchain trilemma have been proposed. Most efforts have revolved around improving blockchain technology by introducing new consensus mechanisms e.g. Proof-of-Stake (PoS).

Delegated PoS – the most common form of PoS where users pledge their coins to validators who in turn validate new blocks – is orders of magnitude more scalable than PoW. PoS is also considered to be relatively secure. A validator (or a group of validators) would need to own ~33-51% of the total stake (i.e. potentially billions of $$$) to successfully attack the network – and, even if they acquired such an amount, why would they attack something they’re so heavily invested in? PoS would, however, be susceptible to state-sponsored attacks.

Despite the scalability and security of PoS, serious questions remain over how decentralised it is. PoS networks typically have <100-300 validators, concentrating power into the hands of the few. Although, arguably, parallels can be drawn to PoW – where BTC mining pools also act as centralising powers.

While a number of projects have tweaked PoS (e.g. ALGO’s pure PoS, ONE’s effective PoS or SOL’s hybrid proof-of-history + PoS) to further decentralise the network or find the ‘sweet spot’ between decentralisation, security and scalability – other projects have decided to ditch blockchain technology altogether.

Directed Acyclic Graph (DAG) Technology

Projects such as IOTA, NANO, FTM and HBAR do not use blockchains, but rather variations on a directed acyclic graph (DAG). DAGs are not linear, and instead possess a branching, ‘tree-like’ structure. A DAG is directed because it follows a topological order – the sequence can only move from earlier to later (see below). In this way, it is not too dissimilar from a blockchain.

However, there are no blocks of transactions – instead, it is a network of individual transactions that are directly linked:

The architecture of a DAG. Each arrow is a transaction.

What do I mean by directly linked? Think about this analogy: four people (A,B,C,D) are in a room. ‘A’ needs to relay a message to ‘D’. In a blockchain, this may necessitate passing the message along a chain i.e. A→B→C→D. In a DAG, it is shortened to A→D – speeding up the process for the two main participants – and D will inform B and C of the message later (if necessary).

In a DAG, all users are both issuers (i.e. they make/send transactions) and validators. Specifically, in IOTA, in order to have your transaction verified – you must verify two previous transactions and perform a small amount of PoW to prevent spam. No network user can validate their own transaction (that’s the acyclic part of DAG – there is never a circular arrow back to the same node).

Consensus in other coins is achieved in various ways (e.g. asynchronous byzantine fault tolerance (aBFT) in HBAR and FTM) – but this is beyond the scope of this post.

As DAGs do not require mining and can reference multiple transactions simultaneously, they’re extremely scalable (10,000+ TPS, theoretically 1m+ TPS), lightweight and have zero or negligible transaction fees.

Nevertheless, the extent to which a DAG is decentralised and secure depends heavily on the number of transactions currently happening. A reduction in the volume of transactions leaves DAGs vulnerable to attack. To mitigate this risk, DAG projects include centralised features (e.g. central coordinators, pre-selected validators, witness nodes, or in the case of HBAR, a completely private network). Therefore, DAGs have not solved the trilemma either – at least yet.

It’s also important to remember that DAGs are new, unproven technology.

What is the future?

Nobody knows and it remains unclear. The ‘perfect’ consensus mechanism or network architecture is yet to emerge (if it ever does). Blockchains and DAGs are likely to co-exist, serving distinct purposes – or a totally new DLT may arise. In any case, these are exciting times: we’re early enough in this space to watch the technology evolve and the future unfold in real-time.

submitted by /u/Zarkorix
[link] [comments]