DeTrain

Turn your data into intelligence. Get paid for verifiable impact.

DeTrain

Created At

ETHGlobal Buenos Aires

Winner of

0G

0G - Building Onchain AI dapps with 0G intelligent L1 2nd place

Protocol Labs

Protocol Labs - AI & Autonomous Infrastructure

Project Description

DeTrain is a decentralized marketplace where AI labs post data bounties and users submit training data that’s evaluated inside a trusted execution environment. A zero-knowledge verifier confirms the data matches the task, the model is retrained privately, and contributors earn rewards only if their data measurably improves model accuracy. The system combines 0G Compute for verification, 0G Storage for decentralized data hosting, Oasis Sapphire for private smart contracts, and an Oasis ROFL agent that performs fair, tamper-proof evaluation. It’s a full Web3 pipeline that pays for actual model improvement rather than simple labeling.

How it's Made

DeTrain is built on a unique stack combining 0G Labs' decentralized AI infrastructure with Oasis Protocol's privacy-preserving compute layer. The frontend is a Next.js 14 app with RainbowKit for wallet connections, communicating with Solidity smart contracts deployed on Oasis Sapphire (privacy-preserving EVM).

The core innovation is our two-stage verification pipeline powered by partner technologies: First, when users submit data, we use HuggingFace's BLIP model to generate image captions, then 0G Compute's decentralized LLM inference network (via @0glabs/0g-serving-broker) verifies the content matches the bounty requirements—all happening serverlessly before storage. The verified data is then uploaded to 0G Storage using their TypeScript SDK, which creates a Merkle tree and returns a content-addressed root hash stored on-chain.

The AI evaluation magic happens in Oasis ROFL—a Trusted Execution Environment (TEE) that runs our Python agent (rofl_agent.py) inside an encrypted, tamper-proof container. This agent polls Oasis Sapphire for new submissions, downloads data from 0G Storage nodes via HTTP, evaluates uniqueness using scikit-learn models, and cryptographically signs evaluation results back to the smart contract. The TEE ensures the model evaluation is provably fair and can't be manipulated. One particularly hacky detail: we use a Unix socket (/run/rofl-appd.sock) to communicate with the ROFL runtime, bypassing traditional network calls entirely for maximum security. The entire flow—from image upload to reward payout—takes ~30 seconds, with 0G's high-speed storage making data retrieval near-instantaneous for the TEE agent.

background image mobile

Join the mailing list

Get the latest news and updates