Skip to content

ed25519PublicKeyToSuiAddress()

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / ed25519PublicKeyToSuiAddress

ed25519PublicKeyToSuiAddress(publicKey): string

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2684

Convert an ed25519 public key to a Sui address

Sui address derivation:

  1. Take the 32-byte ed25519 public key
  2. Prepend the scheme byte (0x00 for ED25519)
  3. Hash with BLAKE2b-256: address = blake2b_256(0x00 || pubkey)
  4. Encode as 0x-prefixed hex string (64 characters)

`0x${string}`

32-byte ed25519 public key as hex string (with 0x prefix)

string

Sui address (0x-prefixed, 64 hex characters)

If public key is invalid

const suiAddress = ed25519PublicKeyToSuiAddress('0xabc123...')
// Returns: "0x1234...abcd" (64 hex chars)