Interface WrappedKey

A key wrapped for a specific recipient via X3DH-based envelope.

Design note (differs from some implementations): the envelope INCLUDES the initiator's Ed25519 identity public key — without it the recipient cannot complete X3DH. Some legacy envelopes omit this field assuming out-of-band knowledge; here it is explicit so envelopes are self-contained.

interface WrappedKey {
    wrappedKey: Uint8Array;
    iv: Uint8Array;
    ephemeralPublicKey: Uint8Array;
    initiatorIdentityPublicKey: Uint8Array;
    usedOneTimePreKeyId: string;
    v: 1;
}

Properties

wrappedKey: Uint8Array

AES-GCM encrypted target key bytes (GCM tag included).

iv: Uint8Array

12-byte IV.

ephemeralPublicKey: Uint8Array

Initiator's ephemeral X25519 public key (from X3DH).

initiatorIdentityPublicKey: Uint8Array

Initiator's Ed25519 identity public key — needed by the recipient to complete X3DH.

usedOneTimePreKeyId: string

Base64 of the consumed OTK public key — recipient uses it to select their matching OTK private key.

v

Envelope version.