Skip to content
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

Looking to generate a bech32 address #180

Open
ChristianOConnor opened this issue Apr 14, 2023 · 1 comment
Open

Looking to generate a bech32 address #180

ChristianOConnor opened this issue Apr 14, 2023 · 1 comment

Comments

@ChristianOConnor
Copy link
Contributor

Does bit allow for the creation of bech32 addresses?

@Igor-san
Copy link

Igor-san commented May 4, 2023

Does bit allow for the creation of bech32 addresses?

Try like this
`from bit import Key
from bit.crypto import ripemd160_sha256
from bit.base32 import encode

key = Key.from_hex('0000000000000000000000000000000000000000000000000000000000000001')
byte_public_key_comp = key._pk.public_key.format(compressed=True)
witprog = ripemd160_sha256(byte_public_key_comp)
segwit = encode('bc', 0, witprog)
print("segwit", segwit)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants