A Node.js CLI tool for managing Bitcoin wallets using BIP39 mnemonics and BlockCypher API.
- Create Wallet - Generate new Bitcoin addresses
- Import Wallet - Import wallets from BIP39 mnemonic phrases
- List Wallets - View all stored wallets
- Check Balance - Get wallet balance from blockchain
- Transaction History - Fetch wallet transactions
- Get Unused Address - Find addresses available for receiving funds
- Node.js (ES6 Modules)
- bitcore-lib (Bitcoin cryptography)
- bitcore-mnemonic (BIP39 support)
- axios (HTTP client)
- BlockCypher API (Bitcoin testnet)
git clone https://github.com/tanishchugh01/blockchain-wallets.git
cd blockchain-wallets
npm installCreate a .env file with your BlockCypher token:
BLOCK_CYPHER_TOKEN=your_token_here
Get a free token at blockcypher.com
npm startRuns a demo showing all features working with actual blockchain data.
src/
├── index.js # Main demo
├── api/ # 6 wallet features
│ ├── createWallet.js
│ ├── importWallet.js
│ ├── listAllWallets.js
│ ├── getWalletBalance.js
│ ├── getWalletTransactions.js
│ ├── getUnusedAddress.js
│ └── index.js
├── configs/ # Configuration
│ ├── blockCypher.js
│ └── CONSTANTS.js
└── methods/ # Utilities
├── deriveAddressFromMnemonic.js
├── getAddressBalance.js
├── getWalletInfo.js
├── loadWallets.js
└── saveWallets.js
- Validates mnemonic phrases using bitcore-mnemonic
- Derives addresses using BIP44 standard (m/0'/0/0)
- Supports 12, 15, 18, 21, and 24-word mnemonics
- Creates testnet addresses (prefix 'm' or 'n')
- Uses BlockCypher API for address generation
- Stores address metadata locally
- Wallets stored in
storage/wallets.json - Simple JSON persistence
- Auto-creates storage directory
- BlockCypher API for blockchain queries
- Bitcoin testnet endpoint:
https://api.blockcypher.com/v1/btc/test3 - Token-based authentication
- Mnemonic validation
- Wallet existence checks
- Graceful API error handling
========================================
Bitcoin Wallet Management System
========================================
3️⃣ Importing wallet from BIP39 mnemonic...
✅ Wallet Imported: TestMnemonic
Address: n28VbW7cyn2Bj9b7iCH6U34t58jzsiuEig
4️⃣ Listing all wallets...
✅ Total Wallets: 1
1. TestMnemonic (n28VbW7cyn2Bj9b7iCH6U34t58jzsiuEig)
5️⃣ Checking wallet balance...
Balance: 0 satoshi
6️⃣ Fetching wallet transactions...
Transactions of TestMnemonic:
Transaction 1:
Confirmations: 3574879
Value: 32443500 satoshi
Time: 29/10/2017, 12:35:24 am
7️⃣ Getting unused address...
Unused Address: n28VbW7cyn2Bj9b7iCH6U34t58jzsiuEig
========================================
All tests completed successfully!
========================================
| Endpoint | Method | Purpose |
|---|---|---|
/addrs |
POST | Create new address |
/wallets |
POST | Create wallet |
/addrs/{address}/balance |
GET | Get address balance |
/addrs/{address}/full |
GET | Get address transactions |
- ✅ Private keys never stored locally
- ✅ BlockCypher token in
.env(not committed) - ✅ Bitcoin testnet only (no real funds)
- ✅ Input validation on mnemonics