Pretty same question was asked here, but maybe there is a way to generate keys using ecdsa module in just a few lines of code?
Asked
Active
Viewed 2,304 times
1 Answers
3
Yes:
import ecdsa
print(ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1).to_string())

Nick ODell
- 29,396
- 11
- 72
- 130
b'\xe9+\xf7\x97A\.....
. How can I convert it to a usual string?str()
and.decode('utf-8')
don't work :( – Sergey Potekhin Nov 10 '16 at 18:44bytes
type. Interpreting it as ascii or as UTF-8 doesn't make any sense. Are you trying to convert to hex, or are you trying to print raw bytes to the terminal? – Nick ODell Nov 10 '16 at 18:5118E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725
according to this. So, how can I get an address which looks the same? – Sergey Potekhin Nov 10 '16 at 20:45binascii.hexlify(key.to_string()).decode('ascii').upper()
– Nick ODell Nov 10 '16 at 22:53