是不是TP的message加了一些东西
下面是调起tp 的data参数
{
“hash”:false,
“message”:“808594217hfjJOTHQ0eNubnkTTrclG3StezeDzlAOu4pFHie8qiOwzEj0dQxeFTsoHSiodFd”,
“signType”:“ethPersonalSign”,
“action”:“sign”,
“actionId”:“ethPersonalSign_1680859421143”,
“blockchains”:[
{
“chainId”:“1”,
“network”:“ethereum”
}
],
“dappIcon”:“xxxxlogo.png”,
“dappName”:“aaaaa”,
“expired”:0,
“protocol”:“TokenPocket”,
“version”:“1.2.0”
}
谢谢大佬们 问题已经解决了,chatGPT帮我解决了
String content = "808594217hfjJOTHQ0eNubnkTTrclG3StezeDzlAOu4pFHie8qiOwzEj0dQxeFTsoHSiodFd";
content = "\u0019Ethereum Signed Message:\n" + content;
byte[] contentHashBytes = Hash.sha3(content.getBytes());
// contentHashBytes = "\u0019Ethereum Signed Message:\n" + content;
// 原文摘要16进制字符串
String contentHashHex = Hex.toHexString(contentHashBytes);
Credentials credentials = Credentials.create(priKey);
Sign.SignatureData signMessage = Sign.signPrefixedMessage(contentHashBytes, credentials.getEcKeyPair());
谢谢你 我看了这个,确实web3js 和java的web3j得到的结果不一样,但是还是没达到我的预期的sign