GreySec Forums
Random bitcoin private key generation in python - Printable Version

+- GreySec Forums (https://greysec.net)
+-- Forum: Programming and Development (https://greysec.net/forumdisplay.php?fid=16)
+--- Forum: General Programming (https://greysec.net/forumdisplay.php?fid=17)
+--- Thread: Random bitcoin private key generation in python (/showthread.php?tid=3347)



Random bitcoin private key generation in python - illmanors - 07-16-2018

The following code will generate random private keys and derive the BTC address for it.

Code:
#!/usr/bin/python
from bitcoin import *

def keying():
priv = random_key()
pub = privtopub(priv)
addr = pubtoaddr(pub)
wifkey = encode_privkey(priv, 'wif')
print wifkey + "," + addr

while True:
   keying()



RE: Random bitcoin private key generation in python - sleepy999 - 01-31-2019

(07-16-2018, 01:59 PM)illmanors Wrote: The following code will generate random private keys and derive the BTC address for it.

Code:
#!/usr/bin/python
from bitcoin import *

def keying():
priv = random_key()
pub = privtopub(priv)
addr = pubtoaddr(pub)
wifkey = encode_privkey(priv, 'wif')
print wifkey + "," + addr

while True:
   keying()


did you code it yourself ?