{"id":10560,"date":"2023-07-28T13:03:26","date_gmt":"2023-07-28T13:03:26","guid":{"rendered":"https:\/\/www.bitnovo.com\/blog\/?p=10560"},"modified":"2025-09-10T15:22:57","modified_gmt":"2025-09-10T15:22:57","slug":"what-is-a-directed-acyclic-graph-dag","status":"publish","type":"post","link":"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-directed-acyclic-graph-dag","title":{"rendered":"What is a directed acyclic graph (DAG)?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Alternar tabla de contenidos\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-directed-acyclic-graph-dag\/#blockchain_data_structure\" >Blockchain data structure<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-directed-acyclic-graph-dag\/#dag_structure_and_difference_with_blockchain\" >DAG structure and difference with blockchain<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-directed-acyclic-graph-dag\/#dag-based_distributed_ledger\" >DAG-based distributed ledger<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-directed-acyclic-graph-dag\/#advantages_and_problems\" >Advantages and problems<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Tiempo de lectura:<\/span> <span class=\"rt-time\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutos<\/span><\/span><p>As many of you know, the\u00a0<strong>blockchain<\/strong>\u00a0revolution consists of creating a distributed ledger, also called a\u00a0<strong>distributed ledger<\/strong>. This ledger is where\u00a0<strong>cryptocurrencies<\/strong>\u00a0live and change ownership. Its maintenance does not depend on central points of failure, that is, it is\u00a0<strong>decentralized<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p>This is why blockchains (if they are well built, with a native currency) offer us access to\u00a0<strong>monetary and financial platforms<\/strong>\u00a0freely and without trust. But since 2009, the year Bitcoin was launched, the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-third-generation-blockchain\/\">research<\/a>\u00a0to create better technologies has not stopped, and one of those areas under development are cryptocurrencies based on\u00a0<strong>Directed Acyclic Graph or simply DAG.<\/strong><\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h2><span class=\"ez-toc-section\" id=\"blockchain_data_structure\"><\/span><strong>Blockchain data structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>As its name suggests, the information in a blockchain is organized in\u00a0<strong>linked blocks<\/strong>. Each\u00a0<strong>block points to a parent block<\/strong>\u00a0(the previous block), specifically with the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-hash\/\">hash<\/a>\u00a0of the previous block header.<\/p>\n<p>Actually the\u00a0<strong>blockchain<\/strong>\u00a0structure existed long\u00a0<strong>before Bitcoin<\/strong>\u00a0but the real innovation brought by blockchains (of cryptocurrencies) are the\u00a0<strong>consensus protocols<\/strong>, such as the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-proof-of-work-the-bitcoin-consensus-protocol\/\">Proof of Work<\/a>.<\/p>\n<p>These protocols make modifications to the registry have a\u00a0<strong>cumulative cost<\/strong>\u00a0(depending on the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-block-height\/\">block height<\/a>), offering some guarantee that transactions will\u00a0<strong>not be reversed and\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-double-spending-attack\/\">money stolen<\/a><\/strong><a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-double-spending-attack\/\">.<\/a>\u00a0They achieve all this by using the properties of the information structure we have described, the blockchain.<\/p>\n<p>This is why the word blockchain is used to refer, rather than to the\u00a0<strong>data structure<\/strong>\u00a0itself, to\u00a0<strong>distributed ledger<\/strong>\u00a0technology (DLT).<\/p>\n<p>&nbsp;<\/p>\n<p>In these distributed ledgers, blockchain blocks\u00a0<strong>contain transactions<\/strong>, are generally<strong>\u00a0limited in size<\/strong>\u00a0so as not to cause centralization, and\u00a0<strong>occur at an interval<\/strong>\u00a0that can range from seconds to minutes.<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h3><span class=\"ez-toc-section\" id=\"dag_structure_and_difference_with_blockchain\"><\/span><strong>DAG structure and difference with blockchain<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p><strong>Directed Acyclic Graph is a data structure different\u00a0<\/strong>from the blockchain that comes from\u00a0<strong>Graph Theory<\/strong>. Data are represented as\u00a0<strong>vertices or \u201cnodes\u201d<\/strong>\u00a0and are connected to each other by edges. The edges represent a vertex connecting to a previous vertex, in the same way that the blocks of the blockchain are linked to each other.<\/p>\n<p>&nbsp;<\/p>\n<p>\u201cDirected\u201d comes from the fact that these edges have a<strong>\u00a0direction<\/strong>. This also happens in the blockchain where block 70 points to 69, 69 to 68, and so on up to the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-genesis-block\/\">genesis block<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>The \u201cAcyclic\u201d part comes from the fact that you can\u2019t give loops, it\u2019s\u00a0<strong>acyclic.<\/strong>\u00a0Again, similar to blockchain. Block 69 cannot point to block 70. In fact, block 70 is built and added later, so block 69 cannot reference it beforehand.<\/p>\n<p>This makes perfect sense because this registry only\u00a0<strong>consists of adding new transactions grouped in blocks<\/strong>, which are transmitted over the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-peer-to-peer-network\/\">P2P network<\/a>\u00a0on the fly. The blockchain therefore only grows\u00a0<strong>in one direction<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p>But\u00a0<strong>what differentiates DAG from a blockchain<\/strong>\u00a0is that a vertex can reference different previous vertices, while in the blockchain there is only one parent block.<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div id=\"image_1225958949\" class=\"img has-hover x md-x lg-x y md-y lg-y\">\n<div class=\"img-inner dark\"><img fetchpriority=\"high\" decoding=\"async\" class=\"attachment-large size-large lazyloaded\" src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG.jpg\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG-300x205.jpg 300w\" alt=\"\u00bfQu\u00e9 es Directed Acyclic Graph (DAG)?\" width=\"768\" height=\"526\" data-srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG-300x205.jpg 300w\" data-src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG.jpg\" data-sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/div>\n<\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h2><span class=\"ez-toc-section\" id=\"dag-based_distributed_ledger\"><\/span><strong>DAG-based distributed ledger<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p><strong>DAG-based cryptocurrencies<\/strong>\u00a0work without using the famous transaction blocks.\u00a0<strong>The transaction ledger<\/strong>\u00a0becomes a continuum of\u00a0<strong>linked transactions<\/strong>\u00a0(instead of blocks).\u00a0<strong>The transactions<\/strong>\u00a0are t<strong>he vertices of the DAG and the hashes are the edges.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>When a user wants to make a transaction he has to<strong>\u00a0solve a proof of work<\/strong>\u00a0(much less expensive than Bitcoin). The proof consists of\u00a0<strong>following an algorithm to see which transactions to build on<\/strong>\u00a0(which transactions to target with hashes) and\u00a0<strong>verify<\/strong>\u00a0that these transactions\u00a0<strong>are valid.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Once this test is done, the user t<strong>ransmits his transaction<\/strong>\u00a0through the network and the network\u00a0<strong>confirms the transactions he has referenced<\/strong>. In the same way the user\u2019s transaction\u00a0<strong>remains unconfirmed<\/strong>\u00a0until it is\u00a0<strong>referenced by other transactions<\/strong>. In general the algorithms are implemented in such a way that it will be more likely to build on transactions with more\u00a0<strong>cumulative commits<\/strong>. For example, it will be more likely to build on a transaction that has committed 5, than on one that only references 1.<\/p>\n<p>Just as in Bitcoin a transaction is more\u00a0<strong>difficult to reverse the higher the number of confirmations<\/strong>, the same would happen here, although we do not know how many confirmations would be necessary to consider the transaction sufficiently secured. Under this design\u00a0<strong>there is no miner<\/strong>\u00a0and the accumulated work comes from the users.<\/p>\n<p>&nbsp;<\/p>\n<p>The specific rules for reaching consensus<strong>\u00a0depend on each implementation<\/strong>\u00a0and could vary quite a bit, for example, using centralized servers.<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div id=\"image_1314198053\" class=\"img has-hover x md-x lg-x y md-y lg-y\">\n<div class=\"img-inner dark\"><img decoding=\"async\" class=\"attachment-large size-large lazyloaded\" src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG1.jpg\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG1.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG1-300x205.jpg 300w\" alt=\"\u00bfQu\u00e9 es Directed Acyclic Graph (DAG)?\" width=\"768\" height=\"526\" data-srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG1.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG1-300x205.jpg 300w\" data-src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/08\/Que-es-Directed-Acyclic-Graph-DAG1.jpg\" data-sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/div>\n<\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h3><span class=\"ez-toc-section\" id=\"advantages_and_problems\"><\/span>Advantages and problems<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>Among the advantages of this type of system are\u00a0<strong>shorter confirmation times, greater scalability<\/strong>\u00a0as they are not subject to block size limitations and\u00a0<strong><a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-are-network-fees\/\">very low<\/a>\u00a0or non-existent commissions<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p>However, as we have already explained on different occasions,<strong>\u00a0there is no free lunch<\/strong>\u00a0in the blockchain world. If the number of transactions does not have a limit, the registry can\u00a0<strong>grow too large<\/strong>\u00a0and prevent users from verifying the information without trusting third parties, causing\u00a0<strong>centralization.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The shorter confirmation times are really irrelevant, because what really matters are the\u00a0<strong>finality guarantees<\/strong>. Waiting 10 minutes in Bitcoin could, for example, give you a thousand times more security than 10 minutes in a DAG system.<\/p>\n<p>&nbsp;<\/p>\n<p>Another problem is that these systems are not fully decentralized and\u00a0<strong>rely on points of failure such as coordination servers<\/strong>. The implementations are also centralized as is the case with Hedera Hashgraph and<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-iota-the-project-that-moves-away-from-blockchains\/\">\u00a0IOTA.<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>In conclusion this technology could be interesting<strong>\u00a0if decentralization is not a priority<\/strong>. The problem is that these systems are\u00a0<strong>not sufficiently tested and may be insecure.\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>When looking for\u00a0<strong>scalability<\/strong>, in my opinion, and surely in the opinion of many, it is much better to use\u00a0<strong>second-layer technologies<\/strong>\u00a0such as<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-the-lightning-network\/\"><strong>\u00a0Lightning Network and ZK-Rollups<\/strong><\/a>\u00a0that already\u00a0<strong>run on secure, decentralized blockchains.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Tiempo de lectura:<\/span> <span class=\"rt-time\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutos<\/span><\/span>As many of you know, the\u00a0blockchain\u00a0revolution consists of creating a distributed ledger, also called a\u00a0distributed ledger. This ledger is where\u00a0cryptocurrencies\u00a0live and change ownership. Its maintenance does not depend on central points of failure, that is, it is\u00a0decentralized. &nbsp; This is why blockchains (if they are well built, with a native currency) offer us access to\u00a0monetary [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":7644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-10560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blockchain-en"],"_links":{"self":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/comments?post=10560"}],"version-history":[{"count":2,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10560\/revisions"}],"predecessor-version":[{"id":24640,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10560\/revisions\/24640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/media\/7644"}],"wp:attachment":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/media?parent=10560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/categories?post=10560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/tags?post=10560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}