以太坊椭圆曲线Specp256k1通过消息的hash和签名(对消息的hash的签名)来恢复出公钥和计算r值

源代码 https://github.com/ethereum/go-ethereum/blob/master/crypto/secp256k1/secp256.go 

// RecoverPubkey returns the the public key of the signer.
// msg must be the 32-byte hash of the message to be signed.
// sig must be a 65-byte compact ECDSA signature containing the
// recovery id as the last element.
RecoverPubkey(msg []byte, sig []byte)

其中”sig must be a 65-byte compact ECDSA signature containing the recovery id as the last element.“,说明了最后一个recovery id指的是 rG的x坐标。

 

 

。。。细节之后解释。

posted @ 2019-02-28 15:51  JJJJJJJJJJJ.Ge呀!  阅读(524)  评论(0编辑  收藏  举报