This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Bitcoin WIF to Litecoin WIF converter | |
| === INFO === | |
| Idk | |
| === USAGE (example) === | |
| % python3 litecoinwif.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Implementation of "Pay to Witness Public Key Hash nested in BIP16 Pay to Script Hash" (P2WPKH-P2SH) address generation. | |
| Described in BIP 141 (SegWit) https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH_nested_in_BIP16_P2SH | |
| I.e.: Public key -> SegWit address | |
| """ | |
| import hashlib | |
| from hashlib import sha256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo | |
| echo "Welcome to the Bitcoin address generator!" | |
| echo "input private key (32 bytes, hex format)" | |
| read priv | |
| echo "" | |
| echo "#####################################" | |
| # priv=0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D # Testing only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Taken from https://stackoverflow.com/questions/27582001/how-to-use-128-bit-integers-in-cython | |
| Basically, we make cython believe we will use 64 bit int to generate the .c file, | |
| but by using a C header we will, in fact, define a 128 bit int (the definition | |
| in the .h file does not match what we put into the pyx file). | |
| Once Cython has generated the .c file, we can compile it with GCC without further trouble, | |
| as GCC does support 128 bit ints |
OlderNewer