vechain-mnemonic-to-keylist
v1.0.1
Published
A CLI tool that converts VeChain mnemonic phrases into JSON keylist files containing private keys and addresses. Perfect for development, testing, and CI/CD workflows.
Readme
VeChain Mnemonic to Keylist
A CLI tool that converts VeChain mnemonic phrases into JSON keylist files containing private keys and addresses. Perfect for development, testing, and CI/CD workflows.
Features
- 🔐 Secure: Read mnemonic from stdin to avoid exposing it in process lists
- 🚀 Fast: Generate multiple accounts from a single mnemonic
- 📦 Zero Config: Use with npx without installation
- 🔧 CI/CD Ready: Designed for automated workflows
- ⚡ VeChain Native: Built with official VeChain SDK
Installation
Global Installation
npm install -g vechain-mnemonic-to-keylistOne-time Use with npx (Recommended)
npx --yes vechain-mnemonic-to-keylistUsage
vechain-mnemonic-to-keylist <mnemonic|-> <outputFile> <accounts>Arguments
- mnemonic | -: The mnemonic phrase to convert. Use
-to read from stdin (recommended for security) - outputFile: Path to the JSON file to write the keylist into
- accounts: Number of accounts to generate
Examples
Secure Method (Recommended)
# Read mnemonic from environment variable
echo "$MNEMONIC" | vechain-mnemonic-to-keylist - keylist.json 10
# Read from file
cat mnemonic.txt | vechain-mnemonic-to-keylist - accounts.json 5
# Interactive input
vechain-mnemonic-to-keylist - wallets.json 3
# Then paste your mnemonic and press EnterDirect Method (Not Recommended for Production)
# WARNING: This exposes your mnemonic in the process list
vechain-mnemonic-to-keylist "word1 word2 word3 ..." keylist.json 10CI/CD Usage
# Auto-install latest version and generate keys
echo "$MNEMONIC" | npx --yes vechain-mnemonic-to-keylist - keylist.json 10Output Format
The tool generates a JSON file with the following structure:
[
{
"key": "a1b2c3d4e5f6...",
"address": "0x742d35Cc6634C0532925a3b8D497C2d5..."
},
{
"key": "f6e5d4c3b2a1...",
"address": "0x8497C2d5742d35Cc6634C0532925a3b8D..."
}
]Each object contains:
- key: The private key (hex string without 0x prefix)
- address: The corresponding VeChain address
Security Best Practices
✅ Recommended
- Use stdin input (
-) to avoid exposing mnemonics in process lists - Store mnemonics in environment variables or secure files
- Use in CI/CD with encrypted secrets
- Generate keys in isolated environments
❌ Not Recommended
- Passing mnemonics as command line arguments in production
- Storing mnemonics in plain text in your code
- Using on shared/public systems without proper cleanup
Mnemonic Format Support
The tool automatically detects and supports:
- Space-separated:
word1 word2 word3 ... - Comma-separated:
word1,word2,word3,...
Development
Prerequisites
- Node.js 16+
- npm or yarn
Setup
git clone <repository-url>
cd vechain-mnemonic-to-keylist
npm installTesting
# Test with a sample mnemonic
echo "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" | node index.js - test.json 3Dependencies
- @vechain/sdk-core: Official VeChain SDK for key derivation and address generation
Use Cases
- Development: Generate test accounts for local development
- Testing: Create consistent key sets for automated testing
- CI/CD: Generate deployment keys in automated pipelines
- Migration: Convert existing mnemonics to keylist format
Help
vechain-mnemonic-to-keylist --helpLicense
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
