pub struct Envelope {
pub car_enc: String,
pub nonce: String,
pub ct: String,
pub kid: Option<u64>,
}Expand description
The ciphertext form of a payload — what the relay stores and sees. Cleartext
op_id/seq/hlc/scope/surface metadata lives outside this, on the
crate::oplog::OpRecord; the envelope hides only the payload body.
Fields§
§car_enc: StringAlgorithm tag (ALG_CHACHA20POLY1305).
nonce: StringThe 96-bit AEAD nonce, hex (24 chars). Random per encryption, so the same plaintext encrypts to distinct ciphertext each time.
ct: StringThe ciphertext ‖ Poly1305 tag, hex.
kid: Option<u64>Org key-id (rotation EPOCH). ONLY the multi-epoch org cipher sets it, so a remaining member can select the right per-epoch key after a rotation instead of trial-decrypting. Personal / wrap envelopes omit it.
skip_serializing_if is LOAD-BEARING: personal envelopes stay byte-identical
(the field never serializes), AND wrap_org_key signs canonical_json(envelope)
— so an always-omitted kid keeps every Ed25519 wrap signature valid. Do NOT
drop skip_serializing_if, and do NOT add deny_unknown_fields.