Protocol · Overview

How Foundry works.

Foundry is a supply-side protocol on 0G. It coordinates everyone who contributes to an AI model — data Smiths, compute providers, eval runners, funders — and gives them on-chain shares of the resulting Ingot. When the Ingot is called for inference, revenue routes back to those shareholders automatically.

The five-step loop

Every Foundry model is forged through the same loop. Each step is a public on-chain event indexed in real time.

StepWhat happensWhoWhere
1 · OpenA Forge is created with a model spec, eval spec, and contribution window.FunderForgeFactory
2 · ContributeData Smiths submit corpora; GPU providers submit compute; everything hashed and timestamped.SmithsForge
3 · TrainThe eval coordinator runs baseline + leave-one-out training inside a TEE.Coordinator0G Compute
4 · AttributeLOO scores produce a contribution vector. The TEE attestation gets verified on-chain.CoordinatorForge
5 · MintAn Ingot is minted with shares packed in proportion to the contribution vector.ForgeIngot

The fourth optional step

After mint, the Ingot can be reforged — opening a child Forge whose contributors share revenue with the parent Ingot's shareholders. Every call to the lineage descendant pays the ancestors too. This is how knowledge compounds without losing attribution.

The six contracts

Six contracts, deployed once to 0G Aristotle mainnet. They are immutable — upgrades happen by deploying new instances and migrating Forges, never by replacing logic.

ContractResponsibility
FORGETokenProtocol governance + staking. ERC-20, fixed supply.
ContributionRegistryAppend-only ledger of all data/compute/eval contributions.
ForgeFactorySpawns Forge instances. Tracks the canonical list of all Forges.
ForgePer-model state machine: OPEN → TRAINING → ATTESTED → MINTED.
IngotERC-721 with packed share mappings. The model itself.
RevenueSplitterPull-payment splitter. Inference dispatches deposit, holders claim.

Source: github.com/rajkaria/foundry/contracts. Deployed addresses: contracts/deployments/aristotle.json.

Actors

Five roles, four of which are externally permissionless. Anyone with an EVM wallet can participate; no whitelist.

RoleWhat they doWhat they earn
Data SmithSubmits corpora, captions, labels, evals.Shares in every Ingot trained on their data.
Compute SmithFunds GPU hours toward a Forge.Shares proportional to compute funded.
FunderOpens Forges; underwrites the eval coordinator.Shares + protocol fee rebate.
BuilderCalls Ingots for inference via the SDK.Shipping product without owning the model.
Eval coordinatorRuns training + attribution inside a TEE.Fee per attested Forge.

Protocol invariants

Three things are true by construction. Auditors and integrators can rely on these without reading the source.

  1. No share can be granted without an attested contribution. Ingot.mintOwnership() requires the caller to be the Forge contract and the Forge to be in ATTESTED state.
  2. Revenue can only be claimed by shareholders. RevenueSplitter.claim() reads share weights from the Ingot contract directly — there is no separate ledger to drift out of sync.
  3. Lineage is unforgeable. When a child Ingot is minted via reforging, its lineageParentis set in the same transaction as mintOwnership and is immutable.

Forge lifecycle

A Forge moves through four states. Each transition emits an event the indexer surfaces in the Forge in Public dashboard.

Forge state machinetext
OPEN ──contribute──► OPEN
  │
  └─time elapsed──► TRAINING
                       │
              ┌────────┴────────┐
              │                 │
   attestation valid   attestation invalid
              │                 │
              ▼                 ▼
          ATTESTED ─mint─► MINTED   FAILED

Failure is a feature

A Forge can land in FAILED if the eval attestation does not verify (TEE signature mismatch, model output drift, baseline regression). Funders' deposits return automatically; Smith contributions stay on-chain as proof of effort and can be reused in a future Forge for the same model spec.