A multi-chain NFC payment terminal that processes cryptocurrency payments across 5 blockchain networks with real-time transaction monitoring and comprehensive history tracking.
- Ethereum
- Base
- Arbitrum
- Optimism
- Polygon
Rather than negotiate a chain / token combo with the merchant, the payment terminal handles it automatically. First it figures out a chain the merchant supports that you also have funds on, then sends a transaction with ETH or an ERC-20 token with this priority:
L2 Stablecoin > L2 Other > L2 ETH > L1 Stablecoin > L1 Other > L1 ETH
-
Install dependencies:
npm install
-
Environment setup:
echo "ALCHEMY_API_KEY=your_alchemy_api_key_here" > .env
-
Run the terminal:
npm start
-
Open the interface: Navigate to
http://localhost:3000
src/
├── server.ts # Express server & WebSocket handler
├── app.ts # Main application orchestrator
├── web/index.html # Payment terminal UI
├── config/index.ts # Multi-chain configuration
└── services/
├── nfcService.ts # NFC reader & wallet scanning
├── alchemyService.ts # Multi-chain balance & monitoring
├── paymentService.ts # Payment selection & EIP-681 generation
├── ethereumService.ts # Address validation utilities
└── addressProcessor.ts # Duplicate processing prevention
scripts/
└── rpi-deploy/
├── setup-build-environment.sh # Install dependencies to allow building a Raspberry Pi image
└── build-pi-image-osx.sh # Build a Raspberry Pi image
- Enter amount using the keypad (cents-based: "150" = $1.50)
- Tap "Charge" to initiate payment
- Customer taps NFC device to send payment
- Real-time monitoring confirms transaction
- "Approved" message with block explorer link
- Tap the 📜 history button on the keypad
- View all transactions or scan a wallet for specific history
- Tap "📱 Scan Wallet for History" and have customer tap their device
- Browse filtered transactions for that specific wallet
- NFC Detection → Customer taps device
- Multi-Chain Fetching → Portfolio analysis across all 6 chains
- Smart Selection → Optimal payment token based on priority system
- EIP-681 Generation → Payment request with chain ID
- Real-Time Monitoring → WebSocket/polling for transaction confirmation
- History Logging → Transaction stored with full metadata
- WebSocket monitoring for Ethereum, Base, Arbitrum, Optimism, Polygon
- Polling-based monitoring fallback
- Automatic timeout after 5 minutes
- Block explorer integration for transaction verification
- Status tracking: detected → confirmed → failed
This NFC payment terminal can be deployed as a plug-and-play kiosk on Raspberry Pi hardware for production use.
- Raspberry Pi 4B (4GB+ RAM recommended)
- 7" Official Raspberry Pi Touchscreen
- ACR1252U-M1 NFC Reader (specifically supported)
- 32GB+ MicroSD card
- One-command build creates bootable SD card image
- Pre-configured WiFi and API credentials
- Automatic startup with fullscreen kiosk mode
- Safety validation prevents deployment with test addresses
- macOS and Linux build support
# Navigate to deployment scripts
cd scripts/rpi-deploy
# Configure your deployment
cp build-config.env.template build-config.env
# Edit build-config.env with your WiFi, API key, and merchant address
# Build bootable image (macOS)
./build-pi-image-osx.sh
# Flash the generated nfc-terminal-<date>.img.gz file to SD card using Raspberry Pi Imager and boot!