personal_ecRecover
ecRecover
方法从签名中提取签名私钥对应的以太坊地址。
调用方法
Geth控制台:
personal.ecRecover(message, signature)
JSON RPC:
{"method": "personal_ecRecover", "params": [message, signature]}
示例代码
下面的示例在Geth控制台使用ecRecover方法从签名中提取签名私钥对应的以太坊地址:
> personal.sign("0xdeadbeaf", "0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "")
"0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"
> personal.ecRecover("0xdeadbeaf", "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b")
"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83"