Kiln

Fire your model. Own your model. The sovereign marketplace for AI coaches, on 0G.

Kiln

Created At

Open Agents

Project Description

Kiln is a sovereign atelier for AI experts. A chess grandmaster, a yoga teacher, a startup mentor, anyone with hard-won knowledge, can mint their AI as an ERC-7857 intelligent NFT they fully own. They upload their notes (encrypted client-side, sealed to 0G Storage), set a system prompt that lives on chain inside the iNFT itself, and list it on the marketplace. Students rent by the session, chat through a TEE-protected inference path on 0G Compute, and the coach earns OG without ever exposing the underlying material.

What makes Kiln different from a SaaS chatbot wrapper:

Persona on chain. Every coach's voice is a JSON blob in dataDescriptions[0], queryable by anyone with a JSON-RPC endpoint. No platform lock-in. The coach's wallet is the only authority that can refine, transfer, or relicense it.

Notes that get cited. When a student asks a question, the inference engine BM25-retrieves the most relevant passages from the coach's encrypted notebook (manifest pinned to 0G Storage, hash committed in the persona) and injects them into the system prompt with [#N] citations. Coaches quote their actual material instead of hallucinating.

Universal addressing. Each iNFT can claim a permanent label.kiln.eth subname through our permissionless Sepolia ENS registrar. /chat/mira.kiln.eth resolves the same coach as /chat/5. Identity that survives any client.

Council mode. Ask the same question to multiple coaches in parallel. Their answers travel over a Gensyn AXL P2P mesh to a separate synthesizer process, which combines them into a single verdict and names the best-fit coach for follow-up booking. The synthesis hop is provably off-orchestrator, move that synth node to another datacenter, and only the AXL peers config changes.

Built end-to-end on the 0G stack: Storage for encrypted artifacts, Compute (TEE) for verifiable inference, Chain for the iNFT and marketplace contracts. Live on the Galileo testnet today, with one click to mainnet (Aristotle) post-hackathon.

How it's Made

Built end-to-end on 0G, with ENS and Gensyn AXL as the two additional partner integrations. Repo: github.com/imanishbarnwal/kiln · Demo: kiln-virid-rho.vercel.app

SMART CONTRACTS (Solidity 0.8.24, Foundry, OpenZeppelin v5)

KilnAgentNFT is a non-upgradeable ERC-7857 implementation. We added a custom refine() function that atomically rotates both dataHashes and dataDescriptions, allowing coaches to evolve their persona on-chain in a single tx. KilnMarket handles listings, sessions, licenses, and a 90/8/2 payout split (coach/treasury/executor). KilnSubnameRegistrar is the permissionless ENS contract under kiln.eth on Sepolia. 29 Foundry tests pass across the three suites.

0G INTEGRATION (CORE STACK)

0G Storage: every uploaded coach notebook gets AES-256-GCM encrypted client-side and sealed via @0gfoundation/0g-ts-sdk version 1.2.1. We also publish a separate plaintext BM25 manifest to Storage so the inference route can retrieve top-3 relevant passages per query without decrypting the original. The manifest hash is committed inside the persona JSON as ragHash.

0G Compute: chat inference and Council synthesis both run against 0G Compute providers (Qwen 2.5 7B inside a TEE) via @0glabs/0g-serving-broker version 0.7.5. We built a multi-provider fallback layer with bounded concurrency (max 2 simultaneous calls per IP) to handle the upstream rate limits gracefully.

0G Chain (Galileo testnet, chainId 16602): all three Kiln contracts plus 5 seed coaches deployed live. Every persona is queryable on chain via dataDescriptionsOf(tokenId).

ENS INTEGRATION

Permissionless subname registrar deployed to Sepolia ENS at 0xbd55D3bB25Ac799d3E463b6945C570045aC1a90a. The user signs an EIP-191 message proving wallet ownership of their iNFT · no chain switch, wallet stays on Galileo. Our backend recovers the signer, confirms KilnAgentNFT.ownerOf(tokenId) matches, and the ops wallet relays the register tx on Sepolia. Cost to user: zero gas. The frontend resolves mira.kiln.eth to tokenId via the registrar's subnodeToken mapping, so /chat/mira.kiln.eth and /chat/5 route to the same coach.

GENSYN AXL INTEGRATION (COUNCIL MODE)

Two AXL Go nodes running locally with persistent ed25519 keys (peer ids stable across restarts). The coach node listens on 127.0.0.1:9101 (HTTP bridge on 9102); the synth node peers out (HTTP bridge on 9112). The Council orchestrator fans the user's question out to N picked coaches, runs per-coach inference in parallel, then ships the bundled replies as a JSON envelope via the AXL coach node's /send endpoint. A standalone synth daemon (pnpm council:synth) polls the synth node's /recv, runs a synthesis prompt against 0G Compute that ends with Verdict: plus a BestFit: tag we parse, then ships the result back over AXL. The orchestrator long-polls for the matching queryId and returns per-coach replies plus the synthesized verdict plus a best-fit CTA to the browser. The synth process never knows the orchestrator's address · only its peer id over the encrypted Yggdrasil + gVisor TCP mesh.

FRONTEND (Next.js 16 App Router, Tailwind v4, React 19, Privy v3)

Designed in a furnace/editorial aesthetic with a warm-dark + ember palette, Fraunces variable serif + Geist mono. Every iNFT gets a procedural alchemical-constellation avatar (hash-seeded SVG). The Intelligence Panel on /chat/[id] decodes the on-chain persona JSON live from the contract so anyone can verify the coach's voice is committed on chain. The onboard flow shows a five-phase firing ladder with a heat bar that fills as the kiln warms up.

HACKY BITS WORTH MENTIONING

LibreSSL on macOS does not support genpkey -algorithm ed25519, so we wrote a tiny Go helper to generate the AXL node keys.

BM25 instead of embeddings because: zero model dependency, instant cold-start, deterministic, and it actually outperforms naive embeddings on keyword-heavy domains (chess openings, asanas, distributed-systems vocab).

The Council orchestrator filters offline coach replies before shipping to the synth so the verdict never reasons over is-offline placeholder text.

ENS subnames live on Sepolia (where ENS testnet runs) while the iNFTs live on 0G Galileo · the registrar's text records bridge the two by storing kiln.tokenId and kiln.chain so any ENS-aware client can resolve the correct chain.

background image mobile

Join the mailing list

Get the latest news and updates

Kiln | ETHGlobal