Skip to content
New issue

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

关于如何处理 scatter 的 sign arbitrary #5

Closed
xuewuli opened this issue Dec 28, 2018 · 2 comments
Closed

关于如何处理 scatter 的 sign arbitrary #5

xuewuli opened this issue Dec 28, 2018 · 2 comments

Comments

@xuewuli
Copy link
Owner

xuewuli commented Dec 28, 2018

收到的数据

{
"publicKey":"xxxxxx",
"data":"yyyyyyy",
"whatfor":"wwwww",
"isHash":false
}

publicKey 用于找到对应的私钥,若是注入webview应该可以假定就是当前账户
data 需要签名的数据
whatfor UI显示用
isHash 决定签名方式

  • true 使用 ecc.Signature.signHash
  • false 使用 ecc.sign

返回数据

只需要将签名结果返回, 不是对象也不是数组,就是只 "SIG_K1_..." 这样一个字符串

  • BrigeAPI.sendResponse(1111111, "SIG_K1_...")
@HallCheng
Copy link

收到的数据

{
"publicKey":"xxxxxx",
"data":"yyyyyyy",
"whatfor":"wwwww",
"isHash":false
}

publicKey 用于找到对应的私钥,若是注入webview应该可以假定就是当前账户
data 需要签名的数据
whatfor UI显示用
isHash 决定签名方式

  • true 使用 ecc.Signature.signHash
  • false 使用 ecc.sign

返回数据

只需要将签名结果返回, 不是对象也不是数组,就是只 "SIG_K1_..." 这样一个字符串

  • BrigeAPI.sendResponse(1111111, "SIG_K1_...")

当 isHash 为True时,data 中的数据是 sha256数据吗?还没有遇到过这种授权。

@xuewuli
Copy link
Owner Author

xuewuli commented Jan 9, 2019

是的,这里是参考scatter desktop的实现些的说明. isHash的我也没遇到过,用sign arbitrary本就不多

@xuewuli xuewuli pinned this issue Feb 27, 2019
@xuewuli xuewuli changed the title 关于sign arbitrary消息 关于如何处理 scatter 的 sign arbitrary Feb 27, 2019
@xuewuli xuewuli closed this as completed May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants