Skip to content

BitKeyGen: A Python tool to generate Bitcoin private keys, WIFs, and addresses. Perfect for developers and crypto enthusiasts! Save keys to wallet.json securely. πŸš€πŸ”‘ #Bitcoin #Crypto

License

Notifications You must be signed in to change notification settings

HugoXOX3/BitKeyGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BitKeyGen

BitKeyGen is a Python script that generates Bitcoin private keys, Wallet Import Format (WIF) keys, and corresponding Bitcoin addresses. It is designed for educational purposes, testing, and wallet creation. The program ensures that all keys are generated securely and saves them to a wallet.json file for easy management.


Features

  • Random Key Generation: Generates cryptographically secure Bitcoin private keys.
  • WIF Conversion: Converts private keys into Wallet Import Format (WIF) for easy import into wallets.
  • Address Derivation: Derives Bitcoin addresses from private keys using elliptic curve cryptography.
  • File Storage: Saves generated keys to a wallet.json file for easy access and backup.
  • Graceful Interrupt Handling: Saves the wallet even if the program is interrupted with Ctrl+C.
  • Address Activity Checker: Includes a check_wallet_address program to verify which addresses have transactions.

Installation

  1. Clone the Repository:

    git clone https://github.com/HugoXOX3/BitKeyGen.git
    cd BitKeyGen
  2. Install Dependencies: The script requires the base58 library for encoding. Install it using pip:

    pip install base58
  3. Run the Script:

    python main.py

Usage

1. Generate Keys

  1. Set the Number of Keys: When prompted, enter the number of keys you want to generate.

  2. Check the Output: The generated keys will be saved in the wallet.json file in the same directory. Each key will include:

    • private_key: The private key in hexadecimal format.
    • wif: The Wallet Import Format (WIF) key.
    • address: The Bitcoin address.
  3. Interrupt Handling: If you press Ctrl+C, the program will save the current state of the wallet to wallet.json before exiting.

2. Check Address Activity

The check_wallet_address program checks which addresses in wallet.json have transactions using the Bitcoin Explorer API.

  1. Run the Checker:

    python check_wallet_address.py
  2. Output:

    • Addresses with transactions are saved to found.txt.
    • The program prints the status of each address (active or inactive).

Example

Input (Key Generation):

Enter the number of keys to generate: 5

Output (Key Generation):

Generating 5 keys...
Generated key 1/5: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
Generated key 2/5: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
Generated key 3/5: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
Generated key 4/5: 1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs
Generated key 5/5: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
Wallet saved to wallet.json.

wallet.json:

[
    {
        "private_key": "0x1e2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f809",
        "wif": "5HueCGU8rMjxEXxiPuD5BDu1E8jMZ1G7fC2o5Y6f4h6Z",
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    },
    {
        "private_key": "0x2f3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091b",
        "wif": "5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF",
        "address": "1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs"
    }
]

Input (Address Checker):

python check_wallet_address.py

Output (Address Checker):

Loaded 2 addresses from wallet.json.
Checking address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
Address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa has transactions. Saving to found.txt.
Checking address: 1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs
Address 1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs has no transactions.

found.txt:

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

Security Notes

  • Private Keys: Never share your private keys. Anyone with access to a private key can control the associated Bitcoin.
  • File Storage: Ensure the wallet.json file is stored securely. Consider encrypting it or storing it in a secure location.
  • Use at Your Own Risk: This script is for educational purposes only. Use it responsibly.

Donations

If you find this project useful, consider supporting it with a Bitcoin donation:

Bitcoin Address: bc1qt7a6vl28czf00vmuse9j7xwpyr7jjt83m2hljh

Donate Bitcoin


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

BitKeyGen: A Python tool to generate Bitcoin private keys, WIFs, and addresses. Perfect for developers and crypto enthusiasts! Save keys to wallet.json securely. πŸš€πŸ”‘ #Bitcoin #Crypto

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages