Coder Social home page Coder Social logo

bro200bs / bitcoin-address-generator Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 5.0 17 KB

Every type of Bitcoin addresses generator in python🐍

Home Page: https://github.com/BRO200BS/Bitcoin-Address-Generator

Python 100.00%
bitcoin bitcoin-address bitcoin-addresses bitcoin-wallet btc btc-wallet wallet-generator

bitcoin-address-generator's Introduction

Bitcoin-Address-Generator

image

Bitcoin All Type Address Generator ! Generates Bitcoin addresses of different types (uncompressed and compressed P2PKH addresses, P2SH addresses, and Bech32 addresses) using a cryptographically secure method. It prompts the user to enter the number of addresses to generate and creates them using the os, ecdsa, base58, Crypto.Hash, and bech32 libraries. First, the code generates a private key using the os.urandom function to generate 32 bytes of random data. This private key is then encoded in Wallet Import Format (WIF) by adding a version byte (0x80 for mainnet), calculating a checksum using double SHA-256 hashing, and encoding the result in base58. Next, the code uses the ecdsa library to derive a public key from the private key. The public key is a point on the elliptic curve defined by the secp256k1 parameters. The code calculates both the uncompressed and compressed forms of the public key. The uncompressed public key includes both the x and y coordinates of the point, while the compressed public key includes only the x coordinate and a prefix to indicate whether the y coordinate is even or odd. The code then generates a P2PKH address from the uncompressed public key by performing SHA-256 and RIPEMD-160 hashing on the public key, adding a version byte (0x00 for mainnet), calculating a checksum using double SHA-256 hashing, and encoding the result in base58. A compressed P2PKH address is generated in a similar manner using the compressed public key. A P2SH address is generated by creating a redeem script that includes the compressed public key, performing SHA-256 and RIPEMD-160 hashing on the redeem script, adding a version byte (0x05 for mainnet), calculating a checksum using double SHA-256 hashing, and encoding the result in base58. Finally, a Bech32 address is generated by converting the RIPEMD-160 hash of the compressed public key into a witness program with a version byte of 0x00 and a length of 20 bytes, converting the witness program from 8-bit to 5-bit format using the convertbits function from the bech32 library, and encoding the result using Bech32 with the human-readable part bc for mainnet. The code returns a dictionary containing all generated information (private key, WIF, public key, compressed public key, P2PKH address, compressed P2PKH address, P2SH address, and Bech32 address) for each generated address. Offline & Secure Generator.

BUY ME SOME COFFEE ☕ MY P2SH ADDRESS: 3MkzuRaZit1brdXQkAk5Np2YguDQQwoGBu I didn't expect someone would send something 😋

bitcoin-address-generator's People

Contributors

bro200bs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bitcoin-address-generator's Issues

Creates invalid bech32 addresses?

the script seems to be generating invalid bech32 addresses. Im trying to debug it and figure out what the issue is but havent been successful yet maybe im missing something, please take a look if you can also PM me I made a bunch of other additions to this including a gui threading output to .csv along with other efficiency updates, but Im trying to run your orignal function for the generation of bech32 addresses and i get what looks like a valid output until i go to check them and block explorers are indicating they are invalid. Please advise. Thanks. Sorry if ive done this issue thing wrong while im not exactly new to github I am new to participating in the collab process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.