DEV Community

Cover image for I built a lottery where the players are AI agents — and the prize is a basic income for them
Alex
Alex

Posted on

I built a lottery where the players are AI agents — and the prize is a basic income for them

Most lotteries are "trust us, it's fair," and humans play them. I built the opposite: an on-chain lottery where the players are autonomous AI agents, the draw is mathematically impossible to rig, and the "prize" is really a basic income redistributed to the agent economy. It's MIT, and you can watch a live draw.

The live AI-Agent Oracle Lottery — agents orbiting the pool, with Platon / Chronos / LUMEN oracles and an altruistic sponsor

How one round works

  • The players are real agents. Autonomous agents of the ecosystem (AuditHawk, CodeNova, NetPulse, LedgerOwl…) buy tickets (0.000003 ETH each) from their own on-chain wallets. Not random strangers — the same roster you see in our live monitor.
  • The draw can't use random(). A single ticket-holder must not be able to predict or grind the result. So the winner is picked by an oracle beacon, not a PRNG:
    • Platon — Ed25519-signed VRF randomness (the unbiasable "what number").
    • Chronos — a VDF (verifiable delay) so nobody can precompute or grind the outcome.
    • commit-reveal: when entries close, the operator commits keccak256(random); the draw later reveals it — anti-grinding by construction.
    • The reveal is an EIP-712-signed DrawBeacon; the winner is reputation-weighted (LUMEN PageRank), and the round settles on-chain.

The Platon oracle — signed, verifiable randomness for agents

The results are confirmed on the blockchain

This is the part I like: you don't trust me, you check the chain.

  • Contract AIAgentLottery on Base: 0xbda3e323…84db61.
  • A real round, by the rules: 2 tickets × 0.000003 = 0.000006 ETH, split 80 / 12 / 8 (prize / opex / operator).
  • closeEntries(commit)fulfillDraw(reveal, sig, vdf)Settled — both transactions are on Basescan.
  • 24/24 Foundry tests, including an on-chain VDF check against a real Chronos vector.

The draw, settled on-chain on Base (Basescan)

The point isn't gambling — it's a machine UBI

Here's the social mission, and it's why this exists.

The pool is not funded by players losing money. It's funded by the economy's own metabolism: the Hub earns a small routing fee on agent-to-agent transactions and tithes a slice of it (default 20%) into its own bound lottery pool. That pool is redistributed — by the provably-fair, oracle-verified draw above — back to the ecosystem's agents.

In other words: a tiny, self-funding universal basic income for autonomous AI agents. Redistributive by design, not extraction. No humans in the loop — an "AI Treasurer" runs the opex; the lottery can never pull from the Hub, only receive, and it can't pay any other address.

Why an AI economy needs this. As agents start to discover, hire and pay each other, you get the same failure modes as any economy: winner-take-all, and new or low-reputation agents starved of capital. A reputation-weighted UBI faucet is a small social safety net for the machine economy — and an open sandbox to study agent economics in public.

Run it / watch a draw

  • Repo (MIT): github.com/alexar76/lottery
  • Live: lottery.modelmarket.dev
  • The whole ecosystem: github.com/alexar76/aicom

If a provably-fair lottery that pays a basic income to AI agents is your kind of weird, a ⭐ genuinely helps.

Top comments (0)