# mesh-demo/door/open

https://toip.tools/spec/mesh-demo/door/open/0.1

A guest asks a door to open, with no internet. The request carries a guest pass (a credential the building issued) and the nonce from the door's signed challenge beacon, so the signed request can't be replayed later. The door checks the pass offline: its signature, that the sender holds it, that it's for this door, the cached revocation list and its age, and the time window. It answers open or refused, with a reason.

- **Sent**: guest → door
- **Kind**: Request and response. The response's type is `https://toip.tools/spec/mesh-demo/door/open/0.1#response`.
- **Envelope**: Signed by the issuer, addressed to one recipient, timestamped, and encrypted in a TSP Direct message. The signature and recipient binding prevent its use as a bearer token.
- **Defined in**: [`projects/mesh/src/door.ts:23`](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/mesh/src/door.ts#L23) as `DOOR_OPEN`
- **Handled in**: [`projects/mesh/src/door.ts`](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/mesh/src/door.ts)
- **Design**: [4.2 The MVP demo](https://github.com/yourbuddyconner/toip-tools/blob/main/projects/mesh/docs/design.md#42-the-mvp-demo) in `projects/mesh/docs/design.md`

Source documentation: “Request \`{credential, challenge}\`, response \`{open, reason?}\` (design §16).”

## Payload

projects/mesh/src/door.ts:25:

```ts
export interface DoorRequest {
  credential: GuestPass;
  /** The beacon's nonce, base64url. Signing the request signs it with the pass key. */
  challenge: string;
}
```

## Response payload

projects/mesh/src/door.ts:31:

```ts
export interface DoorAnswer {
  open: boolean;
  reason?: string;
}
```

## Notes

It travels over LoRa in the CTT1 compact form: about 670 bytes on the air in 3 frames, against about 2.1 KB as JSON. The mesh-demo/ prefix marks it as the demo's own type.

## Document envelope

Every Trust Task uses this envelope. Replace `payload` with the structure shown above.

Shape of a document of this type:

```json
{
  "id": "urn:uuid:…",
  "type": "https://toip.tools/spec/mesh-demo/door/open/0.1",
  "issuer": "did:key:… (the sender)",
  "recipient": "did:key:… (the receiver)",
  "issuedAt": "2026-11-06T18:00:00.000Z",
  "payload": { … },
  "proof": {
    "type": "DataIntegrityProof",
    "cryptosuite": "eddsa-jcs-2022",
    "verificationMethod": "did:key:…#…",
    "proofPurpose": "assertionMethod",
    "proofValue": "z…"
  }
}
```

---

This is the Markdown version of https://toip.tools/spec/mesh-demo/door/open/0.1/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
