Skip to content

Timi16/multi-chain-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multi-chain-wallet

A TypeScript SDK for generating and managing HD wallets across EVM-compatible chains (Ethereum, Base, BSC, 0G) and Solana — built on BIP32/BIP39 standards with a unified IChainWallet interface.

Why this exists

Most wallet libraries are chain-specific. This SDK abstracts EVM and SVM (Solana Virtual Machine) under a single interface, so you can build multi-chain apps without juggling separate wallet packages per chain.

Features

  • BIP39 mnemonic generation & recovery
  • BIP32 Hierarchical Deterministic (HD) wallet derivation
  • EVM support — Ethereum, Base, BSC, 0G Network
  • SVM support — Solana
  • Cross-chain swap integration
  • Unified IChainWallet interface for consistent behavior across all chains
  • Secure key derivation — private keys never leave the client

Project Structure

├── utils/
│   ├── evm/            # EVM wallet implementation (Ethereum, Base, BSC, 0G)
│   ├── svm/            # Solana wallet implementation
│   ├── bip32Small.ts   # Optimized BIP32 key derivation
│   ├── bip32Old.ts     # Legacy BIP32 implementation
│   ├── walletBip32.ts  # Core HD wallet logic
│   └── types.ts        # Shared types & IChainWallet interface
├── package.json
└── tsconfig.json

Installation

npm install

Usage

import { WalletBip32 } from './utils/walletBip32';
import { EVMWallet } from './utils/evm';
import { SVMWallet } from './utils/svm';

// Generate a new HD wallet
const wallet = new WalletBip32();
const mnemonic = wallet.generateMnemonic(); // 12-word BIP39 seed phrase

// Create chain-specific wallets from the same seed
const evmWallet = new EVMWallet(mnemonic);
const svmWallet = new SVMWallet(mnemonic);

// Both implement IChainWallet — same interface, different chains
const ethAddress = await evmWallet.getAddress();   // 0x...
const solAddress = await svmWallet.getAddress();   // Base58...

// Sign a transaction
const signedTx = await evmWallet.signTransaction({ to: '0x...', value: '0.01' });

The IChainWallet Interface

All chain implementations follow a shared interface, making it easy to integrate into any multi-chain app:

interface IChainWallet {
  getAddress(): Promise<string>;
  signTransaction(tx: TransactionPayload): Promise<string>;
  getBalance(address: string): Promise<string>;
}

Supported Chains

Chain VM Network
Ethereum EVM Mainnet / Testnet
Base EVM Mainnet / Testnet
BNB Smart Chain EVM Mainnet / Testnet
0G Network EVM Testnet
Solana SVM Mainnet / Devnet

Build

npm run build

Security

  • Private keys are derived deterministically from the mnemonic — store your seed phrase securely
  • No keys are transmitted or stored externally
  • BIP32 child key derivation uses HMAC-SHA512

⚠️ Audit before production use. This SDK is intended as an integration layer for wallet-enabled apps.

License

MIT

About

A Multichain wallet for 0g,Base,Bsc,Solana and eth added swap so You can integarte To build wallet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors