A peer-to-peer marketplace for verifiable AI inference: discover, settle, and reputation on-chain.
DeFacts is an open settlement protocol for verifiable AI inference. Buyers post inference queries to a peer-to-peer compute marketplace, providers bid with deterministic receipts, the lowest verified bid wins, and the trade settles on-chain — with the winning provider's reputation accruing in ENS records.
Three layers, each doing what it's best at. Discovery: providers and buyers find each other over Gensyn AXL's gossip mesh, with bids carrying signed Tier1 attestations over the receipt's hashes.
Settlement: trades settle on 0G Galileo (chain 16602) through an Escrow contract that releases funds only when the on-chain signature recovery matches the bound verifier.
Reputation: after settlement, the winning provider's ENS subname (e.g. l4.defacts.eth) gets defacts.last_trade_id, defacts.last_settlement_tx, defacts.last_attestation, and defacts.last_tier_settled written to it on Sepolia — building a permanent, queryable track record.
The receipts being settled and recorded aren't placeholders: they're EIP-712 typed structs (psec_version, model_commitment, input_hash, output_hash, tier) that any node can verify.
Our contribution: PSEC — the Portable Semantic Execution Contract — is the specification that makes those receipts comparable across heterogeneous hardware. Same inputs, same output hash, regardless of which GPU ran the inference. That's what lets a buyer route to the cheapest provider without sacrificing what they're paying for, and it's what makes the marketplace economically real instead of theoretical.
The stack runs end-to-end on testnets and is verifiable in one shell command (bash script/test-ens-integration.sh — 15 acceptance tests, all passing in the live demo).
PSEC (the receipt contract). The Portable Semantic Execution Contract is the math order specification that defines what makes any two inference outputs equivalent. It's expressed on-chain as an EIP-712 typed struct — Tier1Attestation(bytes32 psec_version, bytes32 model_commitment, bytes32 input_hash, bytes32 output_hash, uint8 tier) — and that typehash is the substrate everything else in the stack carries: AXL bids reference it, the Escrow contract recovers signatures over it, ENS records pin it. Every other component in the system is downstream of PSEC. Without a portable receipt contract, "verifiable inference" is a phrase, not a market.
PSEC verification, in full detail. The on-chain typehash is the lightweight version of the PSEC receipt — what AXL/Galileo/ENS need to coordinate. The full PSEC specification goes deeper: a deterministic CPU verifier (dsec-verify.c, single-file C, no SIMD, no fast-math) that re-runs the inference against the model's BF16 weights using a published accumulation descriptor (a 32-lane chunked FMA reduction order with butterfly warp reduction) and canonical lookup tables for rsqrt, exp, and RoPE. The verifier produces a bit-exact match with the on-chain receipt's output_hash. Verification takes ~20 min for 20 tokens on commodity CPU — slow, but anyone with the published artifacts can independently reproduce the receipt without trusting the prover, the GPU vendor, or any sandbox. The hackathon demo settles trades on the EIP-712 receipt; the C verifier is what makes the receipt enforceable as a math contract rather than just a signed claim.
Discovery layer (Gensyn AXL). Three AXL nodes — one buyer (user-runtime), two providers (cache-001 serving precomputed receipts, fresh-001 calling a prover-stub for fresh inference) — coordinate over gossipsub. The buyer broadcasts defacts.query, both providers bid with signed PSEC Tier1 attestations carrying their det_hash, the cheapest verified bid wins. Because both providers commit to PSEC-equivalent receipts, consensus is unanimous and the buyer can route to the cheapest one without sacrificing what they're paying for.
Settlement layer: the buyer calls openTrade(...) on an Escrow contract deployed at 0xF494...a641 on 0G Galileo (chain 16602), depositing tier1+tier2 amounts. After receiving the deliver, the buyer calls settleTier1(trade_id, signature); the contract recovers the verifier address and releases the tier1 portion. EIP-712 typed signatures, viem for RPC, all on-chain.
Reputation layer: after settlement, the user-runtime hits an ens-updater service that performs up to 8 sequential setText transactions on Sepolia — three on the parent defacts.eth (latest attestation, settlement tx, settlement timestamp) and five on the winning provider's subname (trade id, settlement tx URL pointing back to Galileo, tier settled, attestation, last active). Reputation isn't computed off-chain and posted later — it's the natural byproduct of every settled trade.
Receipt format: the EIP-712 Tier1Attestation typehash (bytes32 psec_version, bytes32 model_commitment, bytes32 input_hash, bytes32 output_hash, uint8 tier) is the on-chain contract for what an inference receipt means. It's the substrate AXL bids carry, the message the Escrow recovers signatures over, and the data ENS records reference.
Notable hacks: AXL's /recv is destructive (first poller wins), so each agent runs on its own AXL node peered through the buyer's node as the hub. The cache-agent's France fixture had to be regenerated against the prover-stub's stub-v1 hash function so cache and fresh bid the same det_hash — without that, consensus diverges and the marketplace doesn't pick a winner. Built with Foundry (Solidity contracts), Node.js + viem (agents and chain client), Express (stub services), and a lot of testnet ETH.

