trail/query
https://toip.tools/spec/trail/query/0.1
A watcher or verifier asks a witness for a log's messages and receipts, optionally for a range of sequence numbers. The witness returns them as a CESR text stream.
- Sent
- watcher or verifier witness
- Kind
- Request and response. The response's type is
https://toip.tools/spec/trail/query/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
packages/eventlog/src/tasks.ts:14asquery- Handled in
packages/eventlog/src/tasks.ts- Design
- 10.3 Watchers in
projects/trail/docs/design.md
Payload
{ logId: Qb64; from?: number; to?: number }
Response payload
{ stream: string }
Notes
Qb64 is a string: a CESR primitive in its text form.
Document envelope
Every Trust Task uses this envelope. Replace payload with the structure shown above.
{
"id": "urn:uuid:…",
"type": "https://toip.tools/spec/trail/query/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…"
}
}