---
slug: rooms/records/put
version: "0.6"
extends: "0.5"
title: Rooms Records — Put
summary: "A member writes a record to a data room — a note, a message or a reaction, optionally answering another and carrying a file — authorized by an authority chain the room itself issued rather than by anything the host stores; on an open room all of it is in the clear."
status: draft
targetFrameworkVersion: "0.6.0"
category: access-control
keywords:
  - room
  - record
  - write
  - file
  - blob
  - attenuation
  - encryption
parties:
  - role: Member
    requirement: REQUIRED
    member: issuer
    identifierScope: pairwise
  - role: Host
    requirement: REQUIRED
    member: recipient
proofRequirement:
  requirement: REQUIRED
  rationale: "A write mutates durable shared state that other members will read and act on, and a record naming a blob keeps that blob alive and charged to someone; transport-independent integrity is required."
issuedAtRequirement:
  requirement: REQUIRED
  rationale: "A write is authorized by a presentation whose validity is time-bounded, and a replayed put would restore a superseded record — and with it a reference to a blob a later version had released."
sideEffects:
  level: mutating
  rationale: "Stores or replaces a record in a room, and moves the reference counts of the blobs the old and new versions name."
subjectPath: /roomId
exposure:
  discloses: none
  ingests: personal
  actsAsSubject: false
  rationale: "On an `open` room the host reads record content in the clear. On `attributed` and `private` rooms it receives ciphertext and learns only the key, version, epoch and — when the record carries a file — which stored blob it names. The presentation discloses the acting member on `open` and `attributed`; on `private` it discloses only that some member acted."
maxDocumentBytes:
  request: 2097152
  rationale: "A record is a note, message or reaction, or the description of a file whose content travels as a blob through rooms/blobs/upload/*; 2 MiB of serialized request document, proof and presentation included, admits every record a deployed host accepts today, so no stored record becomes non-conforming, and anything larger belongs in a file."
retention:
  class: durable
  rationale: "A record persists until a member overwrites it or retracts it, and keeps the blob it names stored for as long; outliving the session that wrote it is the point of the task."
errorCodes:
  - code: rooms/records/put:versionConflict
    meaning: "`expectedVersion` did not match. The response carries the current version and record."
    retryable: false
  - code: rooms/records/put:chainTooDeep
    meaning: "The authority chain exceeds the maximum of 8 links."
    retryable: false
  - code: rooms/records/put:subjectBindingMissing
    meaning: "A `private` room presentation omitted the required same-subject proof."
    retryable: false
  - code: rooms/records/put:epochMismatch
    meaning: "The record was sealed under an epoch that is not the room's current one."
    retryable: false
  - code: rooms/records/put:recordTooLarge
    meaning: "The record exceeds the host's per-record limit."
    retryable: false
  - code: rooms/records/put:blobNotFound
    meaning: "A `blobs` entry names no blob committed in this room — never uploaded, still uploading, uploaded to another room, or already collected. Answered identically in every case, so the refusal does not say whether the blob exists elsewhere."
    retryable: false
  - code: rooms/records/put:limitExceeded
    meaning: "The record names an orphaned blob — committed in this room, released by every record, not yet collected — and charging it again would exceed a member or room limit. `details` has the shape of `LimitExceeded` in rooms/_shared/0.1/blobs.schema.json."
    retryable: false
    detailsSchema:
      type: object
      additionalProperties: false
      required: [scope, measure, limit, used, requested]
      properties:
        scope:
          type: string
          enum: [member, room, storage, host]
        measure:
          type: string
          enum: [maxFiles, maxFileBytes, maxBytes]
        limit:
          type: integer
          minimum: 0
        used:
          type: integer
          minimum: 0
        requested:
          type: integer
          minimum: 0
related:
  - rooms/records/get
  - rooms/records/list
  - rooms/records/curate
  - rooms/blobs/upload/begin
  - rooms/blobs/upload/commit
  - rooms/blobs/get
  - rooms/epoch/mint
---

## Abstract

The **Rooms Records — Put** Trust Task writes a record to a **data room**: a shared space
whose access is governed by credentials the *room itself* issues, and whose contents a host
may be unable to read.

The property that distinguishes this family from every other stored-data task in this
registry is that **a host never consults a member list of its own**. Authorization is a
presentation carrying a membership credential and an authority chain, verified against the
room's identifier. A host that speaks this family can therefore host *any* room without
knowing anything about who belongs to it, and a room can move between hosts without a
single credential being reissued.

Version 0.2 let a record **carry a file**. A file is a record plus a blob: the record is an
ordinary record, versioned, curated and sealed as before, whose sealed body describes the
file ([`FileManifest`](../../../_shared/0.1/blobs.schema.json)); the blob is the file's
ciphertext, uploaded beforehand with [`rooms/blobs/upload/*`](../../../blobs/upload/begin/0.2/spec.md)
and named on the record by its `blobRef`. The record is what members see, curate and sync;
the blob is what the host stores and counts.

Version 0.3 lets a record on an **`open`** room say what kind of claim it is and how long it
holds: `basis`, `confidence`, `evidence` and `validFor` (its provenance) and `validUntil` (its
expiry), in `cleartext`. On `attributed` and `private` rooms the same members are carried
inside the sealed, signed [`SealedRecordBody`](../../../_shared/0.1/room.schema.json), where
the host never sees them; nothing about a sealed write changes, and nothing about expiry is
ever in the clear on those tiers.

Version 0.4 lets a record on an **`open`** room **carry a file** too. Until now a file's
description could only travel inside a sealed body, and its key could only be derived from
the room's storage key — and an open room has neither a sealed body nor a group to derive a
key from, so an open room could hold notes and nothing else. Now the description goes in
`cleartext.file`, and with it the file key, which on this tier the uploader mints at random
(`FileManifest.fileKey`). The blob is sealed exactly as on the other tiers, so there is one
blob format and one reader.

Version 0.5 lets a record on an **`open`** room say what it is to a reader, what it
answers, when it was written and when it was last edited: `kind` (a `note`, a `message` or a
`reaction`), `inReplyTo` (another record of the room), `writtenAt` and `editedAt`, in `cleartext`. On `attributed` and `private` rooms the same members are carried
inside the sealed, signed [`SealedRecordBody`](../../../_shared/0.1/room.schema.json), which
defines what they mean on every tier — replies, reactions, ordering, and how a rewrite is an
edit or a withdrawal — and a room's profile says when its writers may start using them (`RoomProfile`,
`recordMembers`).

Version 0.6 says how large a write may be: a host **MUST** accept a request document of up to
2,097,152 bytes (2 MiB), and anything larger is a file. Nothing in the payload changes.

## Status of this Document

This is a **draft** *Trust Task specification* per [SPEC.md §5.3](/SPEC.md#53-maturity-levels); the schema **MAY** change without notice. Feedback via the [issue tracker](https://github.com/trustoverip/dtgwg-trust-tasks-tf/issues).

### What changed from 0.5

The front matter declares `maxDocumentBytes.request`: 2,097,152 bytes (2 MiB) of the serialized request
document as received — the JSON text, `proof` and `presentation` included, no transport
envelope ([SPEC §12.4](/SPEC.md#124-parser-hardening)). No earlier version declared a bound, so
each host applied its own transport default, and a record one host stored another refused: a
room could not move between them without stranding records (#1065). 2 MiB is the largest body a
deployed host accepts today, so every record either host stores stays within the bound; a host
with a smaller limit of its own must now raise it. A larger record carries its content as a file, whose chunks
([`rooms/blobs/upload/chunk/0.2`](../../../blobs/upload/chunk/0.2/spec.md)) declare their own
bound. The bound is two-sided: a host **MUST NOT** refuse a request within it on grounds of
size alone, and **SHOULD** refuse a larger one with the standard `malformedRequest`.

The payload schema is unchanged, so 0.6 keeps everything of 0.5 (`extends: "0.5"`) and a host
still implementing 0.5 reads a 0.6 write as a 0.5 one. It is a new version rather than an edit
because adding the bound to 0.5 in place would retroactively narrow what a 0.5 host must accept.
The response declares no bound.

A host that implements 0.6 **SHOULD** continue to accept 0.5, 0.4, 0.3, 0.2 and 0.1.

### What changed from 0.4 to 0.5

`cleartext` gains four optional members, `kind`, `inReplyTo`, `writtenAt` and `editedAt`,
defined once in [`rooms/_shared/0.1/room.schema.json`](../../../_shared/0.1/room.schema.json)
(`RecordKind`, `RecordReference`, `RecordWrittenAt`, `RecordEditedAt`) and shared with `SealedRecordBody`, so that a message, a reply and a
reaction mean the same thing on every tier. `cleartext` is a closed object in 0.4, so a 0.4
host refuses a record carrying any of them rather than storing it; a writer must know the host
will keep them, and the type URI is how it knows. That is a new member on a closed payload,
a `MINOR` increment, and 0.5 keeps everything of 0.4 (`extends: "0.4"`). The `sealed` path
is unchanged: the same members reach the sealed tiers without a new host version — only
readers and key holders need to know them, and a key holder that signs or seals a body
carrying them for a writer is [`rooms/keys/seal/0.3`](../../../keys/seal/0.3/spec.md), whose
type URI tells a writer, through `trust-task-discovery`, that it will. On every tier a writer uses them only once the
room's profile lists them in `recordMembers` (`RoomProfile`).

A host that implements 0.5 **SHOULD** continue to accept 0.4, 0.3, 0.2 and 0.1.

### What changed from 0.3 to 0.4

`cleartext` gains an optional `file` member, a
[`FileManifest`](../../../_shared/0.1/blobs.schema.json) carrying the file key it was sealed
under in `fileKey` — a member the shared definition gains for this tier — and `blobs` may name
that file's blob. `cleartext` is a closed object in 0.3, so a 0.3 host refuses a record
carrying `file` rather than storing it, and a writer must know the host will keep it and check
it: the type URI is how it knows. That is a new member on a closed payload, a `MINOR`
increment, and 0.4 keeps everything of 0.3 (`extends: "0.3"`). Nothing about a sealed write
changes.

A host that implements 0.4 **SHOULD** continue to accept 0.3, 0.2 and 0.1.

### What changed from 0.2 to 0.3

`cleartext` gains five optional members — `basis`, `confidence`, `evidence`, `validFor` and
`validUntil` — defined once in [`rooms/_shared/0.1/room.schema.json`](../../../_shared/0.1/room.schema.json)
(`RecordBasis`, `RecordConfidence`, `RecordEvidenceList`, `PermittedUse`, `RecordValidUntil`)
and shared with `SealedRecordBody`, so that a record means the same thing on every tier.
`cleartext` is a closed object in 0.2, so a 0.2 host refuses a record carrying any of them
rather than storing it; a writer must know the host will keep them, and the type URI is how it
knows. That is a new member on a closed payload, a `MINOR` increment per
[SPEC §5.2](/SPEC.md#52-compatibility-rules). The `sealed` path is unchanged: a sealed body
already travels as ciphertext the host does not parse, so the same members reach the sealed
tiers without a new host version — only readers and key holders need to know them.

### Why 0.2 was a new version and not an edit to 0.1

 Adding an optional member is ordinarily a
minor, compatible change, and 0.1 is a draft that could take one in place. This one is
not compatible in the direction that matters: a 0.1 host does not know `blobs`, and a
host that ignored it would store a record **pointing at a blob it never checked** — one
that was never uploaded, belongs to another room, or has already been collected — and
would neither keep that blob alive nor charge anyone for it. A producer sending `blobs`
must therefore reach a host that has agreed to enforce it, and the type URI is how it
knows. A host that implements 0.2 **SHOULD** continue to accept 0.1, which cannot name a
blob; a 0.1 rewrite of a record whose current version names a blob releases that blob, as
any rewrite that omits `blobs` does.

## Conformance

[[RFC2119]](https://www.rfc-editor.org/rfc/rfc2119) and [[RFC8174]](https://www.rfc-editor.org/rfc/rfc8174) key-word conventions apply.

A conforming **producer** (the member, or an agent acting under an attenuated credential)
**MUST**:

1. Emit a *Trust Task document* of type `https://trusttasks.org/spec/rooms/records/put/0.6`,
   no larger than the 2,097,152 bytes `maxDocumentBytes.request` declares. A record whose content
   would not fit carries it as a file (item 6).
2. Present the **entire** authority chain, leaf first, ending in a credential issued by the
   room. A producer MUST NOT rely on the host resolving a link it was not given.
3. Seal the record and set `sealed` on an `attributed` or `private` room, or set
   `cleartext` on an `open` one. Exactly one of the two. What is sealed is a
   [`SealedRecordBody`](../../../_shared/0.1/room.schema.json), signed by its author and
   naming this record's `roomId`, `key` and `version`.
4. Bind the sealed record's AEAD associated data to `roomId`, `key`, `version` and `epoch`.
5. On a `private` room, include `presentation.subjectBinding`.
6. When the record carries a file: commit its blob in this room first, put the file's
   [`FileManifest`](../../../_shared/0.1/blobs.schema.json) in the record's body — the
   `file` member of its `SealedRecordBody` on `attributed` and `private` rooms, the `file`
   member of `cleartext` on an `open` one — and name the same `blobRef` in `blobs`.
   A producer **MUST NOT** name a blob in `blobs` that the record's body does not describe:
   on a sealed tier the host cannot tell, and a reader would find a blob kept alive by a
   record that never mentions it.
7. On an `open` room, seal a file's blob under a file key minted for that file alone — 32
   bytes from a cryptographically secure random source, never reused and never derived —
   and carry it in the manifest's `fileKey`, with `epoch` the room's epoch at the time
   (rooms/info). On `attributed` and `private` rooms, derive the key as the manifest
   specifies and **MUST NOT** set `fileKey`.
8. On an `attributed` or `private` room, carry a record's provenance and `validUntil` only
   inside the sealed body, and **MUST NOT** copy any of them into a cleartext member of the
   write — `key` included. A host that can read a record's expiry learns when the room expects
   to stop using it, which is exactly the metadata sealing exists to withhold.
9. **SHOULD** set `basis` (in `cleartext` on an `open` room, in the sealed body otherwise).
   A producer that is an agent writing on its own account and does not know which value
   applies **SHOULD** write `inferred`.
10. Carry a record's `kind`, `inReplyTo`, `writtenAt` and `editedAt` in `cleartext` on an `open` room and
    inside the sealed body otherwise, and on an `attributed` or `private` room **MUST NOT**
    copy any of them into a cleartext member of the write — `key` included. A host that can tell messages from
    notes, or which record answers which, learns the shape of the room's conversation, which
    is metadata sealing exists to withhold. A reaction's `key`, like every key on those tiers,
    is random.
11. **MUST NOT** write `kind`, `inReplyTo`, `writtenAt` or `editedAt`, on any tier, unless the
    room's current profile lists that member in `recordMembers` (`RoomProfile`); absent means
    none. A producer **MAY** rely on a profile it resolved within the room's current epoch.
    **MUST NOT** name a record of kind `reaction` in `inReplyTo`. When rewriting a record it
    **MUST** keep the `kind` and the `writtenAt` of the version it rewrites, and on a reaction
    its `inReplyTo`, and, where the profile lists it, **MUST** set `editedAt`, which the first version of a record never
    carries (`SealedRecordBody`, *Edits*).
12. To withdraw its own `message`, write a new version of it with an empty `body` and no
    `file`; to withdraw its own reaction, write a new version with an empty value of every
    reaction record it holds with that value and target. Reacting again with a value it already holds on the
    same target, it **SHOULD** rewrite that record rather than write a second
    (`SealedRecordBody`, *Counting reactions*).

A conforming **consumer** (the host) **MUST**:

1. Verify every link in the chain, and **reject the chain if any link widens** what its
   parent conferred — in actions, in scope, or in validity period. A host that verifies only
   the presented credential has verified nothing: anyone can mint a well-formed authority
   credential naming any scope, and what makes it worthless is that its chain does not reach
   the room.
2. Reject a chain of more than **8** links. Verification is linear in chain length and runs
   on every operation.
3. **Never dereference** a chain link's `parent` over the network. Doing so would make
   verification depend on availability, turn the identifier into a request the host can be
   induced to make against an address the *producer* chooses, and signal credential use to
   whoever hosts that identifier.
4. On a `private` room, **reject a presentation with no `subjectBinding`**. Without it two
   parties pool credentials — one contributes membership, the other authority — and the
   combination verifies as a single party holding both.
5. Reject a record sealed under an epoch that is not current.
6. Return the current version and record with a `versionConflict`, rather than a bare
   rejection.
7. Refuse with `blobNotFound` a record whose `blobs` names any blob that is not committed
   **in this room**. A record can never point at nothing, at an upload still in progress, or
   at another room's file. The refusal is the same whichever of those holds.
8. Keep a **reference count** per blob, changed atomically with the record write:
   - a put whose new version names a blob the previous version did not **references** it;
   - a put whose new version omits a blob the previous version named **releases** it;
   - a retraction ([`rooms/records/curate`](../../curate/0.1/spec.md) to `retracted`)
     releases every blob the record named, since a tombstone keeps no body.

   A blob whose count reaches zero is **orphaned**. It **MUST** stop counting against the
   room's and its uploader's usage at once — a member who deletes a file has the space
   back immediately — and **MAY** be deleted from storage after a grace window the host
   chooses. Deprecating a record releases nothing: its body is retained, and so is its file.
9. Accept a record naming a blob another record of the same room already names. The count
   is per blob, not per record, so two records sharing one blob is well-defined, and a blob
   is orphaned only when the last of them releases it.
10. Treat a record naming an **orphaned** blob not yet collected as re-referencing it, and
    charge it again exactly as a new upload of that blob would be charged: to the subject at
    the root of the presented chain, checked against the member's and the room's file counts
    and totals with the blob added. If it would not fit, refuse the whole put with
    `limitExceeded` and change nothing. Orphaning credited the space back at once (item 8);
    re-referencing without a check would let a room exceed its limits by reviving what it
    had released.
11. Store `basis`, `confidence`, `evidence`, `validFor` and `validUntil` on an `open` room's
    record exactly as received, serve them back with it, and **MUST NOT** act on them: a host
    does not hide, refuse, demote or delete a record because its `validUntil` has passed, and
    does not resolve or fetch anything `evidence` names. Expiry is a reader's rule on every
    tier, so that the open tier behaves as the sealed ones must.
12. On an `open` room, which it can read, refuse with the standard `malformedRequest` a record
    whose `blobs` is not exactly `cleartext.file.blobRef` when `cleartext.file` is present, or
    names any blob when it is absent, or whose `cleartext.file` has no `fileKey` — before the
    `blobNotFound` check and without changing anything. On the sealed tiers it cannot see the
    body and checks only item 7.
13. Store an open room's `cleartext.file` exactly as received and serve it back with the
    record. A host that decides by policy that a room takes no files refuses the upload
    ([`rooms/blobs/upload/begin`](../../../blobs/upload/begin/0.2/spec.md)), not the record.
14. Store `kind`, `inReplyTo`, `writtenAt` and `editedAt` on an `open` room's record exactly as
    received, serve them back with it, and **MUST NOT** act on them: a host does not refuse,
    order or group a record by its `kind`, `writtenAt` or `editedAt`, does not check that a
    rewrite keeps `kind` or `inReplyTo` or that an empty `body` comes from the record's author
    (beyond what item 15 permits), does not check that `inReplyTo` names a record
    it holds or what kind that record is, and does not check a write against the room's
    `recordMembers`. Those are writers' and readers' rules. What
    they mean is a reader's rule (`SealedRecordBody`), on every tier.
15. **MAY**, on an `open` room only, refuse with the standard `permissionDenied` a new version of
    a record whose current version's `cleartext.kind` is `message` or `reaction` when the author
    the host authenticated for the write is not the record's **original author** — the author it
    recorded for the record's first version (item 17) — and if it does, **MUST** refuse before changing
    anything. A host that refuses so still accepts the original author's own rewrites, the empty
    version that withdraws a message or a reaction included, and refuses nothing on a tombstone,
    whose `kind` is gone. This is the one place a host reads `kind`; on an `open` room it reads
    the whole body anyway. On an `attributed` or `private` room a host **MUST NOT** attempt it:
    there `kind` is sealed in the body, which the host cannot read, and a producer must not copy
    it into the clear (Producer item 10). The defence on those tiers is the readers'
    (`SealedRecordBody`, *What a new version keeps*, *Counting reactions*, *Withdrawing a
    message*).
16. Record, when it stores a record's first version, the instant it did so, and keep it
    unchanged across every later version and every curation, retraction included; it serves it
    as `createdAt` ([`rooms/records/list/0.8`](../../list/0.8/spec.md), `RecordMetadataV3`), and
    readers measure a record's `writtenAt` against it. Record also, with every put that stores a
    body, the instant it did so, and serve it as `bodyStoredAt` for the version carrying that
    body: a curation, and anything else that moves a record's version without storing a new
    author-signed body, leaves it unchanged, and for a record's first version it equals
    `createdAt`. It knows which task wrote each version, so it does this on every tier. Readers
    verify the author's proof against the DID document as it stood at `bodyStoredAt`. A host that
    holds records or versions stored before it kept these times **MUST NOT** supply one for them.
17. On an `open` or `attributed` room, record, when it stores a record's first version, that
    version's author — the party it authenticated for the write — and keep it unchanged as item
    16 keeps the time; it serves it as `createdBy`, and readers use it to tell a rewrite by
    another member from the original author's own (`SealedRecordBody`, *The record's original
    author*). On a `private` room it records no author and **MUST NOT** serve one. Item 15 uses
    the same author. A host that holds records stored before it kept the author **MUST NOT**
    supply one for them.
18. Accept a request document of up to 2,097,152 bytes (`maxDocumentBytes.request`), and
    **SHOULD** refuse a larger one with the standard `malformedRequest`. `recordTooLarge` stays
    the refusal for a record within that bound that exceeds a smaller per-record limit of the
    host's own.
19. Refuse an unauthorized presentation with the standard `permissionDenied`; an authorization refusal is the framework standard `permissionDenied` ([SPEC §8.3](/SPEC.md#83-standard-error-codes)), which this specification does not shadow with a task-specific code.

A conforming host **MUST NOT** require a session or account of its own as a condition of
serving a `private` room. Authorizing by session would record which member acted on every
operation, and a period of such records reconstructs the membership the tier exists to
withhold — without breaking any cryptography.

## Authorization

Authority is **conferred by the room**, never by the host: the presentation's authority
chain, verified link by link to a credential the room issued, must confer `write` at this
room's scope, and its leaf's subject must be the party the host authenticated for this
request. The host consults no access-control list of its own (the family's invariant that
room authorization never uses host ACLs). Naming a blob needs no further authority: the
blob was committed in this room by someone the room authorized to write, and the reference
only keeps it stored.

## Definitions

- **Provenance** — `basis`, `confidence`, `evidence` and `validFor`: what kind of claim a
  record is, how sure its author is, what it cites, and what it may be used for. Defined in
  [`rooms/_shared/0.1/room.schema.json`](../../../_shared/0.1/room.schema.json), where
  `SealedRecordBody` states the rules a reader applies to them. Display and weighting only,
  never authority.
- **`validUntil`** — when the author stops standing behind the record as current. Readers hide
  an expired record by default; no host enforces it.
- **Record**, **authority chain**, **presentation**, **epoch** — as in
  [`rooms/_shared/0.1/room.schema.json`](../../../_shared/0.1/room.schema.json).
- **Blob**, **`blobRef`**, **file manifest** — as in
  [`rooms/_shared/0.1/blobs.schema.json`](../../../_shared/0.1/blobs.schema.json).
- **Committed in this room** — uploaded through `rooms/blobs/upload/*` with this `roomId`,
  verified against its manifest at commit, and not yet collected.
- **Orphaned** — committed, but named by no current record version.

## Request

A member (`issuer`) writes to the room's host (`recipient`). The payload is the top-level
schema in [`payload.schema.json`](payload.schema.json).

### A sealed record carrying one file

The file's description — its name, type, plaintext size and digest, and the same `blobRef`
— is inside `sealed.ciphertext`. Only the reference is in the clear.

```json
{
  "id": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2a10",
  "type": "https://trusttasks.org/spec/rooms/records/put/0.6#request",
  "issuer": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK",
  "recipient": "did:web:rooms.northwind.example",
  "issuedAt": "2026-10-10T09:30:00Z",
  "threadId": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2aff",
  "payload": {
    "roomId": "did:webvh:QmRoom:rooms.northwind.example:deal",
    "key": "giXFLTGBdnnQJRoIsktuIg",
    "presentation": {
      "membership": "eyJhbGciOiJFZERTQSJ9.membership.sig",
      "authority": [
        "eyJhbGciOiJFZERTQSJ9.authority-leaf.sig",
        "eyJhbGciOiJFZERTQSJ9.authority-root.sig"
      ]
    },
    "expectedVersion": 0,
    "sealed": {
      "ciphertext": "c2VhbGVkLXJlY29yZC1ib2R5LXdpdGgtZmlsZS1tYW5pZmVzdA",
      "nonce": "AAAAAAAAAAAAAAAB",
      "epoch": 7
    },
    "blobs": [
      "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
    ]
  }
}
```

### An open room's record carrying a file

The file was uploaded first, sealed under a key the writer minted for it. The record names the
blob and describes the file in the clear — the key included, since an open room's host reads
its records — so any member, and the host, can open it. Whoever holds only the storage sees
ciphertext.

```json
{
  "id": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2a30",
  "type": "https://trusttasks.org/spec/rooms/records/put/0.6#request",
  "issuer": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK",
  "recipient": "did:web:rooms.northwind.example",
  "issuedAt": "2026-10-30T09:30:00Z",
  "threadId": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2adf",
  "payload": {
    "roomId": "did:webvh:QmOpen:rooms.northwind.example:public",
    "key": "brochures/2026",
    "presentation": {
      "membership": "eyJhbGciOiJFZERTQSJ9.membership.sig",
      "authority": [
        "eyJhbGciOiJFZERTQSJ9.authority-leaf.sig",
        "eyJhbGciOiJFZERTQSJ9.authority-root.sig"
      ]
    },
    "expectedVersion": 0,
    "cleartext": {
      "title": "2026 brochure",
      "body": "",
      "file": {
        "fileId": "q0Kf7m3xV2s9Yh1cT8bN4wL6pR5dE2uJ7aZ0iO3gH1k",
        "name": "brochure-2026.pdf",
        "mediaType": "application/pdf",
        "size": 482113,
        "digest": "zQmeX7fPr6A8m5jF9XKfXgGv3cP4qTn2Cb6XnPLtE9hVjqD",
        "epoch": 1,
        "segmentSize": 65520,
        "blobRef": "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR",
        "fileKey": "Xv4Qn8pL2mW7rT1yU9sK3dF6gH0jB5cZ8aE2iO4uY7w"
      }
    },
    "blobs": [
      "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
    ]
  }
}
```

### An open room's message, answering another

A member answers a message in the room's conversation. The answer is a `message` with its
words in `body` and no `title`; `inReplyTo` names the message it answers, and `writtenAt`
is when its author wrote it. The room's profile lists all three in `recordMembers`. A reaction is the
same shape with `kind: "reaction"` and a short value in `body`.

```json
{
  "id": "urn:uuid:2f6a9c1e-8b4d-4e0a-9d3c-5a7e1b2c3d4e",
  "type": "https://trusttasks.org/spec/rooms/records/put/0.6#request",
  "issuer": "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH",
  "recipient": "did:web:rooms.northwind.example",
  "issuedAt": "2026-11-04T10:15:00Z",
  "threadId": "urn:uuid:2f6a9c1e-8b4d-4e0a-9d3c-5a7e1b2c3d4f",
  "payload": {
    "roomId": "did:webvh:QmOpen:rooms.northwind.example:account-notes",
    "key": "q1Zr8mVbT0yWl3nK5xHc2A",
    "presentation": {
      "membership": "eyJhbGciOiJFZERTQSJ9.membership.sig",
      "authority": [
        "eyJhbGciOiJFZERTQSJ9.authority-leaf.sig",
        "eyJhbGciOiJFZERTQSJ9.authority-root.sig"
      ]
    },
    "cleartext": {
      "kind": "message",
      "body": "Agreed — let's hold the discount until they sign.",
      "inReplyTo": { "key": "Hc7pY2wQe9tLmB4sVn1KxA", "version": 41 },
      "writtenAt": "2026-11-04T10:14:52Z",
      "basis": "declared"
    }
  }
}
```

### An open room's record, saying what kind of claim it is and when it lapses

An agent writing on its own account records an inference, cites the meeting note it drew it
from, limits its use, and lets it lapse at the end of the quarter. On an `open` room all of it
is in the clear and unsigned; on the sealed tiers the same members would be inside the sealed
body, signed by the agent.

```json
{
  "id": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2a20",
  "type": "https://trusttasks.org/spec/rooms/records/put/0.6#request",
  "issuer": "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH",
  "recipient": "did:web:rooms.northwind.example",
  "issuedAt": "2026-10-10T09:40:00Z",
  "threadId": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2aef",
  "payload": {
    "roomId": "did:webvh:QmOpen:rooms.northwind.example:account-notes",
    "key": "customer/price-sensitivity",
    "presentation": {
      "membership": "eyJhbGciOiJFZERTQSJ9.membership.sig",
      "authority": [
        "eyJhbGciOiJFZERTQSJ9.agent-write.sig",
        "eyJhbGciOiJFZERTQSJ9.authority-root.sig"
      ]
    },
    "cleartext": {
      "title": "Customer is price-sensitive",
      "body": "Pushed back twice on list price; accepted the annual discount immediately.",
      "basis": "inferred",
      "confidence": 0.6,
      "evidence": [
        { "kind": "record", "key": "meetings/2026-10-08", "version": 3 }
      ],
      "validFor": {
        "purposes": ["https://w3id.org/dpv#ServicePersonalisation"],
        "note": "renewal negotiation only"
      },
      "validUntil": "2026-12-31T23:59:59Z"
    }
  }
}
```

## Response

The host (`recipient` of the request, now responding) answers with the sub-schema reachable
via `$anchor: "response"` in [`payload.schema.json`](payload.schema.json): the record's key,
the version assigned and the epoch it is stored under. Failures use `trust-task-error`.

### Stored

```json
{
  "id": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2a11",
  "type": "https://trusttasks.org/spec/rooms/records/put/0.6#response",
  "issuer": "did:web:rooms.northwind.example",
  "recipient": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK",
  "issuedAt": "2026-10-10T09:30:01Z",
  "threadId": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2aff",
  "payload": {
    "key": "giXFLTGBdnnQJRoIsktuIg",
    "version": 42,
    "epoch": 7
  }
}
```

### Refused: the blob is not in this room

```json
{
  "id": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2a12",
  "type": "https://trusttasks.org/spec/trust-task-error/0.5",
  "issuer": "did:web:rooms.northwind.example",
  "recipient": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK",
  "issuedAt": "2026-10-10T09:30:01Z",
  "threadId": "urn:uuid:7d0b3a52-1f6e-4c1b-9a51-0d0f3f3c2aff",
  "payload": {
    "code": "rooms/records/put:blobNotFound",
    "message": "No blob with that reference is committed in this room.",
    "retryable": false
  }
}
```

## Security & Privacy

**What the room's commitment does not yet cover.** The leaf preimage of `CommittedRecord`
([`rooms/_shared/0.1/room.schema.json`](../../../_shared/0.1/room.schema.json)) predates
`blobs` and does not commit to it. The integrity of a file does not depend on it: the
`blobRef` is inside the sealed body the author signed, so a reader detects a substituted or
missing blob regardless. What the commitment does not cover is **retention metadata** — which
blobs a record keeps alive — so a host that dropped `blobs` from a record could orphan its
file without the commitment showing it, although readers would still find the file missing.
Committing to `blobs` is left to a future version of `CommittedRecord`.

**A host verifies chains; it does not keep a roster.** Authorization is decided entirely by
credentials the room issued. A host that consults state of its own has made the room
unmovable and has made itself part of the membership.

**Chain verification is the security of this family.** Anyone can mint a well-formed
authority credential naming any scope and any actions; what makes it worthless is that its
chain does not reach the room. Every link is verified, and any link that widens actions,
scope, or validity beyond its parent invalidates the chain. Chain depth is capped at 8,
and parents are never dereferenced, for the reasons given under Conformance.

**A record can only name what this room holds.** Without the `blobNotFound` check a member
of one room could reference — and so keep alive, and be served — a blob uploaded to another
room on the same host, or claim a file that was never uploaded. The check is against
blobs committed *in this room*, and its answer is the same whether the blob exists
elsewhere or nowhere, so it is not an oracle for other rooms' contents.

**The host cannot substitute a file.** The `blobRef` in the clear is also inside the sealed
body the author signed, beside the plaintext digest. A host serving a different blob under
the record is caught by the reader: either the ciphertext does not match the manifest the
`blobRef` names, or the decrypted bytes do not match the signed digest.

**An open room's file is the host's word, and readable by it.** On an `open` room the manifest
— key included — is in the clear and unsigned, like the rest of the record. The host, and
anyone it serves the record to, can open the file; and a host could replace the manifest and
the blob together, as it could rewrite any open record. What the file key in the clear still
does is keep the stored blob opaque to a party that holds only the storage — a bucket
operator, a backup — and keep one blob format and one reader for every tier. A room whose
files must be attributable to their author, or withheld from the host, uses a sealed tier.
A writer **MUST NOT** reuse a file key: the STREAM nonces are counters, and two files under
one key break its confidentiality against the storage too.

**Credential pooling.** Where membership and authority are presented with the subject
withheld, a host that does not require proof that both describe the same subject lets two
parties combine one's membership with the other's authority and present as a single party
holding both.

**A rotated-away key cannot sign a version that verifies.** A reader verifies a version's
proof against the author's DID document as it stood at `bodyStoredAt` (Host item 16), the time
the host stored that version's body — not at the proof's `created`, which the author sets. A key
rotated away before `bodyStoredAt` is not in that document, so a version it signs does not
verify. That is what stops a compromised old key from backdating a record, or editing one, past
its rotation: the time it is judged at is the host's, not the author's. A host colluding with the
holder of such a key could stamp a false time; a reader that resolves the author's DID with
history cannot detect that, but nor can the key's holder achieve it without the host. Where the
author's DID method keeps no history a reader has only the current document, and shows a
version that fails against it as a placeholder rather than its content (`SealedRecordBody`,
*Which DID document*).

**Provenance is a claim, not a credential.** On an `open` room nothing in `cleartext` is
signed, so a `basis` of `verified` there is the writer's word as stored by the host, and a
host could alter it. A room that needs provenance a reader can attribute to its author uses a
sealed tier, where the members are inside the author's signature. On every tier they confer no
authority: they describe the record, they do not authorize anything done with it.

**Any member with `write` can replace another member's record.** A rewrite is a put under the
same key, and nothing in this task requires a host to check that it comes from the author of the
version it replaces. On an `open` room a host MAY refuse another author's new version of a
message or a reaction (Host item 15), since it reads `kind` there anyway. On `private` a host
cannot know the author, and on `attributed`, which knows it, the host cannot see the record's
`kind` to tell a message from a shared note — `kind` is sealed, and copying it into the clear to
let the host check would disclose the shape of the room's conversation (Producer item 10). Readers hold the line where they can. A new version must
keep its `kind`, and a reaction its `inReplyTo`; a withdrawal counts only when it comes from the
author of the version it replaces; and a version whose `author` differs is shown under its new
author, never as an edit by the earlier one (`SealedRecordBody`, *Edits*, *What a new version
keeps*, *Counting reactions*, *Withdrawing a message*). Every one of those checks compares the
new version with an earlier one. **A reader seeing a record for the first time cannot detect
that another member replaced it** on a tier where the host does not check authorship: it sees
only the current version, signed by whoever wrote it, and has nothing to compare it with —
unless an `open` room's host refuses such rewrites, which a reader cannot tell from outside. It
can show who wrote what it sees — and on the sealed tiers that attribution is exact — but not
whose record that version replaced.

### Data carried

On an `open` room, the record itself in the clear — including its provenance and expiry,
which the host can index like any other member, and, when it carries a file, the file's name,
media type, size, plaintext digest and key, so that the host can read the file. A producer **MUST NOT** put personal data in
`validFor.note` or a credential in `evidence`; `evidence` carries a credential's identifier,
never the credential. On `attributed` and `private` rooms, only
ciphertext plus its key, version and epoch — and, when the record carries a file, the
`blobRef` in the clear. That discloses to the host **that the record has a file**, and,
through the blob it names, **the file's ciphertext size**; never its name, type, contents or
plaintext digest, which are sealed. A room that wants sizes blurred pads its files
(`FileManifest.padding`). The presentation names the acting member on `open` and
`attributed`; on `private` it does not.

### Correlation

On `attributed`, a host can build a per-member write history, now including which members
attach files and how large they are. On `private` it cannot attribute writes, but it still
sees when they happen, how large records and blobs are, and from where. A `blobRef` is a
digest of ciphertext under a per-file key, so two rooms holding the same document hold
different blobs, and rooms cannot be linked by the files they share.

### Retention

Records are durable by design and persist until overwritten or retracted. `validUntil` does
not change that: an expired record is hidden by readers and still stored, until a member with
`curate` retracts it. A retraction is a
tombstone: the body goes, the key and version stay, and every blob the record named is
released. On an `open` room the body is `cleartext`, so a tombstone keeps none of it — `kind`,
`inReplyTo`, `writtenAt` and `editedAt` included — exactly as on the sealed tiers; a reader
places a tombstone by the version of the record it held before, if any (`SealedRecordBody`,
*Tombstones*). A member's withdrawal of their own message or reaction is a rewrite, not a
retraction: the record keeps its key and its place. A released blob stops counting against usage at once and is deleted from storage
after the host's grace window. On a store that publishes ciphertext, deletion frees the
storage but cannot recall copies already made; there the only erasure is cryptographic —
pruning the epoch chain so nobody can derive the file key.

### Consent/purpose

A member writes into a room they joined by accepting an invitation; the membership
credential pair is that consent. Nothing here authorizes a host to read, index, scan or
derive from record or file content beyond storing it and serving it back — which, on the
sealed tiers, it could not do anyway. On an `open` room that includes the files: a host can
open them, and is still authorized only to store and serve them.
