Skip to content

A standalone Bitcoin address generator in pure Python. Converts any WIF private key into compressed/uncompressed P2PKH, P2SH, and Bech32 addresses — no external dependencies.

License

Notifications You must be signed in to change notification settings

pywitcher/btc-address-creator

Repository files navigation

🔐 Bitcoin Address Generator from WIF (No Libraries)

This is a pure Python 3 script that takes a Bitcoin WIF (Wallet Import Format) private key as input and generates all three common types of Bitcoin addresses:

  • Legacy (P2PKH, starting with 1)
  • Compatibility / Nested SegWit (P2SH, starting with 3)
  • Native SegWit (Bech32, starting with bc1)

It generates addresses for both compressed and uncompressed public keys, fully compliant with Bitcoin standards.

✅ No external libraries are used — the script implements everything from scratch:
ECC math, Base58Check, Bech32, RIPEMD160, SHA256, etc.


🛠 Features

  • Parses mainnet WIF private keys (compressed & uncompressed)
  • Performs elliptic curve multiplication (secp256k1) manually
  • Supports:
    • P2PKH address generation (1...)
    • P2SH-P2WPKH nested addresses (3...)
    • Native SegWit Bech32 addresses (bc1...)
  • Fully offline / air-gapped compatible
  • No dependencies (only uses Python standard hashlib)

🧪 Example

$ python3 bitcoin_wif_address_generator.py
Enter Bitcoin WIF private key: 5HueCGU8rMjxEXxiPuD5BDuRa1fFzS2yBXDyzZYG6zDMydEvQXt

Private key (decimal): 1
Compressed: False

Addresses (uncompressed):
  P2PKH: 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH
  P2SH: 3Ma8dF25z3cDei3KnL8rUrsVxEGL6bdymv
  Bech32: bc1qq24kshw8r33z6dnj0t4u8m8w85up2zvszsaf8y

Addresses (compressed):
  P2PKH: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
  P2SH: 3CMNFxN1oHBc4R1EpboAL5yzHGgE611Xou
  Bech32: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kygt080

About

A standalone Bitcoin address generator in pure Python. Converts any WIF private key into compressed/uncompressed P2PKH, P2SH, and Bech32 addresses — no external dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages