OZEd25519Signature

public struct OZEd25519Signature : OZSmartAccountSignature, Hashable

An Ed25519 signature produced by a traditional Ed25519 keypair.

Ed25519 signatures are 64 bytes and provide deterministic signing with strong side-channel resistance.

The publicKey field is retained on this struct for local signature verification inside the multi-signer pipeline before submission. It is not transmitted in the auth payload: the OZ Ed25519 verifier contract looks up the public key from the on-chain External(verifier, key_data) signer storage. Only the raw 64-byte signature is placed in the payload.

  • Ed25519 public key (SmartAccountConstants.ed25519PublicKeySize bytes).

    Used for local pre-submission signature verification only. Not transmitted in the auth payload.

    Declaration

    Swift

    public let publicKey: Data
  • Ed25519 signature (64 bytes).

    Declaration

    Swift

    public let signature: Data
  • Initializes a new OZEd25519Signature.

    Throws

    SmartAccountValidationException.InvalidInput when publicKey is not 32 bytes or signature is not 64 bytes.

    Declaration

    Swift

    public init(publicKey: Data, signature: Data) throws

    Parameters

    publicKey

    32-byte Ed25519 public key (used for local verification only).

    signature

    64-byte Ed25519 signature.

  • Returns the raw 64-byte Ed25519 signature as SCValXDR.bytes.

    The OZ Ed25519 verifier contract expects BytesN<64> directly as the per-signer sig_data in the AuthPayload.signers map. The public key is supplied separately by the smart account contract from its on-chain External(verifier, key_data) storage and is NOT transmitted in the auth payload.

    Declaration

    Swift

    public func toScVal() -> SCValXDR

    Return Value

    SCValXDR.bytes(signature) — the raw 64-byte signature.

  • See toAuthPayloadBytes() for the per-variant byte format.

    Declaration

    Swift

    public func toAuthPayloadBytes() throws -> Data

    Return Value

    The raw 64-byte signature field.

  • Uses constant-time byte comparison via Data.constantTimeEquals — see that extension for the timing-attack rationale.

    Declaration

    Swift

    public static func == (lhs: OZEd25519Signature, rhs: OZEd25519Signature) -> Bool
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)