-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code limit should be called out or removed #292
Comments
The database we’re using includes bitcoin addresses in P2PKH (address starts with 1), P2SH (address start with 3), and P2WPKH (address start with bc1) formats. The algorithm we’re using only generates P2PKH addresses and has been really optimized to do it as fast as possible. Since only addresses that start with 1 get generated, all the other bitcoin address types can be ignored when we load the database. We could make an extension to include the other types. But P2PKH is considered the legacy address format that older forgotten whale bitcoin wallets are in. And doing the other formats would take a bunch of time |
Got it. Thanks for the clarification and the program. Running great. I've added a few things to show progress that don't seem to slow anything down. Checked for various ways to speed it up, but it seems you've done a good job already. :-) I figure I am guaranteed to find a code within the next 1000 million years. |
Testing this: (sorry the formatting was lost in this post) The public_key_to_p2sh_address function generates a P2SH address by creating a redeem script that pushes the hash of the public key onto the stack, and then base58 encoding the redeem script with a prefix of '05'. The public_key_to_p2wpkh_address function generates a P2WPKH address by hashing the public key using RIPEMD-160, prefixing the resulting hash with '0014', and then base58 encoding the result with a prefix of 'bc'. The P2WPKH address format is compatible with the Bech32 address format (starting with 'bc1'), which is the preferred address format for SegWit transactions. However, this implementation uses the base58 encoding format for consistency with the other address formats.import binascii def generate_private_key(): def private_key_to_public_key(private_key, fastecdsa): def public_key_to_p2pkh_address(public_key): def public_key_to_p2sh_address(public_key): def public_key_to_p2wpkh_address(public_key): |
Y |
In the "main", the section that creates the array ("database") is set to only pick up addresses that start with 1.
if address.startswith('1'):
database.add(address[-args['substring']:])
Found it wondering why the record count did not match the documentation. Easy to comment it out and use the entire data set.
The text was updated successfully, but these errors were encountered: