Skip to content

Python Bitcoin Utils CLI — Interactive interface for python-bitcoin-utils library with low-level Bitcoin tools for key generation, address creation (P2PKH/P2SH/P2WPKH/P2WSH/P2TR), SegWit/Taproot transaction building, script assembly, block parsing, and Rich terminal menu

License

Notifications You must be signed in to change notification settings

CrystALqsxvk39/Python-Bitcoin-Utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Bitcoin-Utils

Python Bitcoin Utils CLI — Interactive interface for python-bitcoin-utils library with low-level Bitcoin tools for key generation, address creation (P2PKH/P2SH/P2WPKH/P2WSH/P2TR), SegWit/Taproot transaction building, script assembly, block parsing, and Rich terminal menu

 _____       _   _                   ____  _ _            _         _    _ _   _ _     
|  __ \     | | | |                 |  _ \(_) |          (_)       | |  | | | (_) |    
| |__) |   _| |_| |__   ___  _ __   | |_) |_| |_ ___ ___  _ _ __   | |  | | |_ _| |___ 
|  ___/ | | | __| '_ \ / _ \| '_ \  |  _ <| | __/ __/ _ \| | '_ \  | |  | | __| | / __|
| |   | |_| | |_| | | | (_) | | | | | |_) | | || (_| (_) | | | | | | |__| | |_| | \__ \
|_|    \__, |\__|_| |_|\___/|_| |_| |____/|_|\__\___\___/|_|_| |_|  \____/ \__|_|_|___/
        __/ |                                                                          
       |___/                                                                           

Python Bitcoin Utils CLI

License: MIT Python 3.8+ bitcoin-utils

A terminal-style CLI for the python-bitcoin-utils library — low-level tools for keys, addresses, SegWit, Taproot, scripts, and block parsing.

FeaturesGetting StartedConfigurationUsageProject StructureFAQ


Official Links

Resource URL
Bitcoin https://bitcoin.org
Bitcoin Whitepaper https://bitcoin.org/bitcoin.pdf
python-bitcoin-utils (PyPI) https://pypi.org/project/bitcoin-utils/
python-bitcoin-utils (GitHub) https://github.com/karask/python-bitcoin-utils
Bitcoin Core https://github.com/bitcoin/bitcoin

Features

Feature Status Feature Status
Key & address management (ECDSA secp256k1) Full script opcode support
Legacy addresses (P2PKH, 1...) Raw block parsing
SegWit addresses (P2WPKH, bc1q...) Message signing & verification
Taproot addresses (P2TR, bc1p...) HD wallet support (via hdwallet)
Transaction creation (Legacy, SegWit, Taproot) NodeProxy for Bitcoin node RPC
All SIGHASH types Cross-platform (Windows, Linux, macOS)

Getting Started

Prerequisites

  • Python 3.8 or higher (3.10+ recommended for full library support)
  • pip (Python package manager)

Installation

Windows (quick start):

run.bat

Manual:

git clone <this-repo>
cd Python-Bitcoin-Utils-CLI
pip install -r requirements.txt
python main.py

Dependencies

Package Version Purpose
colorama ≥0.4.6 Cross-platform colored terminal output
bitcoin-utils (optional) Core library — install separately for full functionality

Note: For full key/address/transaction tools, clone and install python-bitcoin-utils or btc-python-utils.


Configuration

The CLI uses minimal configuration. For Bitcoin node integration (when using NodeProxy with python-bitcoin-utils), create a config file:

config.json (example for Bitcoin Core RPC):

{
  "bitcoin_node": {
    "host": "127.0.0.1",
    "port": 8332,
    "user": "bitcoinrpc",
    "password": "your_rpc_password_here",
    "use_ssl": false
  },
  "network": "mainnet",
  "cli": {
    "theme": "dark",
    "verbose": false
  }
}

.env (alternative for secrets):

BITCOIN_RPC_HOST=127.0.0.1
BITCOIN_RPC_PORT=8332
BITCOIN_RPC_USER=bitcoinrpc
BITCOIN_RPC_PASSWORD=your_secure_password

Usage

CLI Menu

+----+---------------------------+------------------------------------------+
| #  | Action                    | Description                              |
+----+---------------------------+------------------------------------------+
| 1  | Install Dependencies      | pip install -r requirements.txt         |
| 2  | Run Setup                 | python setup.py - configure package      |
| 3  | Update Package            | Run update.bat - get latest version      |
| 4  | Settings                  | Development environment setup            |
| 5  | About                     | Features, installation, donations        |
| 6  | Key & Address Tools       | Key/address management info              |
| 7  | Transaction Tools         | SegWit, Taproot tx info                  |
| 8  | Script & Block Tools      | Script opcodes, block parsing            |
| 0  | Exit                      | Quit the application                     |
+----+---------------------------+------------------------------------------+

 > Select [#]: _

Project Structure

Python-Bitcoin-Utils-CLI/
├── main.py                 # Entry point, menu loop
├── setup.py                # Package setup (setuptools)
├── requirements.txt        # Dependencies (colorama)
├── run.bat                 # Windows launcher (venv + pip + run)
├── update.bat              # Windows updater
├── actions/
│   ├── __init__.py
│   ├── about.py            # Features, donations
│   ├── install.py          # pip install dependencies
│   ├── setup.py            # Run setup.py
│   ├── settings.py         # Dev environment setup
│   ├── tools.py            # Key/Address, Tx, Script/Block info
│   └── update.py           # Package update
└── utils/
    ├── __init__.py
    └── ui.py               # Terminal UI, Colorama, tables

FAQ

What is python-bitcoin-utils?

A low-level Python library for interacting with the Bitcoin protocol. It provides tools for keys, addresses, transaction creation (including SegWit and Taproot), script opcodes, and raw block parsing. Designed for learning and experimentation — not production use yet.

Does this CLI require a Bitcoin node?

No. The CLI itself is a menu-driven interface. For transaction broadcasting or blockchain queries, you would use the python-bitcoin-utils library with its NodeProxy (which wraps python-bitcoinrpc) and a running Bitcoin Core or compatible node.

What address types are supported?

Legacy (P2PKH, 1...), SegWit (P2WPKH, bc1q...), P2SH-P2WPKH, P2WSH, P2SH-P2WSH, and Taproot (P2TR, bc1p...). The library uses Bitcoin Core reference implementations for Bech32/Bech32m and Schnorr.

How do I run on Linux or macOS?

Use the manual install: pip install -r requirements.txt then python main.py. For venv: python -m venv venv, source venv/bin/activate (Linux/macOS), then run as above.

Where can I find transaction examples?

The python-bitcoin-utils GitHub repository contains extensive examples: P2PKH, P2SH, SegWit, Taproot, timelocks, multi-sig, and more. API documentation is available as BitcoinUtilities.pdf.

Is it safe to use for real Bitcoin?

The library is in early development. Use only for learning and testing. Never use with mainnet funds without thorough auditing. Always verify addresses and transactions before signing.


Disclaimer

This software is provided as-is for educational and experimental purposes. Cryptocurrency operations involve financial risk. The authors are not responsible for lost funds, incorrect transactions, or security vulnerabilities. Use at your own risk. Always verify addresses and test on testnet before using real Bitcoin.


Support the Project

BTC: bc1q8grhtxdw37npcdadm7xa848vquqgurj9ecvpex

ERC20: 0x2d19c72fb8b3a7cdc7fa4970b5c777966f547854


If you find this project useful, please consider giving it a ⭐ on GitHub.

About

Python Bitcoin Utils CLI — Interactive interface for python-bitcoin-utils library with low-level Bitcoin tools for key generation, address creation (P2PKH/P2SH/P2WPKH/P2WSH/P2TR), SegWit/Taproot transaction building, script assembly, block parsing, and Rich terminal menu

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors