I'm trying to get a signature using the Netherium c# library, no errors occur, but the signature is incorrect
我正在尝试使用Netherium c#库获取签名,没有出现错误,但签名不正确
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#
当检查签名时,它给出另一个钱包https://etherscan.io/verifiedSignatures#
更多回答
优秀答案推荐
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");
她将其视为str1\n\r,而不是js solve str.Replace(“\r\n”,“\n”)中的str1\nstr2;
更多回答
我是一名优秀的程序员,十分优秀!