Function extractPublicKey

  • Recover the public key of the account used to create the given Ethereum signature. The message must have been signed using the personalSign function, or an equivalent function.

    Parameters

    • options: {
          data: ToBufferInputTypes;
          signature: string;
      }

      The public key recovery options.

      • data: ToBufferInputTypes

        The hex data that was signed.

      • signature: string

        The '0x'-prefixed hex encoded message signature.

    Returns string

    The '0x'-prefixed hex encoded public key of the message signer.