Skip to content

Function: sealPreimage()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / sealPreimage

sealPreimage(tenantId, scopeId, commitment): string

Defined in: src/utils/audit-headers.ts:219

The exact text a seal signature is computed over.

string

The tenant UUID in canonical lowercase, hyphenated form.

string

The scope UUID in canonical lowercase, hyphenated form.

string

The scope’s Merkle commitment (64 lowercase hex digits).

string

The versioned domain tag, tenant UUID, scope UUID and commitment, each followed by a newline. Sign the UTF-8 bytes with Ed25519.

Mirrors seal_preimage in the engine (crates/domain/src/ports/seal_signature.rs). The tenant is bound explicitly, so a signature over an empty scope’s commitment cannot be replayed in another tenant. Send the signature and the public key as AuditCausalHeaders.sealSignature and AuditCausalHeaders.sealSigner, both base64.

const message = new TextEncoder().encode(sealPreimage(tenantId, scope, commitment));