btc-minikeytools
v1.0.2
Published
BTC-MiniKeyTools is a robust tool for working with Bitcoin Mini private keys. It provides validation, key generation, and conversion functionalities, including HEX and Wallet Import Format (WIF) keys. Fully equipped with CLI support and logging options, i
Downloads
9
Maintainers
Readme
BTC-MiniKeyTools
BTC-MiniKeyTools is a robust tool for working with Bitcoin Mini private keys. It provides validation, key generation, and conversion functionalities, including HEX and Wallet Import Format (WIF) keys. Fully equipped with CLI support and logging options, it's designed for Bitcoin developers and enthusiasts alike.
Table of Contents
Features
Validation of Bitcoin Mini private keys Ensures the MiniKey follows the proper format. Example:
S6c56bnXQiBjk9mqSYE7ykVQ7NzrRyConversion to HEX private keys Converts a valid MiniKey to its 64-character HEX representation. Example:
0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1DConversion to Wallet Import Format (WIF) Generates WIF keys for mainnet and testnet, supporting compressed and uncompressed keys. Example:
5HueCGU8rMjxEXxiPuD5BDu3qa8N1P2Sr2jXZbNmi4xzFqJMPtjKey Generation Randomly generates valid 30-character MiniKeys. Example:
S1LgfDWujrsGfSbvGfTHbZn5yCFCv4Logging to Console and File Logs are written to the console and to the
app.logfile in the project directory. Use the--verboseand--quietoptions to adjust log verbosity.
Requirements
- Node.js: Version 20.11.1 (specified in
.nvmrcorpackage.jsonunderengines). - Dependencies: Refer to the
package.jsonfile for required modules.
Installation
To install dependencies for local use:
npm install btc-minikeytoolsTo install globally as a CLI tool:
npm install -g btc-minikeytoolsAfter installation, use the CLI anywhere:
btc-minikeytools process S6c56bnXQiBjk9mqSYE7ykVQ7NzrRyUsage
CLI Commands
Generate a MiniKey
btc-minikeytools generateValidate a MiniKey
btc-minikeytools validate S6c56bnXQiBjk9mqSYE7ykVQ7NzrRyConvert a MiniKey to HEX
btc-minikeytools to-hex S6c56bnXQiBjk9mqSYE7ykVQ7NzrRyConvert HEX to WIF Generate mainnet WIF:
btc-minikeytools to-wif 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9ABGenerate testnet WIF:
btc-minikeytools to-wif 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9AB --testnetGenerate compressed WIF:
btc-minikeytools to-wif 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9AB --compressedFull Workflow: Validate, Convert to HEX, and WIF
btc-minikeytools process S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy
Log Level Options
- Default: Logs general information (
infolevel). - Verbose Mode: Add
--verboseto display detailed logs (debuglevel). - Quiet Mode: Add
--quietto suppress all logs except errors (errorlevel).
Example:
btc-minikeytools process S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy --verboseBasic Example
const MiniKeyConverter = require('btc-minikeytools');
const converter = new MiniKeyConverter();
// Validate Bitcoin MiniKey
const miniKey = 'S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy';
console.log(`Is valid: \${converter.check(miniKey)}`);
// Generate a new MiniKey
const generatedMiniKey = converter.generateMiniKey();
console.log(`Generated MiniKey: \${generatedMiniKey}`);Documentation
The complete documentation is available here.
Project Link
Find the full project on GitHub: BTC-MiniKeyTools.
NPM Package
Install or view the package on NPM: btc-minikeytools.
Tests
Run the test suite to ensure everything works correctly:
npm testSecurity
- This tool processes private keys and generates sensitive outputs (e.g., WIF keys). Handle all inputs and outputs securely.
- Avoid running the tool on untrusted systems or sharing private keys.
- Logs may contain private keys when using
--verbose. Consider clearing theapp.logfile after use if this is a concern.
License
This project is licensed under the MIT License. See the LICENSE file for details.
