# What actually is a DAG?

I have tried googling it as well as finding it here.

Many people here talk about it, but what actually is a DAG?

• If one of the answers below has been particularly helpful to you, consider accepting it by clicking the check mark next to it.
– Tesa
Commented Jun 8, 2017 at 10:14
• Is it true that the Russian version of Ethereum will be based entirely on this architecture and so will be vastly more scalable? Commented Sep 23, 2017 at 18:21
• -Can We Copy This DAG File To Another PC (I'm New On Minning Oh And I'm Using Software Called "MinerGate v8.3) -Will My Coin Same As I Open To Another PC?
– nspy
Commented Oct 11, 2018 at 5:50
• It's a copy of the decentralized blockchain coin history. It's required for local mining. DAG stands for Directed Acyclic Graph, the technique used for store the data. Commented Feb 15, 2021 at 14:41

DAG stands for Directed Acyclic Graph. In Ethereum, a DAG is created every epoch using a version of the Dagger-Hashimoto Algorithm combining Vitalik Buterin's Dagger algorithm and Thaddeus Dryja's Hashimoto algorithm.

There are quite a few places where the DAG is defined in the docs and literature. These are collated below:

From the yellow paper:

...d being the current DAG, a large data set needed to compute the mix-hash...

From Wikipedia:

Directed Acyclic Graph: image credit David Eppstein

In mathematics and computer science, a directed acyclic graph (DAG), is a finite directed graph with no directed cycles. That is, it consists of finitely many vertices and edges, with each edge directed from one vertex to another, such that there is no way to start at any vertex v and follow a consistently-directed sequence of edges that eventually loops back to v again. Equivalently, a DAG is a directed graph that has a topological ordering, a sequence of the vertices such that every edge is directed from earlier to later in the sequence.

...a great huge dataset known as the DAG...

The Ethash algorithm expects the DAG as a two-dimensional array of uint32s (4-byte unsigned ints), with dimension (n × 16) where n is a large number. (n starts at 16777186 and grows from there.) Following the magic number, the rows of the DAG should be written sequentially into the file, with no delimiter between rows and each unint32 encoded in little-endian format.

From Vitalik Buterin's (I think) Dagger Paper, Dec 2013:

Dagger, a memory-hard proof of work based on moderately connected directed acyclic graphs (DAGs, hence the name), which, while far from optimal, has much stronger memory-hardness properties than anything else in use today.

Essentially, the Dagger algorithm works by creating a directed acyclic graph (the technical term for a tree where each node is allowed to have multiple parents) with ten levels including the root and a total of 2^25 - 1 values.

...calculating the PoW (Proof of Work) requires subsets of a fixed resource dependent on the nonce and block header. This resource (a few gigabyte size data) is called a DAG. The DAG is totally different every 30000 blocks (a 100 hour window, called an epoch) and takes a while to generate.

a DAG (directed acyclic graph) for the proof of work algorithm

a large, transient, randomly generated dataset

The DAG is the "dataset" in this description of the Ethash algorithm, emphasis mine:

1. There exists a seed which can be computed for each block by scanning through the block headers up until that point.
2. From the seed, one can compute a 16 MB pseudorandom cache. Light clients store the cache.
3. From the cache, we can generate a 1 GB dataset, with the property that each item in the dataset depends on only a small number of items from the cache. Full clients and miners store the dataset. The dataset grows linearly with time.
4. Mining involves grabbing random slices of the dataset and hashing them together. Verification can be done with low memory by using the cache to regenerate the specific pieces of the dataset that you need, so you only need to store the cache.
• On Vitalik Buterin's Dagger algorithm's link(hashcash.org/papers/dagger.html), the image does not show up, I assume it shows the example of 9 level DAG graph ("In level 1 through 8, the value of each node depends on three nodes in the level above it etc."). Is there any documentation to visualize the original The DAG graph that ethereum generates? Your example is just a simple DAG. Thank you. @atomh33ls Commented Nov 22, 2017 at 14:19

Ethereum uses Ethash (Proof of Work system).

Ethash PoW is memory hard, making it basically ASIC resistant. This basically means that calculating the PoW requires choosing subsets of a fixed resource dependent on the nonce and block header. This resource (a few gigabyte size data) is called a DAG. Sourced from here.

• Please note that the "here" link is dead. @Gaurav Agrawal Commented Nov 22, 2017 at 14:07
• Is the DAG growing linearly? Commented Dec 11, 2018 at 11:29

DAG stands for Dagger Hashimoto

It is a proposed spec for the mining algorithm for Ethereum 1.0.

Dagger Hashimoto aims to simultaneously satisfy two goals:

• ASIC-resistance: the benefit from creating specialized hardware for the algorithm should be as small as possible, ideally to the point that even in an economy where ASICs have been developed the speedup is sufficiently small that it is still marginally profitable for users on ordinary computers to mine with spare CPU power.
• Light client verifiability: a block should be relatively efficiently verifiable by a light client.

you'll find everything you want to know about DAG here

• euri10, Thank you for answering, unfortunately links sending users elsewhere to find that information aren't really considered an "answer" in the context of this this site. The folks here will work hard to curate this collection of knowledge, so when someone finally finds this site through search, the last thing we want to do is send them elsewhere to find that information. Can you include the essential parts of answering the question in the body of your post? Thanks. Commented Mar 11, 2016 at 15:46
• fair enough :) done ! Commented Mar 11, 2016 at 15:49
• So does DAG stand for both directed analytic graph and Dagger Hashimoto? It seems like a directed analytic graph is more general concept while Dagger Hashimoto is a specific means of implementation. (Also, the link to github is dead.) Commented Jun 5, 2018 at 18:23
• @sfmiller940 Directed *acyclic graph, not analytic.
– Zee2
Commented Feb 15, 2021 at 9:10

I see that no one mentioned what the DAG really is. As from the description of what the DAG file contains you can see that DAG stands for directed acyclic graph. This is represented in the file as a matrix.

This post explains all the associated concepts of DAG and blockchain. I personally found this very useful as it clears a lot of complicated concepts.