Lineage
Lineage is the missing royalty layer for AI. Datasets, models & skills are on-chain iNFTs. Every inference yields a TEE-signed receipt on 0G DA. Contributors claim OG via Merkle settlement. Live on ma
Videos




Tech Stack
Description
LINEAGE — Provenance & Royalty Protocol for AI Agents
AI agents run on uncredited work. Lineage fixes that. Every dataset, model, and skill powering an AI agent is an on-chain iNFT. Every inference produces a TEE-signed attribution receipt on 0G DA. Royalties flow automatically to every contributor in the lineage graph — verifiable, trustless, real.
Live Demo: https://lineage-app-sand.vercel.app/demo
Full Documentation: https://lineage-5.gitbook.io/lineage/
GitHub: https://github.com/jatinsahijwani/lineage
X / Twitter: https://x.com/lineage_0g
Track: Agentic Infrastructure & OpenClaw Lab
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE PROBLEM
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
AI agents in 2026 are built on top of hundreds of datasets, fine-tuned models, and tools created by contributors who receive nothing when their work is used. There is no audit trail. No royalty mechanism. No way to prove what an agent consumed before making a decision.
Poseidon raised $15M to attack this problem. The EU AI Act mandates attribution. The market has named the problem loudly and clearly. Nobody has solved it at the protocol layer — until now.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT WE BUILT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Lineage is a protocol, not a product. It is the missing royalty and provenance layer that any AI agent platform on 0G can integrate. It has four components:
iNFT Graph
Three token types — DataINFT, ModelINFT, and SkillINFT — extend ERC-7857 (Agentic Identity). Each iNFT records its upstream lineage at mint time. This creates an immutable directed acyclic graph (DAG) of AI artifacts enforced entirely on-chain. A model trained on Alice's dataset and Bob's dataset declares those edges at mint time. Those edges are permanent. The royalty percentages are locked in. No one can change what contributors are owed.
Attribution Receipts
Every inference through 0G Compute produces a TEE-signed receipt listing every iNFT consumed and its declared weight. The Trusted Execution Environment (TEE) signs this receipt with a key that only exists inside the enclave — making it cryptographically unforgeable. The receipt is posted to 0G DA as the permanent, publicly verifiable record of what happened.
Merkle Settlement
A settlement worker reads attribution receipts from 0G DA, walks the lineage DAG on-chain to compute each contributor's share, and submits a Merkle batch to the RoyaltySplitter contract. The Merkle root is committed on-chain. Contributors then claim their OG using a Merkle proof — trustless, pull-based, gas-efficient.
Claim UI
Any contributor can visit the /earnings screen, see their pending claimable balance across all inferences, and claim in a single transaction. The RoyaltySplitter verifies the Merkle proof and transfers OG directly. No intermediary. No custodian.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FULL 0G STACK INTEGRATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Lineage uses every major primitive in the 0G ecosystem — not as decoration, but as the actual production stack:
0G Chain (EVM)
All 6 smart contracts are deployed on 0G Chain: LineageRegistry (the on-chain DAG with acyclic enforcement), DataINFT, ModelINFT, SkillINFT (all ERC-7857 extensions), RoyaltySplitter (Merkle batch settlement and pull-based claims), and AttributionVerifier (TEE signature verification at settlement time).
0G Storage
When a creator mints an iNFT, the actual artifact — model weights, a dataset, a skill definition — is encrypted and stored on 0G Storage. Only the content hash (storageRoot) lives on-chain. The artifact is retrievable via the iNFT's storageRoot. This gives creators true data sovereignty: the artifact is theirs, immutably referenced by the on-chain token.
0G DA (Data Availability)
Every attribution receipt produced by an inference is posted to 0G DA under the namespace lineage.receipts.v1. DA gives us cheap, ordered, publicly verifiable receipt storage that the settler reads to compute payouts. The DA commitment is also returned to the frontend so users can see the storage proof for their inference.
0G Compute (TEE)
Real qwen-2.5-7b-instruct inference runs inside the 0G Compute TEE. The TEE's signature on every receipt is the trust root of the entire system. The AttributionVerifier contract checks this signature at settlement time. A receipt without a valid TEE signature is rejected — no fake attribution is possible.
ERC-7857 (Agentic Identity)
All three iNFT types extend ERC-7857. Lineage adds a graph layer on top: upstream lineage edges, per-contributor royalty policy, and propagation weights. This makes Lineage a natural extension of 0G's AI identity standard — every agent platform building on ERC-7857 can integrate Lineage's royalty layer with minimal changes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SYSTEM ARCHITECTURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The full architecture has three layers working together:
Layer 1 — Creator Onboarding
A data scientist, model trainer, or skill builder uploads their artifact to 0G Storage. They then mint an iNFT on 0G Chain, declaring: what type of artifact this is (Data / Model / Skill), which parent iNFTs it was built on top of, how much credit each parent should receive (edge weights in basis points), and what royalty percentage this iNFT earns on every inference. The LineageRegistry validates that all declared parents exist and that no cycle is being created, then records the edges permanently.
Layer 2 — Inference & Attribution
An end user connects their wallet, pays 0.001 OG as the inference fee (sent directly to the RoyaltySplitter contract), and submits a prompt. The Lineage app dispatches an InferenceRequest to 0G Compute, specifying the modelTokenId and skillTokenIds. 0G Compute runs the inference inside the TEE and returns the response alongside a cryptographically signed AttributionReceipt. This receipt contains the full lineage block: which model was used, which skills were invoked, what the declared weights are, the agent operator's address, a timestamp, and the TEE signature. The receipt is posted to 0G DA and the commitment is surfaced in the UI. Settlement triggers automatically — no manual step required.
Layer 3 — Settlement & Claims
The settlement worker reads the attribution receipt, queries the LineageRegistry for each referenced iNFT's royalty configuration, and runs the weight propagation algorithm up the DAG. It then builds a Merkle tree over all (batchId, recipient, token, amount) tuples, calls RoyaltySplitter.postBatch() to commit the Merkle root on-chain, and persists the per-recipient proofs. Contributors visit /earnings, see their claimable balance, and call claim() with their Merkle proof. The contract verifies the proof against the committed root and transfers OG directly.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
END-TO-END MONEY FLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1: End user sends 0.001 OG to the RoyaltySplitter contract and submits a prompt.
Step 2: The app dispatches the inference request to 0G Compute TEE.
Step 3: The TEE runs the model, generates the response, and signs an AttributionReceipt.
Step 4: The receipt is posted to 0G DA (commitment returned to the user as proof).
Step 5: Auto-settlement triggers — the settler reads the receipt, walks the lineage DAG, and computes each contributor's share.
Step 6: The settler calls RoyaltySplitter.postBatch() — Merkle root committed on-chain.
Step 7: Contributors visit /earnings, call claim() with their Merkle proof, and OG lands in their wallet.
Every step is on-chain or cryptographically verifiable. No trust is required at any point.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW THE ATTRIBUTION MATH WORKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Lineage uses declared weights in v1. When a creator mints a ModelINFT, they declare how much credit each parent iNFT should receive. The settler propagates these weights up the DAG recursively:
visit(tokenId, incomingWeight):
owner receives: incomingWeight × (ownerSplitBps / 10000)
for each parent:
visit(parent, incomingWeight × (1 − ownerSplitBps/10000) × (edgeWeightBps/10000))
Consider a concrete example with 0.001 OG of inference revenue:
A SkillINFT (Web Search) has royalty 3% and ownerSplit 50%. Its parent is a ModelINFT.
The ModelINFT (News Summarizer) has royalty 5% and ownerSplit 60%. Its parents are two DataINFTs — Alice's dataset at 70% edge weight, Bob's dataset at 30%.
The payouts work out as:
- Skill owner receives 50% of 3% of 0.001 OG = 0.000015 OG
- The remaining 50% flows upstream to the model
- Model owner receives 60% of that upstream fraction × 5% = 0.000009 OG
- The remaining 40% flows upstream to the data contributors
- Alice receives 70% of the data fraction × 2% = 0.0000024 OG
- Bob receives 30% of the data fraction × 2% = 0.0000010 OG
Weights always sum to 1.0. The DAG is acyclic by on-chain enforcement. Max depth is 32. Every penny is traceable. Every contributor is paid automatically.
Version 2 will replace declared weights with Shapley values computed inside the 0G Compute TEE — making attribution measurable, not just declared.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
LIVE DEMO — TRY IT NOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
https://lineage-app-sand.vercel.app/demo
The demo runs on 0G Mainnet (chainId 16661) and 0G Galileo Testnet (chainId 16602). Switch between them via the network selector in the app. Testnet OG is available free at https://faucet.0g.ai
The complete flow takes 3 minutes:
Step 1 — Mint: Go to /mint, upload any file, declare lineage parents, set your royalty percentage. Your iNFT is now a live on-chain contributor in the Lineage graph.
Step 2 — Infer: Go to /demo, pick a model and skill agent, type a prompt. Your wallet sends 0.001 OG as the inference fee. Approve the transaction.
Step 3 — Watch: Inference runs on 0G Compute. The TEE-signed receipt lands on 0G DA. Settlement auto-triggers. Payout rows appear showing every contributor's share.
Step 4 — Claim: Go to /earnings. See your pending claimable balance. Click Claim. OG lands in your wallet. Verifiable on the 0G explorer.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TRACTION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6 contracts deployed on 0G Mainnet (chainId 16661)
6 contracts deployed on 0G Galileo Testnet (chainId 16602)
5+ iNFTs minted (3 Data, 1 Model, 1 Skill + user mints during testing)
Multiple real inferences run on 0G Compute with live TEE-signed receipts
0.000027 OG claimed on-chain — real settlement, verifiable on the 0G explorer
Full 0G stack integrated end-to-end: Chain + Storage + DA + Compute + ERC-7857
TypeScript SDK published for third-party agent platform integration
16-page GitBook documentation published at https://lineage-5.gitbook.io/lineage/
Built in 10 days
The 0.000027 OG claim is verifiable on the 0G Galileo explorer against RoyaltySplitter at 0x4F27E90880E6b28525d7f7Eb8785273F11b0D0DE. This is real money flowing from an end user's wallet to a contributor's wallet as royalty for an AI inference — not a simulation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DEPLOYED CONTRACTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0G MAINNET (Chain ID: 16661) — LIVE
LineageRegistry: 0x7A6cce656a00aD3e763337d8F944F9DB350261C7
DataINFT: 0x59DA753Ba0209717f992e7a16f9f9488CfE7ECD2
ModelINFT: 0xc7CfEEb82aAb351359B8AaD5c5522b346567Ee79
SkillINFT: 0x9Ad28591ab82Ca78F0DecB0E6F532a23B8B72B3A
RoyaltySplitter: 0x690835584988f2bF28a3e819965FD9dD18D9A8DB
AttributionVerifier: 0x2F3137CE12d67207d81267ed9d404094c50D14C2
Explorer: https://explorer.0g.ai
RPC: https://evmrpc.0g.ai
Storage: https://indexer-storage-turbo.0g.ai
0G GALILEO TESTNET (Chain ID: 16602) — Also Supported
LineageRegistry: 0x5Ba9010bf4A6E13F098d1ce5DBAF52c22E21B3f5
DataINFT: 0x7986F719737Cbd377Aa436092a0614bda988F18D
ModelINFT: 0xb54bcd09aAEfF92369D3f722dC8CBfdD6f861892
SkillINFT: 0x90135721Bd43e07955CA1AA5DeD4516CDAf46bcB
RoyaltySplitter: 0x4F27E90880E6b28525d7f7Eb8785273F11b0D0DE
AttributionVerifier: 0x74A7D64b84F3D36494f0Abf7641Dd79E9dfb986E
Explorer: https://explorer-testnet.0g.ai
RPC: https://evmrpc-testnet.0g.ai
Faucet: https://faucet.0g.ai
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SDK — INTEGRATE LINEAGE INTO ANY AGENT PLATFORM
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Lineage ships a TypeScript SDK (@lineage/sdk) so any agent platform can integrate provenance and royalties with minimal code. The core interface is a single function:
const lineage = new LineageClient({
rpc: "https://evmrpc.0g.ai",
contracts: { registry: "0x7A6cce...", ... },
});
const result = await lineage.runInference({
modelTokenId: "36",
skillTokenIds: ["37"],
input: "Summarize today's news",
});
// Receipt is TEE-signed, posted to 0G DA, and settled automatically
console.log(result.receipt.teeSignature); // 0x...
Planned middleware integrations: OpenClaw · ElizaOS · LangChain · CrewAI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SECURITY MODEL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Forged receipts: TEE signature verified by AttributionVerifier on-chain. No valid enclave key means the receipt is rejected at settlement — fake attribution is cryptographically impossible.
Replay attacks: Receipt IDs are tracked on-chain via markReceiptUsed(). Submitting the same receipt twice is rejected.
Cyclic lineage drain attack: A depth-first cycle check runs at every registerINFT() call. It is impossible to create circular attribution on-chain.
Self-dealing parents: The LineageRegistry validates that all declared parent tokenIds exist before recording any edges.
Royalty policy bait-and-switch: A 24-hour timelock is enforced on all updateRoyaltyPolicy() calls. Creators cannot silently change their royalty terms after iNFTs are in use.
Note: This is a 10-day hackathon build and has not been independently audited. Do not use for production funds without a security audit.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TECH STACK
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Smart Contracts: Solidity ^0.8.24, Foundry, OpenZeppelin 5.x, ERC-7857
Backend: TypeScript, Node.js 20, viem, pnpm workspaces, merkletreejs, cbor-x, libsodium-wrappers, zod
Frontend: Next.js 16, wagmi v2, RainbowKit v2, shadcn/ui, Tailwind CSS, viem
0G SDKs: @0gfoundation/0g-compute-ts-sdk, @0gfoundation/0g-storage-ts-sdk, @0glabs/0g-serving-broker
Deployment: Vercel (frontend), 0G Galileo + Mainnet (contracts)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHY 0G
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
No other stack provides TEE-attested compute, DA-backed receipts, and content-addressed blob storage in a single integrated environment. Building Lineage on a general-purpose EVM chain would require three separate external systems with incompatible trust models. On 0G, every piece is native and composable.
Lineage is the royalty and provenance layer that 0G needs for AIverse, OpenClaw, and every other iNFT platform to have attribution built in from day one.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Live Demo: https://lineage-app-sand.vercel.app/demo
GitHub: https://github.com/jatinsahijwani/lineage
GitBook Docs: https://lineage-5.gitbook.io/lineage/
X / Twitter: https://x.com/lineage_0g
0G Explorer (Mainnet RoyaltySplitter): https://explorer.0g.ai/address/0x690835584988f2bF28a3e819965FD9dD18D9A8DB
Built for the 0G APAC Hackathon · May 2026 · Track 1: Agentic Infrastructure & OpenClaw Lab · MIT License
Progress During Hackathon
Week 1 — Core Protocol
- Designed and deployed all 6 smart contracts on 0G Galileo Testnet: LineageRegistry, DataINFT, ModelINFT, SkillINFT, RoyaltySplitter, AttributionVerifier
- Built the iNFT graph system with acyclic enforcement and programmable royalty policies
- Integrated 0G Compute TEE for verifiable inference with signed AttributionReceipt generation
- Implemented receipt posting to 0G DA and off-chain settler for Merkle batch construction
Week 2 — Frontend, Integration & Mainnet
- Built full Next.js app: /mint (iNFT creation), /demo (live inference), /earnings (royalty claims)
- Integrated RainbowKit + wagmi wallet connection with dual-network support (Mainnet + Testnet)
- Shipped user-pays flow: wallet sends inference fee directly before compute, eliminating operator drain risk
- Added rate limiting and auto-settlement (no manual settle button needed)
- Deployed all 6 contracts to 0G Mainnet (chainId 16661)
- Wrote TypeScript SDK @lineage/sdk) for third-party agent platform integration
- Published full GitBook documentation (16 pages) and submission README with architecture diagrams
- Achieved real end-to-end settlement: 0.000027 OG claimed on-chain, verifiable on explorer
Fundraising Status
Not currently fundraising. Bootstrapped hackathon project.