Layer 3 Computing Protocol: A Specialized Scaling Solution for AI Workloads

--

Layer 3 Computing Protocol: A Specialized Scaling Solution for AI Workloads

L2 is for general-purpose scaling, L3 is for customized scaling. Customized scaling might come in different forms: specialized applications that use something other than the EVM to do their computation, rollups whose data compression is optimized around data formats for specific applications (including separating ‘data’ from ‘proofs’ and replacing proofs with a single SNARK per block entirely), etc.”

— — Vitalik Buterin《What kind of Layer 3s make sense?

Table of Contents

  1. Introduction: The Need for Specialized Scaling
  2. Overview of Swan Chain and L3 Computing Protocol
  3. Architecture of L3 Computing Protocol
  4. Advantages of L3 Computing Protocol
  5. ZK-Engine: A Practical Example
  6. Conclusion: The Future of Specialized Layer 3 Solutions

1. Introduction

The evolution of blockchain technology has brought forth innovative scaling solutions, each addressing specific challenges in the ecosystem. Vitalik Buterin, a leading figure in the crypto space, emphasized the importance of distinguishing between Layer 2 (L2) and Layer 3 solutions in his blog post “What kind of Layer 3s make sense?”, stating that while L2 focuses on general-purpose scaling, L3 is designed for customized scaling.

This perspective aligns closely with our vision for the design of our Computing Layer. We recognized the need for a specialized scaling solution to address the unique demands of AI workloads in a blockchain environment.

In this article, we present the Layer 3 Computing Protocol (L3CP) — a solution designed specifically for high-performance AI computing within the Swan Chain ecosystem.

We’ll explore its architecture, highlighting how it addresses key challenges in decentralized computing, and take you through a practical example, we’ll demonstrate how the ZK-Engine is supported by L3CP, showcasing the protocol’s capabilities in real-world applications.

2. Swan Chain and L3 Computing Protocol Overview

Blockchain technology has evolved, bringing forth innovative solutions to address specific challenges within the ecosystem. Just as the Earth’s structure is composed of layers, with the core providing stability and the surface enabling life, the blockchain ecosystem can be envisioned similarly.

Ethereum serves as the “core”, providing the fundamental security and structure, while Swan Chain acts as the “surface”, enabling interactions and applications. Layer 3 (L3) Computing Protocol, much like the diverse life forms on the Earth’s surface, offers specialized solutions for unique needs, particularly in high-performance AI workloads.

The Layer 3 Computing Protocol(L3CP) is built on top of Layer 2 solutions, designed for specialized scaling and optimized performance in AI applications. This protocol aims to address four key areas:

  1. Scalability: As AI applications become more complex and data-intensive, there’s an increasing need for a solution that can handle the growing demand for computational power. L3CP is designed to scale efficiently to meet these demands.
  2. Cost-efficiency: The high gas fees associated with blockchain computations can be a significant barrier to adoption. L3CP implements innovative mechanisms to reduce these costs, making AI computations more economically viable on the blockchain.
  3. Specialization: AI workloads often have unique requirements in terms of data formats and processing needs. L3CP is optimized to handle these specialized needs, providing a more efficient environment for AI-specific tasks.
  4. Security: In a decentralized environment, ensuring the integrity and confidentiality of computations is paramount. L3CP incorporates robust security measures to protect sensitive AI models and data.

Having outlined the key objectives of L3CP, it’s crucial to understand how these goals are achieved through its thoughtfully designed architecture. Let’s delve into the intricate components and mechanisms that enable L3CP to deliver on its promises of scalability, cost-efficiency, specialization, and security.

3. Architecture of L3 Computing Protocol

The L3 Computing Protocol consists of three primary components: data management, task processing, and system coordination. These components work in tandem to create a scalable, secure, and efficient computing infrastructure.

3.1 Swan Storage DA

At the core of our data management strategy lies Swan Storage (MCS: Multichain Storage). This innovative Data Availability (DA) solution is specifically engineered to handle the storage of large datasets, a critical requirement for AI workloads.

In the L3 Computing Protocol, Swan Storage, leveraging the power of InterPlanetary Linked Data (IPLD), serves as the backbone for long-term data persistence, ensuring that vast amounts of AI-related data remain accessible and secure over extended periods.

https://ipld.io/specs/transport/car/content-addressable-archives.png

IPLD provides a content-addressable storage mechanism that allows for efficient data deduplication and retrieval. The system generates unique Content Identifiers (CIDs) for AI models, datasets, and computation results. These CIDs serve as immutable references to the data, enabling efficient storage and retrieval while maintaining data integrity.

3.2 Task Processing

The task processing layer handles the submission, execution, and verification of computing jobs. A key feature of this layer is the use of Blob CIDs. Instead of storing entire datasets on-chain, the system submits compact blobs containing references to the full off-chain data. This approach significantly optimizes on-chain storage and reduces gas costs associated with data storage and retrieval.

3.3 Protocol implementation: Sequencer

Sequencer is a specific implementation of L3 computing protocol on the Swan Chain, responsible for coordinating tasks, validating proofs, and interfacing with the underlying Swan Chain. Its architecture consists of five main components:

  1. Transaction Pool: An in-memory data structure that temporarily stores incoming transactions and proofs.
  2. Proof Validator: A module that cryptographically verifies the validity of submitted proofs.
  3. Batch Processor: Aggregates valid transactions and proofs into optimized data blobs.
  4. State Manager: Maintains the current state of processed transactions and account balances.
  5. Chain Submitter: Interacts with Swan Chain to submit batched transactions.

The Sequencer’s operational flow is as follows:

  1. Computing Providers (CPs) submit proofs of completed tasks to the Sequencer.
  2. The Proof Validator verifies the submitted proofs.
  3. Valid proofs are passed to the Batch Processor for aggregation.
  4. The Batch Processor creates optimized data blobs.
  5. The Chain Submitter sends these batched transactions to Swan Chain.
  6. AggregateTask contracts are created on Swan Chain with the corresponding blob CIDs.

A crucial function of the Sequencer is gas fee management. Batching transactions significantly reduces the gas costs associated with individual submissions. The Sequencer maintains separate accounts for gas costs, enabling flexible fee structures that can adapt to varying network conditions and user requirements.

3.4 Integration and Data Flow

The L3 Computing Protocol integrates these components to create a seamless data flow:

  1. Data is stored using IPLD, generating unique CIDs.
  2. Task submissions reference these CIDs, minimizing on-chain data storage.
  3. CPs execute tasks and submit proofs to the Sequencer.
  4. The Sequencer validates, batches, and submits proofs to Swan Chain.
  5. AggregateTask contracts on Swan Chain record the outcomes and manage reward distribution.

This architecture enables the L3 Computing Protocol to handle high volumes of AI computations efficiently while maintaining security and minimizing costs. Using CIDs and off-chain data storage allows for scalability, while the Sequencer’s batching mechanism significantly reduces transaction costs. The integration with Swan Chain provides a secure and transparent record of computations and results.

4. Benefits of L3 Computing Protocol

The L3 Computing Protocol’s innovative design and mechanisms offer significant benefits for AI and blockchain computations within the Swan Chain ecosystem:

Enhancing Scalability:

The protocol generates unique Content Identifiers (CIDs) for AI models, datasets, and computation results, enabling efficient data deduplication. This approach dramatically reduces storage requirements, allowing the system to accommodate an increasing volume of AI tasks without a corresponding surge in storage demands.

Cost Reduction:

By incorporating a sequencer that batches proofs into blobs, the Layer 3 Computing Protocol significantly mitigates gas costs associated with individual transactions. This batching mechanism not only optimizes expenses but also ensures efficient storage and retrieval of proofs.

Improved Data Availability and Integrity:

The protocol uses MCS to store aggregated task data as blobs, ensuring efficient storage and retrieval. The use of MCS also enhances data availability and integrity, as it generates unique content identifiers (CIDs) for each blob. It also integrates with Filecoin to provide a backup solution for MCS data, ensuring long-term availability and redundancy.

Security Fortification:

The Sequencer cryptographically verifies submitted proofs, while the protocol allows for the detection and correction of invalid state transitions. This comprehensive strategy safeguards the integrity of AI computations and offers robust protection against potential attacks or errors. Rigorous proof verification processes further reinforce the network’s integrity.

5. ZK-Engine: A Practical Example

To illustrate the practical application of the L3 Computing Protocol, let’s examine how it supports the ZK-Engine, a crucial component of the Swan Chain ecosystem serving as the primary Market Provider (MP) for Zero-Knowledge (ZK) computations.

In the ZK-Engine workflow:

  1. ZK tasks (e.g., FIL-C2–512M, FIL-C2–32G, ALEO) are submitted to the ZK Tasks Pool.
  2. Computing Providers (CPs) select and complete these tasks.
  3. CPs submit proofs of completed tasks to the Sequencer.
  4. The Sequencer verifies the proofs and checks the collateral.
  5. Valid proofs are batched and submitted to Swan Chain as AggregateTask contracts.
  6. Rewards are distributed to CPs, and any necessary slashing is performed.

The ZK engine, integrated with the Sequencer module(implementation of the L3 computing protocol), can efficiently and securely handle the verification of a large number of ZK proofs and data storage issues. It also supports horizontal scaling to meet the continuously growing data demands, effectively reducing the gas consumption of computing providers (CP), thereby conserving on-chain resources.

6. Conclusion: The Future of Specialized Layer 3 Solutions

As Vitalik noted, the future of scaling lies not in endlessly stacking identical layers, but in developing specialized solutions for specific use cases. The L3 Computing Protocol exemplifies this approach, offering a customized scaling solution for AI workloads within the Swan Chain ecosystem.

By embracing the principles of specialized scaling, we’re not just incrementally improving existing systems — we’re reimagining how blockchain technology can support the next generation of AI applications. As we continue to develop and refine this protocol, we invite the community to join us in exploring the vast potential of tailored Layer 3 solutions.

Reference:

[1] https://docs.swanchain.io/getting-started/protocol-stack/computing-layer/layer3-computing-protocol

[2] https://docs.swanchain.io/market-provider/web3-zk-computing-market/zk-auction-engine

[3] What kind of layer 3s make sense?

About Swan Chain

SwanChain, initiated in 2021, is a full toolset AI blockchain infrastructure accelerating AI adoption. Utilizing OP superchain technology, it pioneers in merging Web3 with AI by providing comprehensive solutions across storage, computing, bandwidth, and payments. By tapping into underutilized computing power across a network of community data centers, its integration facilitates a significant reduction in computing costs by up to 70% while enabling the monetization of dormant computing assets. Through innovative marketplaces for decentralized storage, AI, and Zero-Knowledge proofs, alongside the efficiency of LagrangeDAO for AI model deployment, SwanChain makes AI development seamless and affordable.

Our project is backed by top-tier investors in Web3 including Binance Labs, Protocol Labs, Chainlink Labs, etc., alongside joining forces with Nvidia, Google Web3 Startup Program, Microsoft Startup Program, Chainlink BUILD, and Filecoin Orbit.

Traction:

  • 10M user addresses and 1M daily transactions on the Saturn Testnet as of Q1 2024.
  • A vibrant community exceeding 100K Discord members.
  • Network expansion to 2,000+ computing providers across 100 global cities.
  • Over 50K deployments of AI model containers.

Stay connected with us:

Website: https://www.swanchain.io
Twitter:
https://twitter.com/swan_chain
Telegram:
https://t.me/swan_chain/
Discord:
https://discord.gg/swanchain
LinkedIn:
https://www.linkedin.com/company/swancloud

--

--

Swan Chain - Building A Full Toolset AI Blockchain
Swan Chain - Building A Full Toolset AI Blockchain

Written by Swan Chain - Building A Full Toolset AI Blockchain

Using OP Stack's Ethereum Layer 2 technology, we pioneers in merging Web3 with AI by providing full solutions across storage, computing, bandwidth, and payments

No responses yet