Thanks for answer! So, when I'm runnnig your code, I'm getting something like b'\xe9+\xf7\x97A\...... How can I convert it to a usual string? str() and .decode('utf-8') don't work :( – Sergey Potekhin – 2016-11-10T18:44:30.123
1It's a bytes 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 – 2016-11-10T18:51:19.363
Well, I mean that usually ECDSA private key looks like 18E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725 according to this. So, how can I get an address which looks the same?
Thanks for answer! So, when I'm runnnig your code, I'm getting something like
b'\xe9+\xf7\x97A\...... How can I convert it to a usual string?str()and.decode('utf-8')don't work :( – Sergey Potekhin – 2016-11-10T18:44:30.1231It's a
bytestype. 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 – 2016-11-10T18:51:19.363Well, I mean that usually ECDSA private key looks like
– Sergey Potekhin – 2016-11-10T20:45:48.99018E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725according to this. So, how can I get an address which looks the same?*a key which looks the same – Sergey Potekhin – 2016-11-10T21:00:56.840
1Use
binascii.hexlify(key.to_string()).decode('ascii').upper()– Nick ODell – 2016-11-10T22:53:53.267