All projects

UrbanLeaf.ai

Decentralizing Urban City Planning and Governance Through AI & Blockchain.

CRE & AI World

What it is

The Problem -
Urban green spaces are disappearing at an accelerating rate. Government professionals and urban planners propose development projects malls, residential buildings, wellness centers on park land, often with little transparency and almost no meaningful community input. Residents near the affected park hear about it after the decision is already made, or not at all.
When communities do try to push back, the process is slow, analog, and easily manipulated: petitions get ignored, public meetings are poorly attended, and there's no reliable way to prove that the people voicing opinions actually live near the affected area making it trivial for bad actors to flood votes with fake identities.
At the same time, the environmental data that should inform these decisions satellite vegetation indices, air quality readings, population impact assessments exists in silos. Nobody is synthesizing it into something residents can understand and act on.
The result: parks are removed based on economic convenience alone, with no accountability to the community or the environment.

The Solution -
UrbanLeaf AI is an on-chain community governance platform where government professionals submit development proposals for park land, and residents near that park get a verifiable, Sybil-resistant voice in approving or rejecting them backed by AI-powered environmental impact analysis and enforced by smart contracts on Arbitrum Sepolia.

How It Works -

  1. A Government Professional Creates a Proposal
    Urban planners or government professionals submit proposals for development projects that would affect a park, a new residential building, shopping mall, wellness center, or similar project. The proposal is created on-chain and includes details about the park and the intended development.

  2. AI Analyzes the Park Removal Impact
    The moment a proposal is created, a Chainlink CRE HTTP-trigger workflow runs AI-powered environmental analysis answering the critical question: if this park is removed, how will it affect the surrounding area?

  3. Nearby Residents Are Notified and Vote
    When a proposal is created, residents living near that park receive an email notification informing them a development proposal has been submitted. They open the app, review the AI impact score, and cast their vote.

  4. Accepted Proposals Get Funded in USDC
    If a proposal passes the vote threshold, it becomes "Accepted" and fundraising opens. Residents donate USDC (Arbitrum Sepolia testnet) directly from MetaMask.

Parks don't have lobbyists. UrbanLeaf gives them something better: verifiable community consensus, backed by cryptographic proof.

How it Works

UrbanLeaf is a full-stack Web3 application with four distinct layers that work together.
Smart Contract - Arbitrum Sepolia - Github link
The core is a Solidity contract (UrbanLeafCommunity.sol) deployed on Arbitrum Sepolia. It stores proposals, votes, environmental scores, and USDC donations on-chain. Key mechanisms:

  • createProposal() — stores the proposal and emits a ProposalCreated event that CRE listens to
  • voteVerified() — records votes with a nullifierHash from World ID; the mapping usedNullifiers[proposalId][nullifier] prevents any human from voting twice on the same proposal
  • donateToProposal() — pulls USDC from the donor using IERC20.transferFrom() (no ETH, stable value only)
  • setEnvironmentalScore() — called by CRE after DON consensus, stores the AI score on-chain

Chainlink CRE - 4 Workflows, 3 Trigger Types -
This is the automation and trust layer. Built with CRE SDK v1.x:

  1. score-proposal (HTTP trigger) - Github Link
    When a proposal is created, the backend posts to this workflow. Each CRE node independently calls Gemini 2.0 Flash with satellite NDVI data and PM2.5 air quality readings, gets back a score (0–100) and urgency level, then consensusIdenticalAggregation ensures all nodes agree before anything is written on-chain via EVMClient.writeReport().

  2. evm-score-proposal (EVM Log trigger) - Github Link
    Watches for ProposalCreated events directly on-chain - no backend trigger needed. Decodes the ABI-encoded event data using viem's decodeAbiParameters, then runs the same Gemini scoring pipeline. This is the fully autonomous path.

  3. auto-close (Cron trigger - daily at midnight) - Github Link
    Fetches all active proposals, filters those past their end date, calls Gemini to write a 140-character community newsletter summary, then calls updateProposalStatus() on-chain. If the proposal is accepted and has a funding goal, sets fundingEnabled = true.

  4. verify-vote (HTTP trigger) - Github Link
    Each DON node independently calls the World ID v4 REST API (POST /api/v4/verify/{rp_id}) with the ZK proof. If all nodes get back success: true and an identical nullifier, the consensus passes and voteVerified() is called on-chain - bringing World ID to Arbitrum Sepolia without a native Semaphore verifier.

Backend - Two Services -
FastAPI (Python, port 4000)
The AI agent service. Uses Claude to power the proposal creation chat flow - the planner describes the project, the agent geolocates the park, gathers environmental context, and structures the proposal. Also serves NDVI/PM2.5 data to CRE workflows and sends SendGrid email notifications to nearby residents when a proposal drops.

Blockchain Service (Node.js/Express, port 5000)
The Web3 bridge. Holds the wallet private key and submits all owner-only transactions (scoring, closing proposals, verified votes). Exposes REST endpoints that both the frontend and CRE workflows call. Uses ethers.js v6.

Frontend — Next.js -
Built with Next.js App Router and TailwindCSS. Key integrations:

  • Mapbox GL — interactive map showing parks, their NDVI scores, and active proposals
  • MetaMask + ethers.js — USDC donations (approve → transferFrom), wallet connection, Arbitrum Sepolia network switching
  • World ID IDKit v4 — IDKitRequestWidget in controlled mode; fetches a signed rp_context from the backend before opening the modal, binding the ZK proof to a specific proposal and vote value so it can't be replayed elsewhere - Github Link
  • Supabase — stores park metadata, user profiles, and resident location data for notification targeting

Links

Created by

  • Vaibhav Vemula