Legal marketplace and professional workflows: competitive bidding, lawyer verification, privileged case offices, document management, and payment. Built on per-jurisdiction Matrix spaces.
Anonymous competitive bidding for legal services, with architectural isolation between proposals.
6 events for the competitive legal bidding workflow.
Client posts a legal brief to a jurisdiction’s Brief Board room. The brief is anonymised — lawyer cannot identify the client until a proposal is accepted.
| Field | Type | Description |
|---|---|---|
| brief_id | string | Unique brief identifier |
| jurisdiction | string | Jurisdiction code (e.g., SE, DE, US-NY) |
| area_of_law | string | Legal area (e.g., corporate, immigration, compliance) |
| summary | string | Anonymised summary of the legal need |
| urgency | string | Urgency level |
Values: standard, urgent, critical |
||
| budget_range | object | Budget range with min, max, currency |
| bid_deadline | string | ISO 8601 deadline for proposals |
| posted_by | string | Client Matrix user ID (visible only to Marketplace Bot) |
{
"type": "foundation.protocols.legal.brief",
"content": {
"brief_id": "BRF-SE-2026-0042",
"jurisdiction": "SE",
"area_of_law": "corporate",
"summary": "Need assistance with GDPR compliance review for SaaS platform",
"urgency": "standard",
"budget_range": { "min": "5000", "max": "15000", "currency": "SEK" },
"bid_deadline": "2026-04-15T17:00:00Z",
"posted_by": "@client:matrix.openearth.network"
}
}
Verified lawyer signals interest in a brief. The Marketplace Bot creates an isolated Proposal Workspace room for this lawyer to prepare their proposal.
| Field | Type | Description |
|---|---|---|
| brief_id | string | Brief being responded to |
| lawyer_id | string | Lawyer Matrix user ID |
| bar_council_id | string | Lawyer’s bar registration number |
| specialisations | string[] | Relevant specialisations |
| workspace_room_id | string | Isolated Proposal Workspace room (created by bot) |
{
"type": "foundation.protocols.legal.proposal_interest",
"content": {
"brief_id": "BRF-SE-2026-0042",
"lawyer_id": "@lawyer-se-001:lawfirm.se",
"bar_council_id": "SE-ADV-2019-1234",
"specialisations": ["gdpr", "data_protection", "saas"],
"workspace_room_id": "!proposal-ws-001:matrix.openearth.network"
}
}
Lawyer submits a competing proposal. Proposals are isolated — lawyers cannot see other proposals. Delivered to the Client Proposal Review Room when the bid window closes.
| Field | Type | Description |
|---|---|---|
| brief_id | string | Brief being responded to |
| proposal_id | string | Unique proposal identifier |
| lawyer_id | string | Lawyer Matrix user ID |
| approach | string | Proposed legal approach |
| estimated_fee | object | Fee with amount and currency |
| estimated_timeline | string | Expected delivery timeline |
| attachments | object[] | Supporting documents (MXC URIs) |
{
"type": "foundation.protocols.legal.proposal",
"content": {
"brief_id": "BRF-SE-2026-0042",
"proposal_id": "PRP-SE-2026-0042-A",
"lawyer_id": "@lawyer-se-001:lawfirm.se",
"approach": "Full GDPR Article 30 records review + DPA audit + remediation plan",
"estimated_fee": { "amount": "12000", "currency": "SEK" },
"estimated_timeline": "2 weeks",
"attachments": []
}
}
Client accepts one proposal. The winning lawyer gains access to the case office room.
{
"type": "foundation.protocols.legal.proposal_accepted",
"content": {
"brief_id": "BRF-SE-2026-0042",
"proposal_id": "PRP-SE-2026-0042-A",
"lawyer_id": "@lawyer-se-001:lawfirm.se",
"accepted_by": "@client:matrix.openearth.network",
"case_office_room_id": "!case-0042:matrix.openearth.network"
}
}
Non-selected lawyer receives notification. Their Proposal Workspace is decommissioned.
{
"type": "foundation.protocols.legal.proposal_declined",
"content": {
"brief_id": "BRF-SE-2026-0042",
"proposal_id": "PRP-SE-2026-0042-B",
"lawyer_id": "@lawyer-se-002:otherfirm.se",
"reason": "alternative_selected"
}
}
Brief is closed — either a proposal was accepted, the brief expired, or the client withdrew it.
{
"type": "foundation.protocols.legal.brief_closed",
"content": {
"brief_id": "BRF-SE-2026-0042",
"reason": "proposal_accepted",
"closed_at": "2026-04-14T10:00:00Z"
}
}
8 events for case management, escalation, and legal professional workflows.
Client escalates from AI assistant to a human lawyer. The AI session pauses and a human lawyer is notified in the case office room.
{
"type": "foundation.protocols.legal.escalation",
"content": {
"escalated_by": "@client:matrix.openearth.network",
"from_session_id": "sess_01ABC...",
"reason": "Need human review of AI's GDPR interpretation",
"urgency": "standard",
"context_summary": "AI analysed DPA with vendor X but client unsure about Article 28 clauses"
}
}
Lawyer’s response to an escalation. May include corrections to AI output, additional analysis, or instructions to the client.
{
"type": "foundation.protocols.legal.lawyer_response",
"content": {
"escalation_ref": "$escalation_event_id",
"lawyer_id": "@lawyer-se-001:lawfirm.se",
"response": "The AI's analysis is correct for standard DPAs but missed the sub-processor chain clause",
"corrections": ["$correction_event_id"],
"follow_up_required": true
}
}
Client grants lawyer access to documents. Documents are uploaded as encrypted Matrix media and linked to the case office room.
{
"type": "foundation.protocols.legal.document_transfer",
"content": {
"case_office_room_id": "!case-0042:matrix.openearth.network",
"transferred_by": "@client:matrix.openearth.network",
"documents": [
{
"name": "Current DPA with Vendor X",
"mxc_uri": "mxc://matrix.openearth.network/dpa-doc-001",
"media_type": "application/pdf",
"size_bytes": 245760
}
],
"access_scope": "case_only",
"revocable": true
}
}
Lawyer’s edits to a working draft. Tracks the edit history with before/after hashes and optional diff attachment.
{
"type": "foundation.protocols.legal.document_edit",
"content": {
"document_ref": "mxc://matrix.openearth.network/dpa-doc-001",
"edited_by": "@lawyer-se-001:lawfirm.se",
"edit_summary": "Updated Article 28 sub-processor clauses per client requirements",
"before_hash": "sha256:abc123...",
"after_hash": "sha256:def456...",
"diff_mxc_uri": "mxc://matrix.openearth.network/dpa-diff-001",
"version": 2
}
}
Lawyer’s formal seal of approval. Includes document hash, bar council ID, and digital signature. Constitutes the official lawyer-approved version of the document.
{
"type": "foundation.protocols.legal.lawyer_seal",
"content": {
"document_ref": "mxc://matrix.openearth.network/dpa-final-001",
"document_hash": "sha256:final789...",
"sealed_by": "@lawyer-se-001:lawfirm.se",
"bar_council_id": "SE-ADV-2019-1234",
"seal_statement": "I have reviewed this document and confirm it is legally sound",
"sealed_at": "2026-04-20T14:00:00Z",
"signature": "base64-encoded-digital-signature"
}
}
Client rates lawyer post-case. Anonymous within the marketplace but linked to the brief for audit.
{
"type": "foundation.protocols.legal.lawyer_rating",
"content": {
"brief_id": "BRF-SE-2026-0042",
"lawyer_id": "@lawyer-se-001:lawfirm.se",
"rated_by": "@client:matrix.openearth.network",
"scores": {
"quality": 4.5,
"responsiveness": 5.0,
"value_for_money": 4.0
},
"comment": "Thorough DPA review, excellent turnaround time",
"would_recommend": true
}
}
Lawyer requests payment for completed work. Linked to the case and accepted proposal.
{
"type": "foundation.protocols.legal.payment_request",
"content": {
"brief_id": "BRF-SE-2026-0042",
"proposal_id": "PRP-SE-2026-0042-A",
"requested_by": "@lawyer-se-001:lawfirm.se",
"amount": "12000",
"currency": "SEK",
"invoice_ref": "INV-2026-0042",
"due_date": "2026-05-01"
}
}
Payment has been confirmed. Closes the financial loop for the case.
{
"type": "foundation.protocols.legal.payment_confirmed",
"content": {
"brief_id": "BRF-SE-2026-0042",
"invoice_ref": "INV-2026-0042",
"paid_by": "@client:matrix.openearth.network",
"amount": "12000",
"currency": "SEK",
"payment_method": "bank_transfer",
"confirmed_at": "2026-04-28T09:00:00Z"
}
}
4 state events for room-level legal configuration and verification.
Bar council verification attestation. State key is the lawyer’s Matrix user ID. Verified by the Open Law Directory Service (OLDS).
{
"type": "foundation.protocols.legal.lawyer_verified",
"state_key": "@lawyer-se-001:lawfirm.se",
"content": {
"lawyer_id": "@lawyer-se-001:lawfirm.se",
"bar_council_id": "SE-ADV-2019-1234",
"jurisdiction": "SE",
"verification_status": "verified",
"verified_by": "@olds-bot:matrix.openearth.network",
"verified_at": "2026-01-15T12:00:00Z",
"specialisations": ["gdpr", "corporate", "technology"],
"renewal_date": "2027-01-15"
}
}
Support person (paralegal, translator, expert witness) joins a case with explicitly scoped confidentiality obligations.
{
"type": "foundation.protocols.legal.support_person_join",
"state_key": "@paralegal-001:lawfirm.se",
"content": {
"person_id": "@paralegal-001:lawfirm.se",
"role": "paralegal",
"invited_by": "@lawyer-se-001:lawfirm.se",
"confidentiality_scope": "full_case",
"nda_signed": true,
"access_expires": "2026-06-30T23:59:59Z"
}
}
Lawyer creates a case office room. The state event records the room configuration, linked brief, and access controls.
{
"type": "foundation.protocols.legal.case_office_created",
"state_key": "",
"content": {
"brief_id": "BRF-SE-2026-0042",
"case_office_room_id": "!case-0042:matrix.openearth.network",
"created_by": "@lawyer-se-001:lawfirm.se",
"client_id": "@client:matrix.openearth.network",
"e2ee_enforced": true,
"room_preset": "privileged_case_office",
"created_at": "2026-04-14T11:00:00Z"
}
}
Formalised room template metadata. Defines the room type (brief board, proposal workspace, case office, etc.) and its associated permissions and policies.
{
"type": "foundation.protocols.legal.room_preset",
"state_key": "",
"content": {
"preset": "privileged_case_office",
"description": "E2EE case office with lawyer-client privilege",
"e2ee_required": true,
"history_visibility": "joined",
"power_levels": {
"lawyer": 75,
"client": 50,
"support_person": 25,
"ai_agent": 10
},
"allowed_event_types": [
"foundation.protocols.legal.*",
"foundation.protocols.ai.claude.*"
]
}
}
Legal professional privilege is protected architecturally, not just by policy.
| Priority | Measure | Effect |
|---|---|---|
| P1 | Firm-controlled self-hosted homeserver | Metadata never leaves firm custody |
| P2 | Enforced device verification | No unverified-device fallback, ever |
| P3 | No server-side key escrow | Client-controlled backup only |
| P4 | Post-quantum planning | Hybrid TLS (now) → hybrid Olm (2027) → full PQ (2028+) |
When Claude is used for legal research via the bridge daemon with Ansvar MCP servers:
| Family | Relationship |
|---|---|
| ai.* | ai.policy restricts AI tool usage in legal rooms. ai.evaluation scores AI legal outputs. |
| ai.claude.* | MCP tool calls to law servers are recorded as ai.claude.mcp.tool.call/result. Approval workflow uses ai.claude.approval.*. |
| data.* | Document transfers in case offices use data.consent to control downstream usage. |