Skip to content

ed25519PublicKeyToNearAddress()

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / ed25519PublicKeyToNearAddress

ed25519PublicKeyToNearAddress(publicKey): string

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

Convert ed25519 public key to NEAR implicit account address

NEAR implicit accounts are lowercase hex-encoded ed25519 public keys (64 characters). No prefix, just raw 32 bytes as lowercase hex.

`0x${string}`

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

string

NEAR implicit account address (64 lowercase hex characters, no prefix)

If public key is invalid

const { stealthAddress } = generateEd25519StealthAddress(metaAddress)
const nearAddress = ed25519PublicKeyToNearAddress(stealthAddress.address)
// Returns: "ab12cd34..." (64 hex chars)