Pay-per-use smart lockers powered by the x402 payment protocol and blockchain payments.
No apps. No accounts. No subscriptions. Just scan, pay, and unlock.
A proof-of-concept demonstrating autonomous IoT payments using Cronos's x402 protocol. Physical lockers that unlock when you pay with cryptocurrency—showcasing the future of machine-to-machine commerce and pay-per-use infrastructure.
Current shared infrastructure (gym lockers, storage units, bike locks) requires:
- Monthly subscriptions you don't fully use
- Complex account setups
- Mobile apps that track you
- Payment methods that exclude many users
Smart lockers that work like parking meters for the digital age:
- Scan QR code on the locker
- Pay with crypto (USDC on Base network)
- Locker unlocks automatically via HTTP 402 response
- Use for the time you paid - extend anytime
- Auto-locks when time expires
The x402 protocol activates HTTP's dormant 402 "Payment Required" status code:
GET /locker/3/unlock
← 402 Payment Required
{
"amount": "0.05 USDC",
"recipient": "0x...",
"duration": "1 hour"
}
[User pays via wallet]
POST /locker/3/unlock
Headers: X-Payment-Proof: 0x...
← 200 OK - Locker Unlocked
The locker becomes an autonomous economic agent—earning money and providing service without human intervention.
┌─────────────┐
│ Frontend │ React + Web3 wallet integration
│ (Scan QR) │
└──────┬──────┘
│
↓ HTTP Request
┌─────────────────┐
│ Facilitator │ Node.js payment verification
│ (402 Handler) │ Verifies blockchain transactions
└──────┬──────────┘
│
↓ WebSocket/Serial
┌─────────────────┐
│ ESP32/Arduino│ Controls servo/solenoid
│ (Physical Lock)│ Unlocks on verified payment
└─────────────────┘
│
↓ Smart Contract Events
┌─────────────────┐
│ Cronos Network │ USDC payments recorded on-chain
│ (Blockchain) │ Immutable payment history
└─────────────────┘
- Hardware: ESP32 + Servo motors + RFID
- Smart Contract: Solidity on Cronos (EVM)
- Backend: Node.js + Express + WebSocket
- Frontend: React + wagmi/viem for Web3
- Payment: USDC stablecoin (low fees, fast confirmation)
This architecture extends beyond lockers:
- 🚲 Bike/scooter sharing without apps
- ⚡ EV charging stations - pay per kWh
🅿️ Smart parking meters- 🔧 Tool libraries and makerspaces
- 📦 Package pickup lockers
- 🏢 Co-working space amenities
- 🎮 Arcade machines and entertainment
Anywhere you want pay-per-use without subscription overhead.
For Users:
- No subscription lock-in
- Pay only for what you use
- Instant access, no signup friction
- Privacy-preserving (no personal data collected)
For Operators:
- Automated revenue collection
- Lower operational overhead
- Global payment acceptance
- Transparent transaction history on-chain
For the Ecosystem:
- Enables machine-to-machine economy
- Micropayments become viable
- Physical world meets Web3
- Foundation for autonomous IoT infrastructure
[Video demo coming soon]
Live Demo Flow:
- User scans QR code → Web UI loads
- Connect crypto wallet (MetaMask/Coinbase Wallet)
- See locker price: 0.05 USDC per hour
- Approve payment → Transaction confirms in ~2 seconds
- Physical lock clicks open 🎉
- Timer starts counting down
- Option to extend rental or let it auto-lock
[Setup instructions coming soon]
This project demonstrates Coinbase's x402 open payment protocol - enabling direct, automated payments for digital content and APIs using stablecoins.
Learn more: x402 Protocol Documentation
Built for [Hackathon Name] by [Your Team Name]
MIT License - Build upon this freely!
The future of shared infrastructure is autonomous, permissionless, and pay-per-use.