Skip to content

kcolbchain/erc721-ai

Repository files navigation

erc721-ai

CI

Token standard for tokenized fine-tuned AI model weights — ownership, provenance, and tradability

kcolbchain — open-source blockchain tools and research since 2015.

Status

Early development. Looking for contributors! See open issues for ways to help.

Quick Start

Prerequisites

Solidity Contracts

git clone https://github.com/kcolbchain/erc721-ai.git
cd erc721-ai

# Install dependencies
forge install

# Build contracts
forge build

# Run Solidity tests
forge test

If you don't have Foundry installed:

curl -L https://foundry.paradigm.xyz | bash
foundryup

TypeScript SDK

cd sdk/typescript

# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

On Windows PowerShell, use npm.cmd if script execution policy blocks the npm.ps1 shim:

cd sdk\typescript
npm.cmd install
npm.cmd test
npm.cmd run build

Verification Notes

The TypeScript SDK quickstart was verified on Windows PowerShell with Node v24.16.0 and npm v11.13.0:

  • cd sdk\typescript
  • npm.cmd install
  • npm.cmd test (24 tests passed)
  • npm.cmd run build

The Solidity commands above require Foundry's forge to be installed and available on PATH. On Windows, Foundry's installer should be run from Git Bash or WSL; after forge --version succeeds, run forge install, forge build, and forge test from the repository root.

Contributing

See CONTRIBUTING.md for how to get started. Issues tagged good-first-issue are great entry points.

Draft Specification

The v0 draft of the ERC-721 AI standard is in docs/spec-erc721-ai.md. It defines the metadata schema (model id, weights CID, artifact hash, base-model provenance, license, inference endpoint, royalty), the required interface, and the ERC-2981 + attestation-hook integration.

Reference Implementation

  • contracts/ERC721AI.sol — minimal, dependency-free reference that implements the full ERC-721 AI surface (mintModel, modelAsset, setInferenceEndpoint, setAttestationKind, royaltyInfo) plus the ERC-721 subset needed for it to render in standard wallets.
  • test/ERC721AI.t.sol — Foundry tests covering mint, provenance chain lookup, royalties, endpoint mutation, attestation kind mutation, transfer semantics, and revert paths.

Production deployments SHOULD substitute an audited ERC-721 base (OpenZeppelin) and inherit ERC721AI behavior — this reference optimizes for clarity, not bytecode size.

Attestation Hook (ZK / TEE)

This repo also includes a pluggable contract-level attestation hook for verifiable training claims:

  • contracts/interfaces/ITrainingAttestationVerifier.sol
  • contracts/mocks/MockTrainingAttestationVerifier.sol
  • contracts/ERC721AIAttestationHook.sol

Design and integration details are documented in docs/attestation-hook.md.

TypeScript SDK

A viem-based TypeScript SDK for the standard lives in sdk/typescript/ — it wraps ERC721AI, ERC721AIx402Metering, and ERC721AIAttestationHook behind three modules (model, metering, attestation) so consumers can mint a tokenized model, set an inference price, pay per call, and withdraw revenue in roughly five lines of code. See sdk/typescript/README.md for the quickstart.

Links

License

MIT


Founded by Abhishek Krishna • GitHub: @abhicris

About

ERC-721 AI — token standard for tokenized fine-tuned model weights. Ownership, provenance, and tradability for AI models.

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors