Skip to content

Instantly share code, notes, and snippets.

@HeXenCore
HeXenCore / bitcoin_keys_gen.py
Created May 23, 2021 10:34 — forked from gerbill/bitcoin_keys_gen.py
Generate BitCoin Private Key, Public Key and Addresses for Main Net and Test Net
"""
Required modules:
ecdsa (pip install ecdsa)
base58 (pip install base58)
"""
import ecdsa
import base58
import hashlib
from hashlib import sha256
@HeXenCore
HeXenCore / btc_scan.py
Created May 23, 2021 09:35 — forked from Nikolaj-K/btc_scan.py
Matching generated private keys against the funded ledger
"""
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/
@HeXenCore
HeXenCore / seed2keys.py
Created May 23, 2021 09:08 — forked from RCasatta/seed2keys.py
Creates public and private keys from Electrum 2.0 seed
#!/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
'''
@HeXenCore
HeXenCore / seed2keys.py
Created May 23, 2021 09:08 — forked from romanz/seed2keys.py
Creates public and private keys from Electrum 2.0 seed
#!/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)