Sign Message Netherium

33 Views Asked by At

I'm trying to get a signature using the Netherium c# library, no errors occur, but the signature is incorrect

The code I use

string privateKey = "privateKey";
string dataToSign = @"Welcome
name";
string rpc = "https://1rpc.io/eth";

var web3 = new Web3(rpc);

var signer = new EthereumMessageSigner();
string signature = signer.EncodeUTF8AndSign(dataToSign, new EthECKey(privateKey));
Console.Writeline(signature);

when checking the signature it gives another wallet https://etherscan.io/verifiedSignatures#

1

There are 1 best solutions below

0
Евгений Агарков On

I figured it out when you enter text in the format

string str = @"str1
str2";

She perceives it as str1\n\r and not str1\nstr2 as in js Solve str.Replace("\r\n", "\n");