ofek / bit

Bitcoin made easy.
https://ofek.dev/bit/
MIT License
1.25k stars 216 forks source link

Custom private key #162

Closed EazyServer closed 2 years ago

EazyServer commented 2 years ago

Hello again 😅

Seems I fell in love with this package and I can't help but ask another question please.

What's the best way to generate a public key (i.e. bitcoin address) from a custom private key? say private_key=1234

I saw you implementation and it's as random as it can get but I am more looking into experimenting rather than generating a secure key pairs.

Thanks

EazyServer commented 2 years ago

Found it 😅

key = Key.from_int(1234)

It supports hex as well

key = Key.from_hex('2FF')