publicKeyToEthAddress()
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / publicKeyToEthAddress
Function: publicKeyToEthAddress()
Section titled “Function: publicKeyToEthAddress()”publicKeyToEthAddress(
publicKey):`0x${string}`
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:1452
Convert a secp256k1 public key to an Ethereum address
Algorithm (EIP-5564 style):
- Decompress the public key to uncompressed form (65 bytes)
- Remove the 0x04 prefix (take last 64 bytes)
- keccak256 hash of the 64 bytes
- Take the last 20 bytes as the address
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”`0x${string}`
Compressed (33 bytes) or uncompressed (65 bytes) public key
Returns
Section titled “Returns”`0x${string}`
Ethereum address (20 bytes, checksummed)