Skip to content

ed25519PublicKeyToAptosAddress()

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / ed25519PublicKeyToAptosAddress

Function: ed25519PublicKeyToAptosAddress()

Section titled “Function: ed25519PublicKeyToAptosAddress()”

ed25519PublicKeyToAptosAddress(publicKey): string

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

Convert an ed25519 public key to an Aptos address

Aptos address derivation:

  1. Take the 32-byte ed25519 public key
  2. Append the scheme byte (0x00 for single signature)
  3. Hash with SHA3-256: address = sha3_256(pubkey || 0x00)
  4. Encode as 0x-prefixed hex string (64 characters)

`0x${string}`

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

string

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

If public key is invalid

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