Closed kochol closed 1 year ago
Thanks, I'll add it to the sample and release it to NuGet.
Available on NuGet with version 1.9.0
Wow, fast merge.
Here is an example of how to use NEthereum library to verify the signed message.
// using Nethereum.Signer;
EthereumMessageSigner signer = new EthereumMessageSigner();
var address = signer.EncodeUTF8AndEcRecover(Message, SignedMessage);
address = address.ToLower();
Great, thanks for the sample to verify the signed message. I included that in the sample app.
One thing to mention here is, I think my code only works for English messages and the texts in other languages will not work.
If we want to support them too, we have to find a way to convert utf8 strings to hex strings.
https://stackoverflow.com/questions/21647928/javascript-unicode-string-to-hex https://stackoverflow.com/questions/36637146/encode-string-to-hex
We can also convert string to hex on C# part.
Personal sign function is used to create SiWE applications and website and backend can verify the sign easily by NEthereum library.