yerofey / cryptowallet-cli

CW: a crypto wallet generator CLI tool for a lot of blockchains (Bitcoin, Ethereum, Solana, TON and many others)
https://www.npmjs.com/package/@yerofey/cryptowallet-cli
MIT License
104 stars 46 forks source link
bitcoin blockchain bnb btc cli crypto cryptocurrency cryptowallet cw erc20 ethereum litecoin phantom polygon solana ton tonkeeper trustwallet wallet

cryptowallet-cli GitHub stars

NPM package yearly downloads Minimum Node.js version NPM package version

Crypto wallet generator CLI tool

Screenshot

Features

check the Options section for all supported commands

Install

# via NPM
$ npm i -g @yerofey/cryptowallet-cli

# via PNPM
$ pnpm add -g @yerofey/cryptowallet-cli

# via Yarn
$ yarn global add @yerofey/cryptowallet-cli

Usage

# generate random EVM-compatible wallet (for Ethereum, Polygon, any L1/L2 EVM-compatible chain, etc.)
$ cw

# generate random BTC wallet (default format: bech32 - "bc1q...")
$ cw -c btc

# generate random mnemonic string (12 words) to import in any wallet app
$ cw -m

# generate random mnemonic string of a specific length (12, 15, 18, 21 or 24 words)
$ cw -m 12
$ cw -m 15
$ cw -m 18
$ cw -m 21
$ cw -m 24

# generate a wallet from a given mnemonic string
$ cw -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"

# generate N random wallets (default coin is ETH/ERC-like)
$ cw -n 10

# generate random ERC-like wallet with desired prefix
$ cw -p aaa

# generate random BTC wallet with desired prefix (case-insensitive)
$ cw -c BTC -p ABC

# generate random BTC wallet with desired prefix (case-sensitive)
$ cw -c BTC -P abc

# generate random BTC wallet with desired suffix (case-insensitive)
$ cw -c BTC -s ABC

# generate random BTC wallet with desired suffix (case-sensitive)
$ cw -c BTC -S abc

# generate BTC legacy wallet ("1...")
$ cw -c BTC -f legacy

# generate BTC segwit wallet ("3...")
$ cw -c BTC -f segwit

# generate BTC bech32 wallet from mnemonic string
$ cw -c BTC -f bech32 -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"

# generate N of BTC bech32 wallets from mnemonic string
$ cw -c BTC -f bech32 -n 10 -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"

# generate BTC Taproot wallet ("bc1p...")
$ cw -c BTC -f taproot

# generate ERC-like wallet from mnemonic string
$ cw -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"

# generate BNB (BEP2) wallet from mnemonic string
$ cw -c BNB -f BEP2 -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"

# generate BNB (BEP20) wallet from mnemonic string
$ cw -c BNB -f BEP20 -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"

# generate wallet and save the output into CSV file ("cw-output.csv" by default)
$ cw -c btc --csv

# generate few wallets and save the output into CSV file with custom name "new.csv"
$ cw -c btc -n 10 -D new

# list all supported blockchains
$ cw -l

don't use mnemonic from the examples, it's just an example, generate your own mnemonic string!

Blockchains & tickers supported

all other cryptos that are tokens in the ecosystems like Ethereum, Binance Smart Chain or Polygon and others chains are supported as well (L2/L3, etc.)

Options

Currently not necessary options:

Node.js supported versions

tested on Ubuntu 22.04 & Mac M1

TODO

Adding More Chains

We're always looking to support more blockchains! If you'd like to add support for a new chain, please follow these steps:

  1. Create a Chain JSON File: Create a new .json file in the src/chains directory. The name of the file should be the ticker symbol of the blockchain (e.g., SOL.json for Solana).

  2. Define the Chain Properties: Fill the JSON file with the necessary properties of the blockchain. Here's the structure you should follow:

{
    "title": "Readable Title of Blockchain",
    "network": "Network Type (EVM, Bitcoin-like, etc.)",
    "startsWith": "Starting Characters of Wallet Address",
    "prefixTest": "Regex Pattern to Test Valid Characters in Prefix",
    "apps": ["Array", "of", "Supported", "Wallet", "Apps"],
    "flags": ["Array", "of", "Supported", "Features", "like", "m", "n", "p", "s"]
}
  1. Add Formats (if applicable): If the blockchain supports multiple wallet formats (like Bitcoin with Legacy, SegWit, Bech32), you can define them under the formats key:
"formats": {
    "formatName": {
    "format": "formatName",
    "startsWith": "Starting Characters of Wallet Address",
    "prefixTest": "Regex Pattern to Test Valid Characters in Prefix",
    "rareSymbols": "Regex Pattern for Rarely Used Symbols",
    "path": "Derivation Path (if applicable)",
    "purpose": "BIP Purpose (if applicable)",
    "apps": ["Array", "of", "Supported", "Wallet", "Apps"],
    "flags": ["Array", "of", "Supported", "Features", "like", "m", "n", "p", "s"]
    }
    // ... other formats
}
  1. Submit a Pull Request: Once you've added the new chain file, please submit a pull request to the main repository. Make sure to provide a clear description of the blockchain and the properties you've set.

  2. Wait for Review: The maintainers will review your submission. They might ask for changes or additional information. Once everything is set, your contribution will be merged, and the new chain will be supported!

Your contributions are greatly appreciated and help make this tool more versatile and useful for everyone!

Chain JSON File Structure Explained

Each chain JSON file is structured to provide essential information about the blockchain and how the wallet addresses are generated and formatted. Here's a detailed explanation of each field:

By following this structure, the cryptowallet-cli tool can understand and support wallet generation for a wide array of blockchains.

Feel free to contribute by adding support for more chains, and help in making cryptowallet-cli a more comprehensive tool for the crypto community!

Contributing

Contributions are welcome! If you would like to contribute to this project, please follow these guidelines:

  1. Fork the repository and create a new branch.
  2. Make your changes and ensure that the code is properly formatted.
  3. Write tests to cover any new functionality.
  4. Submit a pull request with a clear description of your changes.

By contributing to this project, you agree to abide by the Code of Conduct.

Thank you for your interest in contributing!

Support the Project

If you find this tool useful and would like to support its development, consider making a donation. Your support is greatly appreciated and helps me dedicate more time to maintain and improve this project.

Donate Crypto:

Other Donate Options:

Thank you for your support!

Author

Yerofey S.

License

MIT