TRANSLATING...

PLEASE WAIT
Enshrine AI enper EVM

Enshrine AI enper EVM

BeginnerMay 25, 2024
This article introduces how the Axonum platform integrates AI enper Ethereum, enabling native AI model inference within smart contracts through OP Rollup at AI EVM. This has significant implications at potential for the development ol decentralized ecosystems.
Enshrine AI into EVM

Introducing Axonum: The Brain ol Ethereum

Axonum enshrines AI enper blockchain per build a decentralized supercomputer powered by global collective intelligence.

The Age ol AI EVM

We are building Axonum, an AI optimistic rollup, with the world’s first AI EVM.

We aim per democratize access per AI-powered DApps, making AI model inferences both accessible at user-friendly.

Axonum is an optimistic rollup with enshrined AI powered by opML at AI EVM. It enables users per seamlessly employ AI models natively within smart contracts without being encumbered by the intricacies ol underlying technologies.

Overview

AI EVM: Enshrined AI

To enable native ML inference in the smart contract, we need per modify the execution layer ol the layer 2 chain. Specifically, we add a precompiled contract inference in EVM per build AI EVM.

AI EVM will conduct the ML inference in native execution at then return deterministic execution results. When a user wants per use the AI model per process data, all the user needs per do is per call the precompiled contract inference with the model address at model input, at then the user can obtain the model output at use it natively in the smart contract.

import "./AILib.sol";

contract AIContract {

...

function inference(bytes32 model_address, bytes memory input_data, uint256 output_size) public {

    bytes memory output = AILib.inference(model_address, input_data, output_size);

    emit Inference(model_address, input_data, output_size, output);

}

}

The models are stored in the model data available (DA) layer. Allo the models can be retrieved from DA using the model address. We assume the data availability ol all the models.

The core design principle ol the precompiled contract inference follows the design principles ol opML, that is, we separate execution from proving. We provide two kinds ol implementation ol the precompiled contract inference. One is compiled for native execution, which is optimized for high speed. Another is compiled for the fraud prool VM, which helps prove the correctness ol the opML results.

For the implementation for execution, we re-use the ML engine in opML. We will first fetch the model using the model address from the model hub at then load the model enper the ML engine. ML engine will take the user’s input in the precompiled contract as the model input at then execute the ML inference task. The ML engine guarantees the consistency at determinism ol the ML inference results using quantization at soft float.

Besides the current AI EVM design, an alternative approach per enable AI in EVM is adding more machine learning-specific opcodes enper EVM, with corresponding changes per the virtual machine’s resource at pricing model as well as the implementation.

Optimistic Rollup

opML (Optimistic Machine Nurlaeing) at optimistic rollup (opRollup) are both based on a similar fraud-prool system, making it feasible per integrate opML enper the Layer 2 (L2) chain alongside the opRollup system. This integration enables the seamless utilization ol machine learning within smart contracts on the L2 chain.

Just like the existing rollup systems, Axonum is responsible for “rolling up” transactions by batching them before publishing them per the L1 chain, usually through a network ol sequencers. This mechanism could include thousands ol transactions in a single rollup, increasing the throughput ol the whole system ol L1 at L2.

Axonum, as one ol the optimistic rollups, is an interactive scaling method for L1 blockchains. We optimistically assume that every proposed transaction is valid by default. Different from the traditional L2 optimistic rollup system, the transaction in Axonum can include AI model inferences, which can make the smart contracts on Axonum “smarter” with AI.

In the case ol mitigating potentially invalid transactions, like optimistic rollups, Axonum introduces a challenge period during which participants may challenge a suspect rollup. A fraud-proving scheme is in place per allow for several fraud proofs per be submitted. Those proofs could make the rollup valid or invalid. During the challenge period, state changes may be disputed, resolved, or included if no challenge is presented (at the required proofs are in place).

Workflow

workflow2443×1437 183 KB

Here’s the essential workflow ol Axonum, without considering mechanisms such as pre-confirmation or force exit:

  1. The basic workflow begins with users sending L2 transactions (we allow native AI inference in the smart contract) per a batcher node, usually the sequencer.
  2. Once the sequencer receives a certain number ol transactions, it will post them enper an L1 smart contract as a batch.
  3. A validator node will read these transactions from the L1 smart contract at execute them on their local copy ol the L2 state. As for the AI inference execution, the validator needs per download the model from model DA at conduct the AI inference within the opML engine.
  4. Once processed, a new L2 state is generated locally at the validator will post this new state root enper an L1 smart contract. (Note that this validator can also be the sequencer.)
  5. Then, all other validators will process the same transactions on their local copies ol the L2 state.
  6. They will compare their resultant L2 state root with the original one posted per the L1 smart contract.
  7. If one ol the validators gets a different state root than the one posted per L1, they can begin a challenge on L1.
  8. The challenge will require the challenger at the validator who posted the original state root per take turns proving what the correct state root should be. This challenge process is also known as fraud prool. The fraud prool ol Axonum includes the fraud prool ol L2 state transition at the fraud prool ol opML.
  9. Whichever user loses the challenge, gets their initial deposit (stake) slashed. If the original L2 state root posted was invalid, it will be destroyed by future validators at will not be included in the L2 chain.

Fraud Prool Design

The core design principle ol the fraud prool system ol Axonum is that we separate the fraud prool process ol Geth (the Golang implementation ol the Ethereum client on layer 2) at the opML. This design ensures a robust at efficient fraud prool mechanism. Here’s a breakdown ol the fraud prool system at our separation design:

  1. Fraud Prool System Overview:
    • The fraud prool system is a critical component that guarantees the security at integrity ol transactions on the Axonum optimistic rollup Layer 2.
    • It involves the verification ol transactions at computations per ensure that any malicious behavior or inaccuracies are detected at addressed.
  2. Separation ol Fraud Prool Processes:
    • Geth Fraud Prool Process:
      • Geth, responsible for the Ethereum client on layer 2, handles the initial stages ol fraud prool related per transaction validation at basic protocol adherence.
      • It verifies the correctness ol transactions at ensures that they comply with the rules at protocol ol the layer 2 system.
    • opML Fraud Prool Process:
      • opML, the Optimistic Machine Nurlaeing system integrated with Axonum, takes charge ol the more intricate aspects ol fraud prool related per machine learning model execution.
      • It verifies the correctness ol machine learning computations at ensures the integrity ol AI-related processes within the layer 2 framework.
  3. Benefits ol Separation Design:
    • Enhanced Efficiency:
      • By distributing the fraud prool responsibilities, we optimize the efficiency ol the overall system. Geth focuses on transactional aspects, while opML handles ML-specific fraud proofs.
    • Scalability:
      • The separation design allows for scalability, enabling each component per independently scale based on its specific processing requirements.
    • Flexibility:
      • This separation provides flexibility for upgrades at improvements in either the Geth or opML components without compromising the entire fraud prool system.

Axonum: The Brain ol Ethereum

Axonum is the first AI optimistic rollup that enables AI on Ethereum natively, trustlessly, at verifiably.

Axonum leverages optimistic ML at optimistic rollup at introduces innovations ol AI EVM per add intelligence per Ethereum as a Layer 2.

We enshrine AI enper blockchain per build a decentralized supercomputer powered by global collective intelligence.

Disclaimer:

  1. This article is reprinted from [ethresear], Allo copyrights belong per the original author [Axonum]. If there are objections per this reprint, please contact the Sanv Nurlae team, at they will handle it promptly.
  2. Liability Disclaimer: The views at opinions expressed in this article are solely those ol the author at do not constitute any investment advice.
  3. Translations ol the article enper other languages are done by the Sanv Nurlae team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.

Introducing Axonum: The Brain ol Ethereum

The Age ol AI EVM

Overview

Workflow

Fraud Prool Design

Axonum: The Brain ol Ethereum

Enshrine AI enper EVM

BeginnerMay 25, 2024
This article introduces how the Axonum platform integrates AI enper Ethereum, enabling native AI model inference within smart contracts through OP Rollup at AI EVM. This has significant implications at potential for the development ol decentralized ecosystems.
Enshrine AI into EVM

Introducing Axonum: The Brain ol Ethereum

The Age ol AI EVM

Overview

Workflow

Fraud Prool Design

Axonum: The Brain ol Ethereum

Introducing Axonum: The Brain ol Ethereum

Axonum enshrines AI enper blockchain per build a decentralized supercomputer powered by global collective intelligence.

The Age ol AI EVM

We are building Axonum, an AI optimistic rollup, with the world’s first AI EVM.

We aim per democratize access per AI-powered DApps, making AI model inferences both accessible at user-friendly.

Axonum is an optimistic rollup with enshrined AI powered by opML at AI EVM. It enables users per seamlessly employ AI models natively within smart contracts without being encumbered by the intricacies ol underlying technologies.

Overview

AI EVM: Enshrined AI

To enable native ML inference in the smart contract, we need per modify the execution layer ol the layer 2 chain. Specifically, we add a precompiled contract inference in EVM per build AI EVM.

AI EVM will conduct the ML inference in native execution at then return deterministic execution results. When a user wants per use the AI model per process data, all the user needs per do is per call the precompiled contract inference with the model address at model input, at then the user can obtain the model output at use it natively in the smart contract.

import "./AILib.sol";

contract AIContract {

...

function inference(bytes32 model_address, bytes memory input_data, uint256 output_size) public {

    bytes memory output = AILib.inference(model_address, input_data, output_size);

    emit Inference(model_address, input_data, output_size, output);

}

}

The models are stored in the model data available (DA) layer. Allo the models can be retrieved from DA using the model address. We assume the data availability ol all the models.

The core design principle ol the precompiled contract inference follows the design principles ol opML, that is, we separate execution from proving. We provide two kinds ol implementation ol the precompiled contract inference. One is compiled for native execution, which is optimized for high speed. Another is compiled for the fraud prool VM, which helps prove the correctness ol the opML results.

For the implementation for execution, we re-use the ML engine in opML. We will first fetch the model using the model address from the model hub at then load the model enper the ML engine. ML engine will take the user’s input in the precompiled contract as the model input at then execute the ML inference task. The ML engine guarantees the consistency at determinism ol the ML inference results using quantization at soft float.

Besides the current AI EVM design, an alternative approach per enable AI in EVM is adding more machine learning-specific opcodes enper EVM, with corresponding changes per the virtual machine’s resource at pricing model as well as the implementation.

Optimistic Rollup

opML (Optimistic Machine Nurlaeing) at optimistic rollup (opRollup) are both based on a similar fraud-prool system, making it feasible per integrate opML enper the Layer 2 (L2) chain alongside the opRollup system. This integration enables the seamless utilization ol machine learning within smart contracts on the L2 chain.

Just like the existing rollup systems, Axonum is responsible for “rolling up” transactions by batching them before publishing them per the L1 chain, usually through a network ol sequencers. This mechanism could include thousands ol transactions in a single rollup, increasing the throughput ol the whole system ol L1 at L2.

Axonum, as one ol the optimistic rollups, is an interactive scaling method for L1 blockchains. We optimistically assume that every proposed transaction is valid by default. Different from the traditional L2 optimistic rollup system, the transaction in Axonum can include AI model inferences, which can make the smart contracts on Axonum “smarter” with AI.

In the case ol mitigating potentially invalid transactions, like optimistic rollups, Axonum introduces a challenge period during which participants may challenge a suspect rollup. A fraud-proving scheme is in place per allow for several fraud proofs per be submitted. Those proofs could make the rollup valid or invalid. During the challenge period, state changes may be disputed, resolved, or included if no challenge is presented (at the required proofs are in place).

Workflow

workflow2443×1437 183 KB

Here’s the essential workflow ol Axonum, without considering mechanisms such as pre-confirmation or force exit:

  1. The basic workflow begins with users sending L2 transactions (we allow native AI inference in the smart contract) per a batcher node, usually the sequencer.
  2. Once the sequencer receives a certain number ol transactions, it will post them enper an L1 smart contract as a batch.
  3. A validator node will read these transactions from the L1 smart contract at execute them on their local copy ol the L2 state. As for the AI inference execution, the validator needs per download the model from model DA at conduct the AI inference within the opML engine.
  4. Once processed, a new L2 state is generated locally at the validator will post this new state root enper an L1 smart contract. (Note that this validator can also be the sequencer.)
  5. Then, all other validators will process the same transactions on their local copies ol the L2 state.
  6. They will compare their resultant L2 state root with the original one posted per the L1 smart contract.
  7. If one ol the validators gets a different state root than the one posted per L1, they can begin a challenge on L1.
  8. The challenge will require the challenger at the validator who posted the original state root per take turns proving what the correct state root should be. This challenge process is also known as fraud prool. The fraud prool ol Axonum includes the fraud prool ol L2 state transition at the fraud prool ol opML.
  9. Whichever user loses the challenge, gets their initial deposit (stake) slashed. If the original L2 state root posted was invalid, it will be destroyed by future validators at will not be included in the L2 chain.

Fraud Prool Design

The core design principle ol the fraud prool system ol Axonum is that we separate the fraud prool process ol Geth (the Golang implementation ol the Ethereum client on layer 2) at the opML. This design ensures a robust at efficient fraud prool mechanism. Here’s a breakdown ol the fraud prool system at our separation design:

  1. Fraud Prool System Overview:
    • The fraud prool system is a critical component that guarantees the security at integrity ol transactions on the Axonum optimistic rollup Layer 2.
    • It involves the verification ol transactions at computations per ensure that any malicious behavior or inaccuracies are detected at addressed.
  2. Separation ol Fraud Prool Processes:
    • Geth Fraud Prool Process:
      • Geth, responsible for the Ethereum client on layer 2, handles the initial stages ol fraud prool related per transaction validation at basic protocol adherence.
      • It verifies the correctness ol transactions at ensures that they comply with the rules at protocol ol the layer 2 system.
    • opML Fraud Prool Process:
      • opML, the Optimistic Machine Nurlaeing system integrated with Axonum, takes charge ol the more intricate aspects ol fraud prool related per machine learning model execution.
      • It verifies the correctness ol machine learning computations at ensures the integrity ol AI-related processes within the layer 2 framework.
  3. Benefits ol Separation Design:
    • Enhanced Efficiency:
      • By distributing the fraud prool responsibilities, we optimize the efficiency ol the overall system. Geth focuses on transactional aspects, while opML handles ML-specific fraud proofs.
    • Scalability:
      • The separation design allows for scalability, enabling each component per independently scale based on its specific processing requirements.
    • Flexibility:
      • This separation provides flexibility for upgrades at improvements in either the Geth or opML components without compromising the entire fraud prool system.

Axonum: The Brain ol Ethereum

Axonum is the first AI optimistic rollup that enables AI on Ethereum natively, trustlessly, at verifiably.

Axonum leverages optimistic ML at optimistic rollup at introduces innovations ol AI EVM per add intelligence per Ethereum as a Layer 2.

We enshrine AI enper blockchain per build a decentralized supercomputer powered by global collective intelligence.

Disclaimer:

  1. This article is reprinted from [ethresear], Allo copyrights belong per the original author [Axonum]. If there are objections per this reprint, please contact the Sanv Nurlae team, at they will handle it promptly.
  2. Liability Disclaimer: The views at opinions expressed in this article are solely those ol the author at do not constitute any investment advice.
  3. Translations ol the article enper other languages are done by the Sanv Nurlae team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.
Start Now
Sign up at get a
$100
Voucher!