-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
future request uncompressed Key.address #163
Comments
update: |
so you know , how to get native segwit address, |
@rockygsm |
>>> from bit import Key
>>> from bit.format import public_key_to_address
>>> k = Key.from_hex('0000000000000000000000000000000000000000000000000000000000000001')
>>> k.address
'1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'
# compressed P2PKH
>>> public_key_to_address(k._pk.public_key.format(compressed=True),'main')
'1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'
# compressed P2PKH
>>> public_key_to_address(k._pk.public_key.format(compressed=False),'main')
'1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm'
# uncompressed P2PKH |
from bit import PrivateKey
def get_bech32_address():
byte_public_key_comp = PrivateKey("your_private_key")._pk.public_key.format()
witprog = ripemd160_sha256(byte_public_key_comp)
bech32_address = encode('bc', 0, witprog)
return bech32_address
print("SegWit Native:", get_bech32_address()) |
Hello
i am using
Key.from_hex('hexdata').address
return compressed address your python lib work fastest then any other.but what is solution for getting uncompressed as i seen all source not found any sort way
way i used is
but its not fast like compressed i am missing something ?
its possible to implement something like Key.address(False) to display uncompressed address ?
The text was updated successfully, but these errors were encountered: