We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这个问题与 smart-signature/MATATAKI_FE_Mobile#326 联动
我跑不了后端的开发环境,也不太熟悉 eggjs,所以只能提 issue 了
==================分割=====================
我在前端部分测试了以太坊的签名,现在打算让后端接入使用以太坊签名登录后端的功能
通过签名本身与签名的数据,来获取签署人的地址的过程大概是这个样子:
// 引入 eth-sig-util 来处理以太坊相关的签名 const ethSigUtil = require("eth-sig-util"); // 和小岛讨论过,暂定无需防御 replay attack,以太坊没有用户名机制,就这样应该OK了? const typedData = [ { type: "string", // Any valid solidity type name: "Action", // Any string label you want value: "Login" // The value to sign } ]; // 通过 typedData 和 signature recover 签署人地址 const recoveredAddress = ethSigUtil.recoverTypedSignature({ data: typedData, sig: signature }); if (address === recoveredAddress) { // 后续逻辑 } else { // 后续逻辑 }
签名的对象是格式化的数据,用户看起来比单纯的字符串更直观
如果有什么不足之处,欢迎讨论
The text was updated successfully, but these errors were encountered:
jc1991x
No branches or pull requests
这个问题与 smart-signature/MATATAKI_FE_Mobile#326 联动
我跑不了后端的开发环境,也不太熟悉 eggjs,所以只能提 issue 了
==================分割=====================
我在前端部分测试了以太坊的签名,现在打算让后端接入使用以太坊签名登录后端的功能
通过签名本身与签名的数据,来获取签署人的地址的过程大概是这个样子:
typedData?
签名的对象是格式化的数据,用户看起来比单纯的字符串更直观
如果有什么不足之处,欢迎讨论
The text was updated successfully, but these errors were encountered: