I need to repair the script code. The script generates from a random personal key Bitcoin Tackle by perform (pubtoaddr) and works
on the Bitcoin module:


from bitcoin import *
import os

    priv = random_key ()
    pub = privtopub (priv)
    addr = pubtoaddr (pub)


However I must get from a Random Non-public Key in Hash160

For some purpose I couldn’t discover such a perform in major.py

I searched and located an article

>>> import pybitcointools
>>> privkey = pybitcointools.random_key ()
>>> privkey
>>> pubkey = pybitcointools.privtopub (privkey)
>>> pubkey
>>> h160 = pybitcointools.hash160 (pubkey.decode ('hex'))
>>> h160
>>> addr = pybitcointools.hex_to_b58verify (h160)
>>> addr

Sadly I couldn’t get from

 priv = random_key ()  --- > Hash160

The way to do it?

Source link


Please enter your comment!
Please enter your name here