Author

Topic: Urandom2Wif (Read 1885 times)

legendary
Activity: 1092
Merit: 1016
760930
November 18, 2013, 03:43:00 PM
#1
I'm in a scripting mood... So here's another very small Python script which just converts any 256-bit private key (passed as a Hex string) to the corresponding WIF key and BTC address.   Either pass such a number as an argument to the script (see screenshot) or just run it with no arguments to feed it with 256 crypto-secure bits from /dev/urandom.

The output can be also be used to cross-check results with websites such as bitaddress.org or brainwallet.org.

Confirmed to run fine on Windows (all editions), Mac, Linux, Raspberry Pi, and Android.


Code:
#Urandom2Wif by flatfly - requires ecdsa (sudo pip install ecdsa)

EDIT: see https://bitcointalksearch.org/topic/private-key-to-bitcoina-ddress-on-windows-95-424691

More info about the WIF format: https://en.bitcoin.it/wiki/Wallet_import_format
Jump to: