Bitcoin Address Generator
⚠️ Educational and Development Use Only
This package is intended for educational and development purposes. Do not use for production or with real Bitcoin transactions.
Introduction
This repository explores the use of randomly generated hexadecimal numbers to create a bitcoin wallet address using the Elliptic Curve Digital Signature Algorithm. When Alice wants to buy a book from Bob, after all has been agreed upon, Bob needs to provide Alice with a bitcoin wallet address where the payments will be deposited. The transaction will be done on the blockchain, so Bob needs a bitcoin wallet address to receive payments. This repository covers how a bitcoin wallet address can be created from randomly generated private keys.
In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic-curve cryptography.
Method
Bob signs a hash of a message with his private key, and then Alice proves with his public key. Bob also uses a random nonce value for the signature (K)
With ECDSA, Alice will sign a message with her private key, and then Bob will use her public key to verify that she signed the message (and that the message has not changed)
The diagram below illustrates the architecture and how the Bitcoin wallet addresses are created:
Features
- Generate random private keys
- Convert private keys to public keys using ECDSA
- Create valid Bitcoin addresses
- Command-line interface
- Comprehensive validation
- Educational examples and documentation
Setting Up Our Environment
To achieve desired outcome, first we need to set-up the environment. For development purposes, you can use:
- Google Colab environment - https://colab.research.google.com/
- Local Python environment
- Package installation via pip (see Installation section)
For getting randomly generated private keys, you can use:
- Random generation within the package
- Private keys from wallet addresses created via https://www.bitaddress.org
- Other hex generators like https://www.browserling.com/tools/random-hex
Note: For production use, always ensure secure methods of private key generation.
Python Libraries & Dependencies
• ECDSA Python Library - Implementation of the Elliptic Curve Cryptography • Hashlib - Contains hash algorithms for SHA256, RIPEMD160 • Codecs - For encoding and decoding • Base58 - For Base58Check encoding
Installation
pip install bitcoin-address-generator
Quick Start
from bitcoin_address_generator import generate_wallet
# Generate new wallet
private_key, public_key, address = generate_wallet()
print(f"Bitcoin Address: {address}")
Command Line Usage
# Generate new address
bitcoin-address-generator generate
# Validate address
bitcoin-address-generator validate <address>
Development Roadmap
v0.1.0 (Current)
- Basic Bitcoin address generation
- Command-line interface
- Core cryptographic operations
- Educational documentation
- Test suite
v0.2.0 (Planned)
- Support for different address types (P2SH, SegWit)
- Key encryption for secure storage
- QR code generation for addresses
- Bulk address generation
- Basic transaction signing
v0.3.0 (Planned)
- HD wallet support (BIP32/39/44)
- Mnemonic phrase generation
- Multi-signature support
- Network validation
- Address balance checking
v0.4.0 (Planned)
- Web interface
- API endpoint support
- Transaction history
- Address monitoring
- Automated testing with testnet
Documentation
Feedback
If you have any feedback, please reach out to me at gs_wl889@icloud.com
Contributing
Contributions are always welcome! See CONTRIBUTING.md for ways to get started. Please adhere to this project's CODE_OF_CONDUCT.md.
Love to read more? Here are some resources & references
- Bitcoin Technical Document
- List of Addresses Prefixes
- Elliptic Curve Digital Signature Algorithm
- ECDSA Python Library
- SEC2: Recommended Elliptic Curve Domain Parameters
- Efficient and Secure ECDSA Algorithm Survey
Security
This package is for educational purposes. See SECURITY.md for important security considerations.
License
Metadata
Release files for bitcoin-address-generator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bitcoin-address-generator-0.1.0.tar.gz | 10.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bitcoin_address_generator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / bitcoin-address-generator-0.1.0.tar.gz
| Download URL | bitcoin-address-generator-0.1.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2122cdf1646de04f10fbcc31da5e07bbcf74cda307e083ff5d4b362388ab1281
|
|
BLAKE2b-256 checksum How to use checksums |
fe03fc1389005c19bac3f66a0d9e7b7b59034a02449cd0f0df3db332afae5330
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / bitcoin_address_generator-0.1.0-py3-none-any.whl
| Download URL | bitcoin_address_generator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6f03700b350d833d8ebfe30b0cd2590ee5127fda62a9f862e723e80a1cc9765
|
|
BLAKE2b-256 checksum How to use checksums |
ee799e03827d0c46b2ca5a29e1465a526ddb74db23dcb1a938a6abf1cb647819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for bitcoin-address-generator 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.