publicKeyToEthAddress()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / publicKeyToEthAddress
Function: publicKeyToEthAddress()
Section titled “Function: publicKeyToEthAddress()”publicKeyToEthAddress(
publicKey):`0x${string}`
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:4059
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}`
Returns
Section titled “Returns”`0x${string}`