Creating and managing cryptocurrency wallets is a foundational skill for blockchain developers. This guide explores a lightweight JavaScript tool that enables developers to generate secure Ethereum and Solana wallets using mnemonic phrases, while also offering real-time balance checking across both blockchains. Whether you're building decentralized applications (dApps) or testing wallet integrations, this open-source solution streamlines development workflows with minimal setup.
The project emphasizes simplicity, security, and interoperability—making it ideal for developers exploring multi-chain wallet creation, blockchain explorers, or educational tools in the Web3 space.
Key Features of the Wallet Generator Tool
This JavaScript-based utility provides essential functions for interacting with two of the most widely used blockchains: Ethereum and Solana. Below are its core capabilities:
Generate Mnemonic Phrases
Using industry-standard BIP39 protocols, the tool creates a 12-word mnemonic phrase—a human-readable seed that can regenerate a wallet’s private keys. This mnemonic serves as the foundation for deterministic wallet generation.
Create Ethereum Wallets
From the generated mnemonic, users can derive an Ethereum wallet including:
- Public address (starting with
0x) - Private key (used for signing transactions)
The wallet adheres to Ethereum’s cryptographic standards, ensuring compatibility with MetaMask, Etherscan, and other ecosystem tools.
Generate Solana Wallets
Similarly, the tool produces Solana-compatible keypairs using @solana/web3.js. The output includes:
- Base58-encoded public address
- Private key in Uint8Array format (securely exportable)
These wallets work seamlessly with Phantom and other Solana-native wallets.
Check Ethereum Balances
By connecting to Ethereum’s JSON-RPC interface via web3, the tool retrieves the ETH balance of any given address. This is useful for debugging, user verification, or integrating balance displays into dApps.
Retrieve Solana Balances
Using Solana’s public RPC endpoints, the script queries the current SOL balance of a wallet. It supports both mainnet and devnet environments, allowing flexible testing scenarios.
👉 Discover how blockchain tools power modern crypto development
Installation Guide
Getting started with this wallet generator requires only a few steps. Ensure you have Node.js installed (v16 or higher recommended).
Step 1: Clone the Repository
Begin by downloading the project from GitHub:
git clone https://github.com/GarunaJi/Web-3-Wallet.git
cd Web-3-WalletStep 2: Install Dependencies
Run the following command to install all required packages:
npm install bip39 ethereumjs-wallet @solana/web3.js web3These libraries provide critical functionality:
bip39: Mnemonic generation and validationethereumjs-wallet: Ethereum HD wallet derivation@solana/web3.js: Solana wallet creation and RPC interactionweb3: Ethereum node communication
Once dependencies are installed, you're ready to use the tool in your local environment or integrate it into larger projects.
Practical Usage Examples
Below are code snippets demonstrating how to use each feature effectively.
1. Generate a Mnemonic Phrase
const { generateMnemonic } = require('bip39');
const mnemonic = generateMnemonic();
console.log(`Mnemonic: ${mnemonic}`);This outputs a secure 12-word seed phrase. Store this securely—anyone with access can control associated wallets.
2. Derive an Ethereum Wallet
const { fromMnemonic } = require('ethereumjs-wallet');
const { hdkey } = require('ethereumjs-wallet');
const { toChecksumAddress } = require('ethereumjs-util');
const ethWallet = fromMnemonic(mnemonic);
console.log(`Ethereum Address: ${toChecksumAddress(ethWallet.getAddressString())}`);
console.log(`Ethereum Private Key: ${ethWallet.getPrivateKeyString()}`);The address is checksummed for safety, reducing errors during transactions.
3. Create a Solana Wallet
const { Keypair } = require('@solana/web3.js');
const { entropyToMnemonic, mnemonicToSeedSync } = require('bip39');
const { derivePath } = require('ed25519-hd-key');
const seed = mnemonicToSeedSync(mnemonic);
const derivedPath = derivePath("m/44'/501'/0'/0'", seed.toString('hex'));
const solanaKeypair = Keypair.fromSecretKey(Uint8Array.from(derivedPath.key));
console.log(`Solana Address: ${solanaKeypair.publicKey.toBase58()}`);
console.log(`Solana Private Key: [${solanaKeypair.secretKey}]`);Note: Solana uses Ed25519 cryptography, differing from Ethereum’s ECDSA.
4. Check Ethereum Balance
const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_KEY'); // Replace with your Infura or Alchemy key
async function getEthBalance(address) {
const balanceWei = await web3.eth.getBalance(address);
return web3.utils.fromWei(balanceWei, 'ether');
}
// Usage
getEthBalance('0x...').then(console.log); // Outputs balance in ETHYou’ll need an API key from Infura or Alchemy to interact with Ethereum’s mainnet.
5. Query Solana Balance
const { Connection, PublicKey } = require('@solana/web3.js');
const connection = new Connection('https://api.mainnet-beta.solana.com');
async function getSolanaBalance(publicKey) {
const balance = await connection.getBalance(new PublicKey(publicKey));
return balance / 1e9; // Convert lamports to SOL
}
// Usage
getSolanaBalance('your-solana-address').then(console.log); // Returns SOL balanceThis connects directly to Solana’s public RPC node—no authentication needed.
👉 Explore advanced blockchain development resources
Core Keywords for SEO Optimization
To enhance visibility and align with search intent, the following keywords are naturally integrated throughout this article:
- crypto wallet generator
- Ethereum wallet creation
- Solana wallet generator
- mnemonic phrase generator
- check ETH balance
- check SOL balance
- JavaScript blockchain tool
- Web3 wallet development
These terms reflect common queries from developers seeking practical tools for blockchain integration and testing.
Frequently Asked Questions (FAQ)
Q: Is it safe to generate wallets using this tool?
A: Yes—for development and learning purposes. However, never use mnemonics generated on unsecured or shared systems for storing real funds. Always ensure your environment is offline when handling private keys.
Q: Can I use this in a production dApp?
A: With modifications, yes. For production use, consider adding encryption, secure key storage (e.g., environment variables), and rate-limiting protections when querying balances.
Q: Do I need API keys for both blockchains?
A: Only for Ethereum. You’ll need an Infura or Alchemy API key to query ETH balances. Solana’s public RPC nodes are open-access, so no key is required.
Q: What happens if I lose my mnemonic phrase?
A: There is no recovery mechanism. The mnemonic is the sole backup for your wallet. Losing it means permanent loss of access to any associated funds.
Q: Can this tool support other blockchains like Binance Smart Chain or Polygon?
A: Not natively, but extending it is feasible. With additional libraries like web3.js or ethers.js, you can adapt the codebase to support EVM-compatible chains.
Q: Are private keys stored anywhere?
A: No. This tool generates keys in memory only. They are never saved to disk or transmitted over networks unless explicitly coded by the user.
👉 Start building secure blockchain applications today
Final Thoughts
This JavaScript-based crypto wallet generator bridges the gap between theoretical knowledge and hands-on practice in blockchain development. By supporting both Ethereum and Solana, it empowers developers to experiment with multi-chain architectures—an increasingly important skill in the evolving Web3 landscape.
Whether you're verifying address formats, testing transaction flows, or teaching others about wallet security, this tool offers a solid starting point. Combine it with secure coding practices and trusted infrastructure to build robust, scalable decentralized applications.
As blockchain ecosystems continue to grow, tools like this will play a crucial role in accelerating innovation—making complex processes accessible and understandable to developers worldwide.