A decentralized Ethereum wallet system that enables offline transaction signing and Bluetooth-based transaction broadcasting with a relayer service.
bluetooth-txns/
├── wallet/ # React Native mobile wallet app
│ ├── screens/ # App screens
│ │ ├── WalletSetupScreen.js
│ │ ├── HomeScreen.js
│ │ ├── SendScreen.js
│ │ └── ScanScreen.js
│ ├── utils/ # Utility functions
│ │ ├── db.js # SQLite database operations
│ │ └── verifyAck.js # Acknowledgement verification
│ ├── App.js # Main app component
│ ├── index.js # App entry point
│ └── package.json # Dependencies and scripts
└── relayer/ # Node.js relayer server
├── index.js # Express server with transaction relaying
└── package.json # Server dependencies
- Wallet Management: Create new wallets or import existing ones
- Offline Operation: Sign transactions completely offline
- QR Code Support: Send and receive transactions via QR codes
- Transaction History: View complete transaction history with balances
- Secure Storage: Private keys stored securely using Expo Secure Store
- Transaction Broadcasting: Relay signed transactions to Ethereum network
- Acknowledgement System: Provide signed transaction confirmations
- Balance Tracking: Track sender and receiver balances after transactions
- REST API: Simple HTTP endpoints for transaction processing
- React Native with Expo framework
- Ethers.js for Ethereum operations
- SQLite for local data storage
- React Navigation for screen management
- Expo Camera/Barcode Scanner for QR code handling
- Node.js with Express.js framework
- Ethers.js for Ethereum interactions
- CORS enabled for cross-origin requests
- Body-parser for request body parsing
- Node.js (v16 or higher)
- npm or yarn
- Expo CLI (
npm install -g expo-cli) - Ethereum RPC endpoint (Infura, Alchemy, or local node)
-
Navigate to the wallet directory:
cd wallet -
Install dependencies:
npm install
-
Start the development server:
npm start
-
Use Expo Go app on your mobile device to scan the QR code and run the app
-
Navigate to the relayer directory:
cd relayer -
Install dependencies:
npm install
-
Create a
.envfile with the following variables:RPC_URL=your_ethereum_rpc_url RELAYER_PRIVATE_KEY=your_relayer_wallet_private_key PORT=3000
-
Start the relayer server:
node index.js
- Open the mobile app
- Tap "Create New Wallet" to generate a new Ethereum wallet
- Securely save your private key (displayed on screen)
- Tap "Save and Continue" to proceed to the home screen
- From the home screen, tap "Send"
- Enter the recipient address and amount
- The app will generate a signed transaction (offline)
- A QR code containing the signed transaction will be displayed
- Use another device to scan the QR code and broadcast via the relayer
- From the home screen, tap "Scan to Receive"
- Scan a QR code containing a signed transaction
- The app will verify the transaction and store it locally
- The relayer will broadcast the transaction to the network
POST /relay
- Body:
{ "signedTx": "0x..." } - Response: Transaction acknowledgement with signature
GET /
- Health check endpoint returns "Relayer service is running!"
- Private keys never leave the device
- All transaction signing happens offline
- Relayer only broadcasts pre-signed transactions
- Acknowledgement signatures prevent tampering
- SQLite database encryption via Expo Secure Store
- Create new screen component in
wallet/screens/ - Add navigation route in
wallet/App.js - Update navigation imports as needed
- Add new endpoints to
relayer/index.js - Update environment variables as needed
- Test with Postman or curl commands
QR Code Scanning Not Working
- Ensure camera permissions are granted
- Check Expo Camera compatibility with your device
Relayer Connection Errors
- Verify RPC_URL in
.envis correct - Check relayer wallet has sufficient ETH for gas
Database Errors
- App may need to be restarted if database schema changes
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.