ComretonAI Documentation

A comprehensive guide to the architecture, smart contracts, and core concepts of the ComretonAI protocol.

1. Introduction

ComretonAI is a decentralized AI execution and verification platform designed to run machine learning models with provable guarantees. By combining zero-knowledge proofs and the power of the Aptos blockchain, we create a trustless ecosystem where the integrity of every AI inference can be verified on-chain.

Our hybrid architecture separates on-chain trust logic from off-chain computation, ensuring that the platform is both highly secure and economically viable for real-world use.

2. Core Concepts

The entire lifecycle of an AI model on our platform is transparent and secured by the Aptos blockchain.

  1. Deploy & Package: A developer registers their AI model as a Verifiable Model Artifact (VMA).
  2. Audit & Stake: A decentralized network of auditors reviews the model and stakes APT to attest to its quality.
  3. Verify & List: Once a model reaches the required audit threshold, the contract automatically verifies it.
  4. Infer & Prove: A user pays a fee, a compute provider executes the model, generates a ZK-proof, and returns the result.
  5. Distribute & Earn: The contract verifies the proof and automatically distributes fees to all participants.

3. Smart Contract API

The core logic is managed by the comreton_ai::marketplace smart contract on the Aptos blockchain.

Entry Functions

These are the primary functions for interacting with the protocol.

public entry fun create_profile(user: &signer)
public entry fun run_inference(user: &signer, marketplace_addr: address, model_id: u64)
public entry fun register_model(creator: &signer, marketplace_addr: address, name: vector<u8>, ...)
public entry fun become_auditor(auditor: &signer, marketplace_addr: address, stake_amount: u64)
public entry fun audit_model(auditor: &signer, marketplace_addr: address, model_id: u64, approved: bool, ...)

View Functions

Read data from the contract without submitting a transaction.

public entry fun get_model(marketplace_addr: address, model_id: u64): Model
public entry fun get_all_models(marketplace_addr: address): vector<Model>
public entry fun get_user_profile(user_addr: address): (vector<u64>, u64, bool, u64)

4. Off-Chain Components

ComretonAI SDK

A command-line tool and library for easily packaging models, uploading them to IPFS, and calling the on-chain `register_model` function.

Decentralized Compute Executor

A lightweight service anyone can run to process inference jobs. It listens for on-chain events, executes models, generates proofs, and submits results.

5. Getting Started

Ready to deploy your first verifiable AI model? Follow these steps.

  1. Install Prerequisites: Ensure you have the Aptos CLI and a funded devnet account.
  2. Create Your Profile: Call the `create_profile` function to initialize your account on ComretonAI.
  3. Prepare Your Model: Package your model into one of the supported formats.
  4. Deploy via SDK: Use the `comretonai deploy` command. This handles uploading your model and registering it on-chain.
  5. Await Audits: Your model is now visible to auditors. Once verified, you'll start earning rewards from every inference.