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.
| Step | What happens | Who | Where |
|---|---|---|---|
| 1 · Open | A Forge is created with a model spec, eval spec, and contribution window. | Funder | ForgeFactory |
| 2 · Contribute | Data Smiths submit corpora; GPU providers submit compute; everything hashed and timestamped. | Smiths | Forge |
| 3 · Train | The eval coordinator runs baseline + leave-one-out training inside a TEE. | Coordinator | 0G Compute |
| 4 · Attribute | LOO scores produce a contribution vector. The TEE attestation gets verified on-chain. | Coordinator | Forge |
| 5 · Mint | An Ingot is minted with shares packed in proportion to the contribution vector. | Forge | Ingot |
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.
| Contract | Responsibility |
|---|---|
FORGEToken | Protocol governance + staking. ERC-20, fixed supply. |
ContributionRegistry | Append-only ledger of all data/compute/eval contributions. |
ForgeFactory | Spawns Forge instances. Tracks the canonical list of all Forges. |
Forge | Per-model state machine: OPEN → TRAINING → ATTESTED → MINTED. |
Ingot | ERC-721 with packed share mappings. The model itself. |
RevenueSplitter | Pull-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.
| Role | What they do | What they earn |
|---|---|---|
| Data Smith | Submits corpora, captions, labels, evals. | Shares in every Ingot trained on their data. |
| Compute Smith | Funds GPU hours toward a Forge. | Shares proportional to compute funded. |
| Funder | Opens Forges; underwrites the eval coordinator. | Shares + protocol fee rebate. |
| Builder | Calls Ingots for inference via the SDK. | Shipping product without owning the model. |
| Eval coordinator | Runs 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.
- No share can be granted without an attested contribution.
Ingot.mintOwnership()requires the caller to be the Forge contract and the Forge to be inATTESTEDstate. - 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. - Lineage is unforgeable. When a child Ingot is minted via reforging, its
lineageParentis set in the same transaction asmintOwnershipand is immutable.
Forge lifecycle
A Forge moves through four states. Each transition emits an event the indexer surfaces in the Forge in Public dashboard.
OPEN ──contribute──► OPEN
│
└─time elapsed──► TRAINING
│
┌────────┴────────┐
│ │
attestation valid attestation invalid
│ │
▼ ▼
ATTESTED ─mint─► MINTED FAILEDFailure 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.