Composable Pay-Per-Second Access Protocol for Real-World Infrastructure on Solana
CityPass is the first composable PayFi primitive for physical infrastructure on Solana — enabling pay-per-second access to parking, bikes, metro, coworking spaces, and EV chargers with trustless escrow and verifiable proof-of-usage.
Real-world infrastructure is sold per booking, even though usage is time-based:
- Pay $10 for 2-hour parking, use 45 minutes → Waste $6
- Flat $5 bike rental, use 20 minutes → Waste $3
- $15/day EV charging, charge for 1 hour → Waste $10
Urban mobility studies show 30-60 minutes of wasted payment per session.
Access should only exist while payment is actively flowing.
CityPass enforces per-second streaming payments with on-chain escrow:
- Funds locked only during active usage
- Payment stops when you pause/end trip
- Unused funds automatically refunded
- Immutable NFT receipt for proof-of-usage
- 200,000x cheaper than Ethereum ($0.0001 per trip)
- Zero Wallet Popups — Connect once, trip seamlessly
- Pay Only What You Use — Per-second billing (not flat fees)
- Instant Refunds — Unused funds returned automatically
- Proof of Usage — Soulbound NFT receipt (RWA primitive)
- Multi-Modal Routes — Combine parking + metro + bike in one trip
- Real-Time Earnings — Trustless settlement via escrow
- No Custody Risk — Funds controlled by program logic
- Reputation Scoring — On-chain trust metrics
- Easy Onboarding — Register via
register_access_point()
- Composable Primitive — Use CityPass in your DApp
- Bundle-Ready — Atomic composition with Jito
- Open Source — MIT licensed, full IDL access
- Complete SDK — TypeScript helpers for all instructions
- Node.js 18+
- Rust 1.70+
- Anchor CLI 0.29+
- Solana CLI 1.17+git clone https://github.com/0xsamalt/CityPass.git
cd CityPass# Install all workspaces
yarn install
# Or per service
cd contracts && yarn install
cd ../frontend && yarn install
cd ../backend && yarn installFrontend (.env.local):
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com
NEXT_PUBLIC_CLUSTER=devnet
NEXT_PUBLIC_PROGRAM_ID=57H7AfQdybT1Q3Btcf22wNfmYEq5ZhJZxduNEjZQ9Squ
NEXT_PUBLIC_SOLANA_WS_URL=wss://api.devnet.solana.comBackend (.env):
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
HELIUS_WEBHOOK_SECRET=your_helius_secret
PORT=3001
PROGRAM_ID=57H7AfQdybT1Q3Btcf22wNfmYEq5ZhJZxduNEjZQ9Squcd contracts
anchor build
anchor deploy --provider.cluster devnet
# Register demo access points
ts-node scripts/register-access-point.tscd frontend
npm run dev
# Open http://localhost:3000cd backend
npm run dev
# Listening on http://localhost:3001"Campus Commute" — Ahmedabad, Gujarat
- Downtown Parking (30 min @ 0.02 SOL/min)
- Metro Station A (15 min @ 0.02 SOL/min)
- CoWork Space (120 min @ 0.03 SOL/min)
Total Cost: 4.5 SOL (only for actual usage) Savings vs Flat Fee: ~35% ($7-10 per trip)
A typical 12-minute trip with 2 pauses = 4 transactions:
- Solana: $0.0001 total
- Ethereum: $20-200 (prohibitive for micro-payments)
- Arbitrum/Optimism: $0.40-2.00 (still too expensive)
- Agave (Rust) + Firedancer (C) = Two independent validator clients
- Physical gates can't be "down" due to blockchain issues
- Launched mainnet Dec 12, 2024 (production-ready)
Users expect instant feedback. When they tap "End Trip," settlement happens in 150-200ms.
Program Derived Addresses let us build escrow without centralized custody. Users' funds are controlled by program logic, not a multisig.
| Layer | Technology | Purpose |
|---|---|---|
| Blockchain | Solana (Devnet) | Layer 1 settlement |
| Smart Contract | Anchor 0.29 (Rust) | Program logic & PDAs |
| Frontend | Next.js 14 + TypeScript | Web interface |
| UI Library | Tailwind + shadcn/ui + Aceternity | Component system |
| Wallet | @solana/wallet-adapter | Multi-wallet support |
| RPC | Helius (Devnet) | Transaction broadcasting |
| Indexer | Helius Webhooks | Event listening |
| Backend | Node.js + Express | API & analytics |
| Database | Supabase (Postgres) | Trip history storage |
| NFT Standard | Metaplex Token Metadata | Soulbound receipts |
pub struct AccessPoint {
pub id: u64,
pub access_type: AccessType, // Parking | Bike | Metro | Cowork | Charger
pub price_per_minute: u64, // Lamports per minute
pub operator: Pubkey, // Payment recipient
pub reputation_score: u16, // Trust metric (0-100)
pub active: bool, // Availability status
pub total_earned: u64, // Cumulative earnings
pub bump: u8,
}pub struct Trip {
pub user: Pubkey,
pub access_points: Vec<u64>, // Active infrastructure
pub access_point_rates: Vec<AccessPointRate>, // Pricing info
pub start_ts: i64, // Unix timestamp
pub last_update_ts: i64, // Last settlement time
pub status: TripStatus, // Active | Paused | Completed
pub stall_threshold: i64, // Auto-pause safety (seconds)
pub total_rate_per_minute: u64, // Combined cost
pub bump: u8,
}pub struct PaymentVault {
pub trip: Pubkey, // Associated trip
pub deposited_amount: u64, // Initial escrow
pub spent_amount: u64, // Accumulated cost
pub bump: u8,
}// Deterministic per-second calculation
elapsed_seconds = current_timestamp - last_update_timestamp
cost_per_second = sum(access_points.price_per_minute) / 60
amount_to_settle = elapsed_seconds * cost_per_second
// Weighted distribution to operators
operator_share = (total_spent * operator_rate) / total_rateFunds cannot be released without an active trip Access cannot remain active if payment stops Operators only claim funds earned by time Users can pause/end safely Final usage produces immutable receipt Stalled trips auto-pause after threshold
- RouteCard — Visual selection of infrastructure paths
- TripTimer — Real-time countdown & cost accumulation
- PaymentVisualizer — Animated streaming effect (frontend only)
- ReceiptNFT — Display soulbound proof with metadata
- MapView — Interactive route visualization (Ahmedabad demo)
useWallet— Wallet adapter integrationuseTrip— Trip state management & RPC callsuseTripHistory— Fetch past trips from backend API
Fetch trip history for a wallet.
Response:
{
"trips": [
{
"tripPda": "...",
"user": "...",
"status": "Completed",
"startTime": 1703001234,
"totalPaid": 4500000,
"refund": 500000,
"accessPoints": [1, 3, 4],
"receiptNft": "..."
}
]
}Receives blockchain events from Helius.
Payload (TripStarted):
{
"type": "TripStarted",
"data": {
"trip": "...",
"user": "...",
"accessPoints": [1, 2],
"depositedAmount": 5000000,
"timestamp": 1703001234
}
}| ID | Name | Type | Price/Min | Location |
|---|---|---|---|---|
| 1 | Downtown Parking | Parking | 0.02 SOL | Prahladnagar |
| 2 | City Bike Station | Bike | 0.005 SOL | SG Highway |
| 3 | Metro Station A | Metro | 0.02 SOL | Thaltej |
| 4 | CoWork Space | Cowork | 0.03 SOL | Bodakdev |
| 5 | EV Charging Point | Charger | 0.015 SOL | Satellite |
┌──────────────┐
│ PayFi │ ← Sphere, Helio (streaming payments)
└──────┬───────┘
│
↓
┌──────────────┐
│ CITYPASS │ ← First physical infrastructure PayFi primitive
└──────┬───────┘
│
↓
┌──────────────┐
│ DePIN │ ← Helium model for mobility
└──────┬───────┘
│
↓
┌──────────────┐
│ RWA │ ← Receipt NFTs = Real-World Asset proof
└──────────────┘
- DePIN TVL: +340% YoY growth
- RWA on Solana: $24B+ TVL
- PayFi emergence: Jito bundles enable atomic settlements
- Physical infrastructure TAM: Multi-trillion dollar market (parking, mobility, energy)
- Core smart contract (6 instructions)
- Web frontend with wallet integration
- Backend indexer with Helius webhooks
- Demo routes (Ahmedabad campus mobility)
- Soulbound receipt NFTs
- Jito bundle integration for atomic operations
- Dialect notifications (real-time alerts)
- Metaplex compressed NFTs (scalable receipts)
- Dynamic pricing with Pyth oracles
- Operator dashboard & analytics
- Multi-city deployment (Mumbai, Bangalore, Delhi)
- Mobile app (React Native)
- Reputation system for users & operators
- SDK for third-party integrations
- Governance token (CPASS)
- Operator staking mechanisms
- Fee distribution to token holders
- Cross-chain bridges (Wormhole)
Solana University Hackathon 2025
- Developer: 0xsamalt
- Category: DePIN × PayFi × RWA
- Website: [Coming Soon]
- Demo Video: 3-minute walkthrough
- GitBook: docs.citypass.xyz
- Solana Foundation — For the incredible blockchain infrastructure
- Anchor Framework — For making Solana development accessible
- Helius — For reliable RPC & webhook infrastructure
- Metaplex — For NFT standard primitives
- shadcn/ui — For beautiful component library
Built on Solana
"Access should only exist while payment is actively flowing."

