Ed25519Signature

data class Ed25519Signature(val publicKey: ByteArray, val signature: ByteArray) : SmartAccountSignature

Ed25519 signature from a traditional keypair.

Ed25519 signatures are 64 bytes and provide strong security guarantees with deterministic signing and built-in resistance to side-channel attacks.

Field ordering in the SCVal map is CRITICAL and must be alphabetical:

  1. public_key

  2. signature

Example:

val ed25519Sig = Ed25519Signature(
publicKey = byteArrayOf(...), // 32-byte Ed25519 public key
signature = byteArrayOf(...) // 64-byte Ed25519 signature
)
val scVal = ed25519Sig.toScVal()

Constructors

Link copied to clipboard
constructor(publicKey: ByteArray, signature: ByteArray)

Properties

Link copied to clipboard

Ed25519 public key (32 bytes).

Link copied to clipboard

Ed25519 signature (64 bytes). Generated by signing a message hash with an Ed25519 private key.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Constant-time equals to prevent timing side-channel attacks on signature data.

Link copied to clipboard
open override fun hashCode(): Int

Custom hashCode implementation that properly handles ByteArray fields.

Link copied to clipboard
open override fun toScVal(): SCValXdr

Converts the Ed25519 signature to a Soroban SCVal map.