AI Network’s Layer 2 DAG: Navigating Beyond Singular Truth with Blockchain Consensus

AI Network
9 min readApr 11, 2024

See the original YouTube livestream with AI Network CEO Minhyun Kim and CSO Simon Kim here.

The concept of consensus lies at the heart of traditional blockchain technology. In order for transactions to be processed, blocks to be resolved and cryptocurrencies to move between wallets, consensus between nodes, users and generally throughout the network should be reached.

Layer 1 is the foundational level of a blockchain network. It encompasses the core architecture, rules and protocols that define the network’s operation. Layer 2 solutions are secondary frameworks that sit on top of layer 1’s to enhance scalability, speed and efficiency, which they generally achieve by settling transactions off the main chain and sending them back to layer 1.

Traditional consensus mechanisms focus on a singular truth that must be agreed upon by all participants on a layer 1 network. AI Network has developed a Layer 2 innovation which stands as a pivotal advancement in blockchain technology. This development not only facilitates instantaneous & verifiable interactions, but also integrates Directed Acyclic Graph (DAG) and Merkle Tree architecture, and as an innovation stands as a divergence away from conventional blockchain consensus mechanisms focused on a singular truth.

Revisiting the Concept of Consensus

Traditionally, blockchain platforms like Ethereum have relied on consensus mechanisms to establish a unified truth among all network participants, meaning all users must agree on one thing in order for the network to keep moving. This necessity for unanimous agreement ensures a high level of security & trust, but significantly limits system throughput, speed and scalability. So much so, in fact, that this type of consensus has earned Ethereum the illustrious title of the “world’s slowest computer.”

It’s something akin to having 7 billion people on a phone call at once, with the goal of having everyone agree on the same thing. This would be the world’s slowest phone call, and since decisions take more time the more users/participants are added, it would be the world’s slowest agreement by its very definition. A high number of users on a network that requires unanimous agreement increases the number of transactions and likelihood of congestion on the network, which increases transaction fees as well as slowing the network down.

The AI Network challenges the norm of consensus via unified truth. It does this by advocating for a spectrum of consensus that extends beyond absolute agreement. This norm must be challenged in the age of AI because the diverse outcomes produced by AI and ML processes must be accommodated on the blockchain. This is to record AI outcomes and keep the development and direction of AI sufficiently decentralized.

Directed Acyclic Graph (DAG)

One of the core distinguishing features of AI Network’s Layer 2 solution is the integration of Directed Acyclic Graph (DAG) architecture. A DAG is a simple framework with powerful applications in blockchain technology, as well as across other disciplines.

Directed Acyclic Graphs are defined by three core features.

Firstly a DAG is a form of graph database. Graph databases consist of nodes and connections between nodes, and represent systematic collections of data that emphasize the relationships and connections between different data entities. If you’ve ever made a mind map, for example, you’ve used a graph database.

A Mind Map, a form of graph database. Image source: Wikimedia Commons.

Secondly, a DAG is directed, meaning the flow of data can only take one specified direction between nodes — data cannot flow backward in a DAG. Thirdly, a DAG is acyclic, meaning that it cannot cycle back to the start — it cannot repeat itself. It operates in one direction from start to finish only.

DAG example. Image source: Wikimedia Commons

The image above is a visual representation of a very simple DAG. As you can see, there are nodes and connections between the nodes, and the connections flow one way only. The ultimate flow of this DAG is from node A to node E, and never back from E to A (or backwards between any nodes between the start and end point, e.g. you cannot flow from node D to C or B).

As the image above shows, the data must flow from node A to node E, and it can take any possible route between the nodes in one direction only. Possible flows are: A>B>D>E; A>C>D>E; A>D>E; or A>E. Note there is no possibility of an A>B>C>D>E combination, as there is no connection between nodes B and C.

A real-world, non-blockchain example of a DAG is sending parcels through postage services. Say you live in the US and you purchase a pair of shoes produced in Italy. The route of the parcel leaving its origin and reaching you, its destination, could take a few different potential flows through different postage centers in different countries.

Image source: intricity101 YouTube channel

Each postage center is regarded as a node, and each route between nodes is a connection. There are connections between some nodes and not others, and the connections flow only one way — from the parcel’s origin to you, its destination. If the parcel was to take a route back from one postage center to a previous one (and therefore move backwards in the wrong direction between nodes), the sending of the parcel would be deemed inefficient or unsuccessful, meaning the process would have failed because DAG architecture was not followed.

Incorporating DAG into Layer 2: Speed and Scalability

Some interesting properties emerge from DAG architecture, and when considering its application in blockchain technology, incorporating DAGs into a layer 2 solution creates a novel approach that offers several advantages over traditional blockchain structures.

1. Enhanced Scalability:

One of the core properties emerging from DAGs is that the architecture allows for parallel transactions to be processed at once. Think back to the parcel example above. You could order 3 different parcels from the same origin and they could all take different routes to reach you simultaneously, and reach you all at the same time.

Applying this to blockchain technology; traditional blockchains like Ethereum or Bitcoin process one block of transactions at a time, which is akin to sending one parcel through one route only, over and over again. The single connection between the origin and destination nodes can only process one packet of data at one time and can only handle a certain amount of data. Anything over that amount has to wait until the next block. This severely limits the speed and scalability of the blockchain.

The DAG’s capability to process in parallel — to process multiple transactions at once, significantly increases the network’s throughput, unlike traditional blockchains. The DAG’s multi-nodal structure enables multiple transactions to coexist and validate each other, leading to faster transaction speeds and the potential for many more transactions to be processed, leading to much higher scalability.

2. Reduced Latency

Many traditional blockchains operate with the need for block confirmation times. Keeping in mind that classic blockchains function with the need for a unified truth, and the fact that only one block can be processed at any one time (only one route for data to flow), latency rates can rise significantly due to transactions piling up and the need for all validators on the network to agree on a singular truth.

In contrast, by facilitating simultaneous transactions without the need for block confirmation times, DAG architecture reduces transaction latency, making real-time interactions on the blockchain faster, more feasible and more efficient.

3. Flexible Consensus Mechanism

AI Network adopt an adaptive consensus approach, as opposed to an absolute consensus approach. This approach is complemented by the capabilities of DAG architecture, and the focus here is a shift from achieving a singular, absolute truth to validating the integrity and origin of diverse data. This flexibility is crucial to the artificial intelligence environment, where AI-generated results from various models can vary considerably. Adaptive consensus and the parallel processing power of DAGs enables a far more inclusive model for AI-related results & data and associated transactions on the blockchain.

Key Innovations of AI Network’s Layer 2

The AI Network layer 2 offers practical utilities and advantages within the AI Network and the blockchain

AI Agents

AI Network prioritizes AI agents. An AI agent is any AI model that operates as a dynamic entity; one that learns and evolves through data interactions. The evolution of AI agents is a core part of AI architecture, in that AI models are designed to learn the more data they are given (for example how chatGPT learns more everytime you ask it a question). The static approaches of traditional blockchains are not geared, nor designed, for the highly dynamic and ever-changing nature of machine learning models. AI Network adaptive consensus layer 2 innovation offers an alternative approach to rigid blockchain consensus mechanisms, and is specially designed for the dynamic nature of AI models and the marriage of AI and blockchain.

Real-Time Data Verification

Alongside DAG, the AI Network layer 2 leverages a Merkle Tree structure for P2P interactions in order to verify integrity of data in real time. Merkle Tree Proofs are invaluable for verifying data via the structure of the ‘tree’. Merkle Trees give datasets hashes (unique cryptographic signatures) by hashing all of the data within them. If any of the data within the dataset is changed (for example if a transaction is changed within a block), the hash of the entire dataset also changes and indicates changes in real-time. The Merkle Tree architecture alongside the DAG ensures immediate data integrity verification, crucial for AI agents and applications demanding real-time communication.

Adaptive Consensus with DAG

The core philosophy of the AI Network layer 2 lies in its adaptive consensus — a concept that is realized through DAG architecture. The nature of AI-generated outcomes is inherently variable (AI models may give different outcomes to the exact same query given to them twice in a row), and if AI is to be connected to blockchain technology, as the AI Network does, it is imperative the blockchain be adaptive, not rigid. AI Network’s DAG-based flexible consensus mechanism facilitates a broader acceptance of diverse results in real time.

Verifiable Conversations

By emphasizing verifiable, real-time conversations, AI Network addresses the need for swift and reliable data exchange, setting itself apart from other solutions that focus solely on transaction scalability without the focus on real-time verifiable data exchange. This is absolutely essential for AI on the blockchain, as AI agents, models and applications will be constantly communicating with the blockchain as their results are recorded and transactions are settled.

AI Network’s Layer 2 represents a significant leap forward in blockchain technology, not just in terms of scalability and efficiency but also in the way consensus is understood and achieved. Moving from rigid, unified truth to adaptive consensus is essential for the age of AI, and by integrating DAG architecture and embracing the variability inherent in AI, AI Network heralds a new era of dynamic, intelligent blockchain applications that move beyond the constraints of traditional and more rigid singular truth blockchain paradigms for the AI field.

AI Network is a decentralized AI development ecosystem based on blockchain technology. Within its ecosystem, resource providers can earn $AIN tokens for their GPUs, developers can gain access to GPUs for open source AI programs, and creators can transform their AI creations into AINFTs. The ultimate goal of AI Network is to bring AI to Web3, where everyone can easily develop and utilize artificial intelligence.

If you want to know more about us,

--

--

AI Network

A decentralized AI development ecosystem built on its own blockchain, AI Network seeks to become the “Internet for AI” in the Web3 era.