Decentralized AI marketplace on Ethereum with on-chain revenue splits
VAULT is a decentralized AI model marketplace built on Ethereum Sepolia where model contributors can register encrypted AI models as ERC-721 NFTs, set per-inference pricing, and earn revenue through an on-chain enforced 70/25/5 split — 70% to contributors, 25% to compute nodes, 5% to protocol treasury. What makes it different:
Smart Contract (Solidity 0.8.20): VAULTMarketplace.sol is a self-contained ERC-721 contract with 9 functions: registerModel (mints ownership NFT), listForSale, buyModel (payable — ETH transfer + NFT transfer), addContributor (revenue share splitting with max 30% non-owner, max 50% per contributor), completeInference (70/25/5 revenue distribution on-chain), claimRevenue, registerNode, getModel (view), getContributors (view). Deployed on Sepolia at 0xD39921E53d7759E8c9B8d21aF07ba6Ba05AB6293. KeeperHub Integration: All contract reads route through KeeperHub's Direct Execution API (POST /api/execute/contract-call). We pass the full ABI explicitly since our contract is freshly deployed and not yet verified on Etherscan. The API returns real on-chain data for getModel() and getContributors(). Write operations (registerModel, buyModel, listForSale, addContributor, completeInference) route through the same API with correct payloads but return WALLET_NOT_CONFIGURED because we haven't set up the org wallet in KeeperHub's dashboard yet. We also integrate KeeperHub's MCP server at app.keeperhub.com/mcp for AI agent workflow discovery (search_workflows meta-tool) and execution (call_workflow meta-tool). x402 payments settle on Base USDC (contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, chain 8453) via EIP-3009 TransferWithAuthorization, using KeeperHub's Turnkey custodial agentic wallet with three-tier safety (auto/ask/block). ENS Resolution: Instead of relying on third-party APIs, we make direct RPC calls to the mainnet ENS registry (0x00000000000C2e074eC69A0dFb2997BA6C7d2e1e) to resolve names. We compute Keccak-256 namehash using pycryptodome's Crypto.Hash.keccak (critical: hashlib.sha3_256 is SHA-3, not Keccak-256, and produces different results). Forward resolution works for any registered mainnet name — verified with vitalik.eth → 0xd8da6bf26964af9d7eed9e03e53415d37aa96045. Reverse resolution and text records (description, url, avatar, github, telegram) are also implemented. Backend (FastAPI + Python): FastAPI backend with ONNX Runtime for 3 models (MNIST Classifier 96.5% accuracy, Sentiment Analyzer, Summarizer). Each inference returns TEE attestation hashes. The backend exposes 12 EVM endpoints for KeeperHub operations and ENS resolution, plus model discovery and x402 payment flow middleware. Frontend (Next.js 15): Dark brutalist UI with neon accents (indigo/violet/emerald). The Ethereum Dashboard (/evm) is the primary page — it shows contract deployment status, KeeperHub connection, ENS resolver, on-chain models fetched via KeeperHub Direct Execution API, and MetaMask connection with Phantom conflict handling (we search window.ethereum.providers[] for isMetaMask === true instead of using the overridden window.ethereum directly). Marketplace, inference, upload wizard, and creator dashboard pages complete the flow. Storage & Encryption: Models are encrypted with AES-256-GCM in the browser before upload. The key never touches any server. Encrypted files go to IPFS via Pinata. Only the CID hash lives on-chain.

