0
Ledger Nano S and other pieces of Bitcoin software and hardware can sign messages using the private key associated with an address.
Doing this, I get the following output:
-----BEGIN BITCOIN SIGNED MESSAGE-----
Test
-----BEGIN SIGNATURE-----
1BqtNgMrDXnCek3cdDVSer4BK7knNTDTSR
ILoOBJK9kVKsdUOnJPPoDtrDtRSQw2pyMo+2r5bdUlNkSLDZLqMs8h9mfDm/alZo3DK6rKvTO0xRPrl6DPDpEik=
-----END BITCOIN SIGNED MESSAGE-----
What exactly is being signed? How is the signature generated? What is the hash preimage that goes into the ECDSA signing algorithm?
There docs and sample code widely available. Most bitcoin full node implementations also have a
– David Schwartz – 2018-07-17T21:17:00.510verifymessagefunction that you can look at.So I need to prepend "\x18Bitcoin Signed Message:\n" + chr( len(message) ) to the message. What encoding is used to transform the string into a byte array, UTF-8? – Thorkil Værge – 2018-07-17T21:36:11.747