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 | |
| ''' Run from "electrum/lib" directory. | |
| ''' | |
| import bitcoin, mnemonic | |
| mn = raw_input("Enter mnemonic (13 words)").strip() | |
| s = mnemonic.Mnemonic.mnemonic_to_seed(mn, '') | |
| print 'seed:', repr(s) | |
| xprv, xpub = bitcoin.bip32_root(s) |
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 | |
| ''' Run from "electrum/lib" directory. | |
| ThomaxV started a discussion on https://bitcointalk.org/index.php?topic=274182.msg2939599#msg2939599 | |
| about changing the HD derivation logic in electrum 2. The below post: | |
| http://bitcoin.stackexchange.com/questions/37013/how-to-import-a-hd-wallet-from-an-extended-private-key | |
| confirms that the format is actually m/c/i (and not m/44'/0'/a'/c/i) | |
| so I have altered https://gist.github.com/romanz/4b32782bfc0ff4984713 accordingly: | |
| tested to work with keys/addresses exported from electrum 2.7.0 | |
| note Electrum has a "gap limit" of 20, so loop @ level "c" to get the next 20 addresses | |
| ''' |
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
| """ | |
| Script discussed in the video: | |
| https://youtu.be/i2QaBjCvMN4 | |
| How to steal all bitcoin (on average 10^-60 of it per day) | |
| This script checks whether a given Bitcoin private key (int) has | |
| funds using a CSV snapshot of the blockchain ledger. | |
| This ordered CSV of currently funded addresses can be downloaded from: | |
| http://addresses.loyce.club/ |
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
| """ | |
| Required modules: | |
| ecdsa (pip install ecdsa) | |
| base58 (pip install base58) | |
| """ | |
| import ecdsa | |
| import base58 | |
| 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
| # 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" |
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
| #!/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
| 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
| #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 | |
| 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): |
OlderNewer