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 |
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
| """ | |
| 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
| ''' | |
| 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
| import hashlib | |
| from ecdsa import SECP256k1, SigningKey | |
| from sha3 import keccak_256 | |
| import sys | |
| import binascii | |
| BASE58TABLE = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | |
| def from_bytes (data, big_endian = False): | |
| if isinstance(data, str): |
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
| #https://en.bitcoin.it/wiki/Wallet_import_format | |
| import os, binascii, hashlib, base58, ecdsa | |
| #Input params | |
| #random_number - 32 byte random number string ex:b'-\xf2L~\xe1Gq\xeeN\x8e\x97La$\xc7\xbb\x05\xaf\x05\xf9^\x00\xd5\x19o`@Q\x02\xc18\xa1' | |
| #If no random number input, one is automatically generated | |
| #Output params - Private Wallet Key, Public Address | |
| def create_wallet(random_number=""): | |
| def ripemd160(x): |
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
| import hashlib | |
| import struct | |
| from coincurve import PrivateKey, PublicKey | |
| from base58 import b58encode_check, b58decode_check | |
| from hmac import compare_digest | |
| RECID_MIN = 0 | |
| RECID_MAX = 3 | |
| RECID_UNCOMPR = 27 | |
| LEN_COMPACT_SIG = 65 |
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
| #!/usr/bin/env python | |
| """Calculate Bitcoin address corresponding to given ECDSA private key. | |
| Handy for verifying document timestamps provided by OriginStamp.org. | |
| Usage: ecdsa_to_bitocin_addy.py ecdsa_private_key # that's a 64-character hex string | |
| Prerequisite: | |
| pip install ecdsa |
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
| #!/usr/bin/env python | |
| # patched from https://bitcoin.stackexchange.com/questions/56923/is-this-how-to-generate-a-bitcoin-address-with-python | |
| # https://en.bitcoin.it/wiki/Protocol_documentation#Addresses | |
| # Adapted to litecoin, following https://bitcoin.stackexchange.com/questions/65282/how-is-a-litecoin-address-generated | |
| import hashlib | |
| import base58 | |
| # ECDSA bitcoin Public Key | |
| pubkey = '0450863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b23522cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6' |
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
| # https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses | |
| # http://gobittest.appspot.com | |
| # -*- coding: utf-8 -*- | |
| import hashlib | |
| import base58 | |
| prefix = "04" | |
| version_main = "00" |
NewerOlder