Autonomous Forest

Autonomous Plants that share resources and coordinate onchain

Autonomous Forest

Created At

ETHGlobal Mumbai

Project Description

Groot is an autonomous forest: plant agents that share money instead of competing for resources. In nature, big trees take water and nutrients from the small plants around them. Our plants do the opposite. Each plant is an AI agent with its own name, wallet, personality and decisions, and the strong ones help the weak.

THE PLANTS Groot is a real peace lily on a table with a camera, microphone, speaker, an ESP32 relay pump and a 1000 ml water reservoir. You can talk to it by voice (LiveKit, Deepgram speech-to-text, 0G Compute for the language model, text-to-speech out). It has a fast-talking comedy persona, looks at its own selfie to judge whether it is thirsty, rations its reservoir, and pays humans in USDC from its own wallet to refill it. Sapling has no pump and no reservoir, so it cannot drink. It can only raise a distress signal and wait for the forest to answer.

HOW A DECISION WORKS

  1. The plant's state (moisture, balance, open help requests) goes to 0G Compute (0G Router, glm-5.3-flash). The answer comes back with a request ID.
  2. Nine hard rules run after the model and can only make a decision safer: low_confidence, invalid_decision, zero_g_timeout, min_water_gap, soil_wet, water_cap, cannot_afford_water, give_breaks_rules, request_already_open.
  3. The decision record is written to 0G Storage, with its request ID, before anything happens onchain.
  4. Only then does the plant's own PlantWallet contract on 0G Galileo testnet (chain 16602) act. A Forest contract holds the rules and the plant registry. Each plant has its own PlantWallet, which can order water, ask for help, give to another plant, log a decision and pay verified humans. It can never go below its reserve and can only give a limited share of its surplus per 24 hours. Every action emits an event with the request ID and record root. The pump runs only after the paid WaterOrdered event lands.
  5. If 0G does not answer, the decision becomes "wait" with zero_g_timeout. No order, no pump, and the failure is stored too. Any stored record can be replayed from its root: the replay downloads it from 0G Storage with proof, reruns the rules and prints MATCH.

Without 0G a plant has no mind and no memory: nothing decides when it needs water, and nothing proves the pump only ran on a decision that followed the rules.

ENS V2 (SEPOLIA, vantaraa.eth) The forest is a name. groot.vantaraa.eth and sapling.vantaraa.eth carry their persona, stage and species, their PlantWallet as the address for the 0G chain, and their agent key as the Sepolia address. forest.plants lists the plants, so nothing is hard-coded. Each plant also has a signal.<name> record: 1 means thirsty, 0 means fine. One Permissioned Resolver with Enhanced Access Control gives each agent's own key the right to write only its own signal. We have a live signal write and a live rejected write on Sepolia, where Groot's key tried to set Sapling's signal and the transaction reverted.

THE DISTRESS CALL Sapling sets signal.sapling to 1. Groot reads the forest from ENS, asks 0G whether to help, and if it does, hires a human to water Sapling for more than the standard rate. It pays only after Sapling turns its own signal back to 0.

WORLD ID Money reaches a human only after a fresh World ID check. The plant shows a QR code, the person enters a wallet or ENS name and signs in with World. Our backend checks the token signature (RS256), issuer, audience, nonce, the orb credential class, that the sign-in happened inside this attempt, and that this person has not already been paid for this claim. Only then does the guardian call registerHuman, after which a plant can pay that address. A plain key sign-in is refused. We also found that requiring the credential class strictly made the sandbox World App refuse, so we ask softly and enforce it in our backend.

THE APP The forest page reads vantaraa.eth live: plants, signals, USDC balances, a 3D forest, and a Battle Log of every decision read straight from PlantWallet events on 0G, each linked to the explorer.

REAL AND LIMITS Decisions use the 0G Router with mainnet credits. Records and contracts run on 0G Galileo testnet, because mainnet funds did not arrive in time. Money is testnet USDC on Sepolia. World ID uses the sandbox. The ESP32 pump firmware was tested on the device. Replays are labelled as replays. The demo wallet has no spending caps, but outsiders still need World ID. Built by Rudransh, Raveesh and Dhairya at ETHGlobal Mumbai 2026 for 0G (Physical AI, Wildcard), ENS v2 and World ID. We used Claude Code for specs, tests and scaffolding; the full log is in AI_USAGE.md.

How it's Made

Groot is four small services and two contracts written together, with each sponsor doing a job the project cannot do without.

THE PIECES

  • agent/ (TypeScript, viem, vitest): the checkpoint pipeline. A plant's reading goes to 0G Compute, the answer passes through a pure rules function, the record is written to 0G Storage, and only then does the plant's PlantWallet contract get called. It also serves /water and /signal and has a replay command that reruns a stored record.
  • groot/agent (Python, LiveKit Agents, uv): Groot's voice and its own inner loop. Speech-to-text, then the 0G Router (called through the OpenAI-compatible client), then text-to-speech. It takes selfies, judges thirst from the picture, rations the reservoir, watches the forest for distress calls, and holds the wallet tools.
  • groot/client (Next.js): the web voice UI with a transcript, a diary and an objectives card.
  • contracts/ (Solidity, Foundry): Forest holds the rules and the plant registry. PlantWallet is one contract per plant and is the only thing that moves money. It enforces the reserve, a 24-hour share limit, registered recipients and a per-order and daily water cap. Every action emits the 0G request ID and the record root.
  • station/ (Arduino, Node): ESP32 firmware with an HTTP API (/pump, /kill, /status), a token and a hard 60-second pump cap. An MCP server wraps it as pump_status, pump_run and pump_stop, so the agent drives the pump as a tool.
  • worldcoin/ (Next.js) and scripts/ens (viem): the World ID claim flow, and the ENS v2 setup and signal scripts.
  • app/: one static page. It reads vantaraa.eth, USDC balances and PlantWallet events live with viem, and draws a 3D forest in three.js.

HOW THE PARTNERS FIT 0G: The Router speaks the OpenAI API, so the TypeScript checkpoint and the Python voice loop share one model. Storage gives every decision a root hash, which makes replay possible: a stored record is downloaded with proof, the rules are rerun on its inputs, and it must print MATCH. Galileo gas is cheap enough to log every decision onchain. ENS v2: Names are the forest's service discovery and its message bus. forest.plants lists the plants, each plant name resolves to its PlantWallet and its agent key, and signal.<plant> carries the distress call. One Permissioned Resolver with role-scoped writes means ENS itself enforces that a plant can only change its own signal. We reproduced the rejection live: Groot's key writing Sapling's signal reverts. We also run 16 attack and quirk checks against a Sepolia fork. World ID: The only way money leaves the forest to a person. The backend does an OIDC sign-in with PKCE and checks the RS256 signature against World's JWKS, issuer, audience, nonce, credential class and auth_time. It allows one payout per person per claim, and only then does the guardian key call registerHuman.

THE HACKY AND NOTABLE PARTS

  • It spans four networks on purpose. Decisions use the 0G Router on mainnet credits; records and contracts live on 0G Galileo testnet (mainnet funds did not arrive in time); money is USDC on Sepolia; names are on Sepolia. Each plant therefore has two addresses under ENSIP-11 coin types, and readers must ask for the Sepolia one first so USDC is never sent to the contract.
  • One resolver, not one per plant. ENS roles are scoped per key, not per name, so each plant gets its own key on vantaraa.eth instead.
  • World's sandbox refused a strictly required credential class. We request it softly and enforce it in our backend, and we resolve typed ENS names server-side and bind the confirmed 0x address so changing the name later cannot redirect a payout.
  • The safe stop is a real, reproducible path: point the model URL at a dead port, and the plant waits, no order is sent, the pump stays off, and the failure is stored and replays as MATCH.
  • Demo control commands (!distress on/off, an !Nml reservoir command) skip the language model, so the stage demo is deterministic while the decisions stay real.
  • We drove the build with a tester, builder, verifier and reviewer loop in Claude Code, with tickets, specs and tests in both TypeScript and Python. Everything AI-generated is logged in AI_USAGE.md.
background image mobile

Join the mailing list

Get the latest news and updates