You are building a fully decentralized peer-to-peer ridehailing mobile app. Zero centralized servers. The entire system runs on user devices and the Solana blockchain.
A rider opens the app, sets a destination, and the app calculates a fare client-side using Haversine distance. The rider posts a ride request on-chain containing a blinded zone ID (ZK proof of zone membership), the offered fare, and escrowed SOL. Nearby drivers discover the request via libp2p GossipSub and on-chain queries. Drivers submit offers on-chain — they can accept the rider's fare or counter-offer (capped at 2x the rider's price). The rider selects one driver. A single on-chain transaction atomically locks the match and rejects all others. The selected driver and rider establish a direct encrypted P2P channel via libp2p. All real-time communication (exact pickup, GPS, chat, ETA) flows over this channel. On completion, escrow releases to the driver.