src/sigs.js
// Signature and the associated message hash.
Signature and the associated message hash.
Signature and the associated message hash .
function recoverPubkey(msgHash, rsvStr) {
  const { v, r, s } = extractVRS(rsvStr);
  const rawKey = ethUtil.ecrecover(
    Buffer.from(msgHash),
    v,
    Buffer.from(r),
    Buffer.from(s)
  );
  const prefixedKey = utils.concatUint8Arrays(
    new Uint8Array([0x04]),
    rawKey
  );
  return publicKeyConvert(Buffer.from(prefixedKey));
}
function recoverPubkey ( msgHash , rsvStr ) { const { v , r , s } = extractVRS ( rsvStr ) ; const rawKey = ethUtil . ecrecover ( Buffer . from ( msgHash ) , v , Buffer . from ( r ) , Buffer . from ( s ) ) ; const prefixedKey = utils . concatUint8Arrays ( new Uint8Array ( [ 0x04 ] ) , rawKey ) ; return publicKeyConvert ( Buffer . from ( prefixedKey ) ) ; }
Signature and the associated message hash.
Signature and the associated message hash .
// Ethereum pubkeys are raw (unprefixed). 0x04 is the standard prefix for an // uncompressed public key. Many libraries will not handle unprefixed keys.