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.