examples/ethereum_key_recovery/key_recovery.rb
# Recover public key for this recoverable signature.
#
# @param message [PersonalMessage] The message to verify the signature against.
# @return [String] public key address corresponding to the public key recovered.
Recover public key for this recoverable signature.
Recover public key for this recoverable signature .
def recover_public_key(message)
    ctx = Secp256k1::Context.new
    recovery_id = Chains.to_recovery_id(@v, @chain_id)
    recoverable_signature = ctx.recoverable_signature_from_compact(@signature, recovery_id)
    public_key_bin = recoverable_signature.recover_public_key(message.hash).uncompressed
    public_key_to_address(public_key_bin)
  end
def recover_public_key ( message ) ctx = Secp256k1 :: Context . new recovery_id = Chains . to_recovery_id ( @v , @chain_id ) recoverable_signature = ctx . recoverable_signature_from_compact ( @signature , recovery_id ) public_key_bin = recoverable_signature . recover_public_key ( message . hash ) . uncompressed public_key_to_address ( public_key_bin ) end
Recover public key for this recoverable signature.
Recover public key for this recoverable signature .
public key address corresponding to the public key recovered.
public key address corresponding to the public key recovered .
String
message
The message to verify the signature against.
The message to verify the signature against .