# ERC-7007: Verifiable AI-Generated Content Token

**ERC-7007** is an extension of the ERC-721 non-fungible token (NFT) standard, specifically designed to accommodate verifiable AI-generated content on the Ethereum blockchain.

It can be paired with the [**Initial Model Offering (IMO)**](https://app.gitbook.com/o/rWlGmOlOvnmpt08RvxKm/s/llyHj70MVMOxu2WT7tZv/~/changes/263/initial-model-offering-imo/imo-introduction) in order to create inference assets that benefit model token holders.

## **What is ERC-7007?**

**ERC-7007** is a token standard that enables the creation and management of NFTs representing AI-generated content. It introduces a set of interfaces and events that allow for:

* **Verification of AI-Generated Content**: Ensures that the content associated with an NFT is generated from a specific AI model using a given input (prompt).
* **Integration with zkML and opML**: Supports Zero-Knowledge Machine Learning (zkML) and [Optimistic Machine Learning (opML)](https://docs.ora.io/doc/the-ora-network/fraud-proof-virtual-machine-fpvm-and-frameworks/opml) to verify the correctness of outputs.
* **Unique Token Identification**: Assigns token IDs based on the prompt, ensuring that each NFT is uniquely associated with its input and output.

## **Why is ERC-7007 Important?**

As AI-generated content becomes more prevalent, there is a need for a standardized way to represent and verify this content on the blockchain. ERC-7007 addresses several challenges:

* **Verification of Authenticity**: Allows users to verify that the AI-generated content is produced by a specific model with a specific input.
* **Support for AI Model Authors and Content Creators**: Provides a way for creators to monetize their AI models and content without risking open-source devaluation.
* **Enabling Revenue-Sharing Mechanisms**: Facilitates fair compensation for AI model authors and content creators through secure and verifiable NFTs.

## **How ERC-7007 Works**

### **Core Components**

1. **AI Model**: A pre-trained machine learning model that generates output based on a given input (prompt).
2. **zkML / opML**:
   * **zkML (Zero-Knowledge Machine Learning)**: Uses zero-knowledge proofs to verify that the content was generated correctly without revealing the model's details.
   * **opML (Optimistic Machine Learning)**: Uses fraud-proofs where correctness is ensured through a challenge period and and onchain dispute resolution.

* **AIGC-NFT smart contract:** An onchain contract compliant with ERC-7007, with full ERC-721 functionalities
* **Verifier smart contract:** implements a verify function. When given an inference task and its corresponding ZK proof or opML finalization, it returns the verification result as a boolean.

### **Workflow Overview**

#### **zkML Scenario**

1. **Model Publication**: The AI model and its zero-knowledge proof verifier are published on Ethereum.
2. **Inference Task**: A user submits an input (prompt) and initiates an inference task.
3. **Proof Generation**: Nodes maintaining the model generate the output and a zero-knowledge proof of the inference.
4. **Verification**: The proof is verified on-chain using the verifier contract.
5. **Minting NFT**: The user owns the NFT representing the AI-generated content, secured by the proof.

#### **opML Scenario**

1. **Model Publication**: The AI model is published on Ethereum using the ORA network.
2. **Inference Task**: A user submits an input (prompt) and initiates an inference task.
3. **Result Submission**: Nodes perform the inference and submit the output.
4. **Challenge Period**: Other nodes can challenge the result within a predefined period.
5. **Finalization**: After the challenge period, if unchallenged or successfully defended, the user can verify ownership and update the AIGC data as needed.

### **Metadata Schema**

ERC-7007 introduces a standardized JSON schema for NFT metadata, including:

* **name**: Identifies the asset.
* **description**: Describes the asset.
* **image**: URI pointing to an image representing the asset.
* **prompt**: The input used to generate the AI content.
* **aigc\_type**: Type of AI-generated content (image, video, audio, etc.).
* **aigc\_data**: URI pointing to the AI-generated content.
* **proof\_type**: Indicates whether it's a validity proof (zkML) or fraud proof (opML).

## **Examples**

#### **Use Case: AI Art NFTs**

An artist uses an AI model to generate artwork based on user-specified prompts:

1. **Model Deployment**: The artist deploys the AI model on Ethereum using the [ORA Network](https://docs.ora.io/doc/the-ora-network/ai-oracle-network).
2. **Content Generation**: Users submit prompts during the minting process to generate unique artworks.
3. **Verification**: Each piece is verified to confirm it was generated by the specific AI model using the provided prompt.
4. **NFT Minting**: The verified art is minted as an ERC-7007 NFT, ensuring authenticity and uniqueness. Proceeds from the mint flow back to the artist.

#### **Use Case: AI-Generated Music**

A musician tokenizes an AI model using an [Initial Model Offering (IMO) ](https://app.gitbook.com/o/rWlGmOlOvnmpt08RvxKm/s/llyHj70MVMOxu2WT7tZv/~/changes/263/initial-model-offering-imo/imo-introduction)that generates music tracks:

1. **Model Publication**: The AI music model is tokenized using the IMO process.
2. **User Interaction**: Fans submit prompts or themes to generate personalized music tracks.
3. **Verification and Minting**: Tracks are verified and minted as NFTs using ERC-7007 and ORA’s AI Oracle.
4. **Ownership and Royalties**: The musician can implement royalty mechanisms for each NFT sale. Additionally, the use of the IMO allows token holders to receive a corresponding portion of the mint fees.

## **Additional Resources**

* **ERC-7007 Proposal**: [Ethereum Improvement Proposal](https://eips.ethereum.org/EIPS/eip-7007)
* **Related Concepts**:
  * [**ERC-7641: Intrinsic RevShare Token**](https://app.gitbook.com/u/Z3VKpy8i7wdZauNqfuegTEtsgK12)
  * [**Initial Model Offering (IMO)**](https://app.gitbook.com/o/rWlGmOlOvnmpt08RvxKm/s/llyHj70MVMOxu2WT7tZv/~/changes/263/initial-model-offering-imo/imo-introduction)
