The Trustain Protocol
A cryptographically-verifiable legal operations layer for firms, clients, and autonomous agents.
- Version
- 1.0 · April 2026
- Authors
- Trustain Core Team
- Status
- Published
- Pages
- 14 sections
Abstract
A one-paragraph summary of the protocol's thesis.
Trustain is a legal-operations protocol that fuses a modern law-firm workspace with a cryptographically-verifiable payment and audit layer. The platform turns every engagement — intake, retainer, document exchange, signature, invoice, payout — into a sequence of events that can be witnessed on public blockchains (Sui · Solana), audited off-chain against encrypted records, and reasoned over by a fleet of specialised AI agents. The result is a system in which trust is earned by mechanism, not by promise.
Introduction
Why legal operations need a verifiable substrate.
The practice of law has outgrown the tooling it runs on. Firms juggle a dozen disconnected systems — billing, document management, e-signature, client portals, CRM, accounting, escrow — each with its own identity model, audit log, and failure mode. Clients receive opaque invoices, regulators demand ever-richer disclosure, and cross-border matters collapse into weeks of manual reconciliation.
Trustain begins from a different premise: every step of a legal engagement is already a discrete, time-stamped event — a signed retainer, a filed pleading, a released milestone, a paid invoice. If those events are captured in a consistent structure and anchored to public chains, the resulting record is self-auditing. The firm spends less time proving what happened and more time practising law.
This whitepaper describes how that substrate is built: the protocol architecture, the escrow and payment rails, the AI agents that operate inside it, and the TRUST token that aligns incentives across counsel, clients, and validators.
Product
What counsel and clients actually use day to day.
Trustain ships as a single authenticated workspace with four primary surfaces:
- Matter Workspace — a per-case hub combining the data room, privileged messaging, milestones, time entries, escrow balance, and agent activity. Every artefact links back to the matter that produced it.
- Client Portal — a reduced, consent-scoped view of the same matter. Clients approve documents, sign with their wallet, fund retainers, and track burn-rate without needing firm-level tooling.
- Drafting Studio — template-driven document creation powered by locale-aware AI prompts. Drafts are versioned, hashed, and can be routed directly into multi-party signing workflows.
- Treasury & Governance — firm and protocol treasury views, staking, validator insights, and on-chain proposal voting. Partners and clients see the same economic truth.
Every surface is built on the same entity graph, so the data a partner sees in the workspace is the data the client sees in the portal — just with different read scopes and UI affordances.
Ecosystem
The participants and external rails the protocol coordinates.
Trustain is a coordination layer for five distinct participants, each with their own incentives and access scopes:
- Law firms & partners — the operators. They run matters, publish documents, bill time, and earn consultation and milestone fees routed through on-chain escrow.
- Clients — counterparties on every engagement. They fund retainers, sign documents with wallets, and vote on governance proposals proportional to their TRUST holdings.
- Specialist agents — AI workers (contracts, compliance, research, risk, litigation, tax) scoped to specific matters and entity reads. Their outputs are logged as first-class activity.
- Marketplace sellers — counsel who publish templates, agents, and workflows to the plugin storefront and earn revenue per install and per run.
- Validators & stakers — the economic backbone. They secure the TRUST token, settle escrow releases, and receive protocol fees in return.
External rails the protocol integrates with include Sui and Solana for settlement, Stripe for fiat on-ramp, Pyth and Birdeye for price discovery, and Twilio / SMTP for client-facing notifications. Each integration is encapsulated behind a backend function so the substitution of rails does not leak into the workspace UI.
Benefits
What the protocol concretely delivers to each participant.
Trustain's value is not abstract — it shows up as faster billing cycles, cleaner audit trails, and measurably lower friction for every party on a matter. The table below summarises the per-audience wins the protocol delivers today.
- ›One audit log across intake, escrow, e-signature, and billing.
- ›Automated invoice creation the moment a document is executed or a matter stage advances.
- ›On-chain settlement collapses reconciliation from days to seconds.
- ›Role-gated workspace; partners, associates, and clients see exactly what they should.
- ›Line-item clarity on every invoice — verified against the underlying time entries.
- ›Funded retainer monitoring in real time; no more mystery burn-rate.
- ›Wallet-native signatures — no extra passwords, no extra portals.
- ›Public receipts index means every payment can be independently verified.
- ›Protocol fees flow to stakers proportional to TRUST bonded.
- ›Marketplace agents & templates earn revenue per install and per run.
- ›Governance power scales with contribution, not with marketing budget.
- ›Cross-chain settlement (Sui ⇄ Solana) expands addressable liquidity.
Intake to signed engagement in under 10 minutes.
Every matter ships with a roster of specialist AI agents.
Cross-jurisdictional references validated against live law sources.
Each benefit is a direct consequence of the protocol's primitives — on-chain escrow, row-level security, agent approval queues — and can be audited end-to-end from the public receipts index.
Motivation
Why existing legal tools fail the modern matter.
The delivery of legal services has three persistent failure modes:
- Opaque billing. Clients receive invoices that bundle hundreds of decisions into a single number. Disputes are common and resolution is manual.
- Fragmented tooling. Practice-management, e-signature, document review, and payments live in disconnected SaaS silos, each with its own identity, audit trail, and SLA.
- Slow trust formation. Onboarding a new matter takes days — engagement letters, conflict checks, retainer wires, and permissioned data rooms are sequenced by email.
Trustain compresses all three into a single coherent substrate: one identity, one audit log, one escrow rail, one AI co-pilot — all exposed through a workspace the firm can brand and the client can trust because the protocol, not the vendor, guarantees the ledger.
Architecture
A self-executing legal infrastructure layer where AI, law, finance, zk proofs, and blockchain converge into programmable legal reality.
Trustain is structured as a vertically composed stack in which each layer publishes a narrow, replaceable interface to the layers above and below it. The result is a system where legal agreements are no longer documents about obligations — they become autonomous, verifiable, AI-orchestrated execution units that span matters, jobs, bookings, invoices, governance, and financial settlement.
Self-executing legal infrastructure
Sui · Move
trustain_escrow
Matter & job vaults
trustain_dao_escrow
Invoice execution engine
trustain_token
TRUST · 20B fixed cap
trustain_governance
Stake-weighted DAO
trustain_swap
Constant-product AMM
trustain_bridge
Cross-chain settlement
Solana · Anchor
trustain_wtrust
Wrapped TRUST · SPL
trustain_wtrust_bridge
Settlement coordinator
Privacy & Custody
zk Proofs
Selective disclosure
MPC Signing
Threshold custody
AI Triggers
Event-driven execution
AI · zk · MPC · Web3 · Law — converging into programmable legal reality.
Layered composition
- Client layer. A responsive React application servicing three distinct surfaces — the firm dashboard, the client portal, and the public intake site — over a single entity graph.
- Orchestration layer. Deno-hosted serverless functions mediate every privileged action: Stripe captures, on-chain signing, AI invocations, MPC threshold approvals, and webhook fan-out. Functions are the only writers to the chain.
- Entity store. A typed, JSON-schema database with per-row security predicates. Every matter, invoice, document, message, and reward is a first-class record with an immutable audit history.
- Chain layer. Six Move packages on Sui and two Anchor programs on Solana carry retainer and invoice escrows, TRUST token supply, governance, AMM liquidity, and the cross-chain bridge. On-chain state is the source of truth.
- Privacy & custody layer. A zero-knowledge subsystem provides selective disclosure for documents, identity, and compliance, while an MPC signing layer holds firm keys under threshold authorisation policies — neither user nor server ever sees a complete private key.
- Agent layer. Specialised AI agents (contracts, research, compliance, escrow, deadline guardian, client relations) observe matter state and either propose actions for human approval or, where policy permits, trigger contract execution directly via a narrow, audit-logged interface.
System-wide contract bindings
Each protocol surface is bound to an on-chain primitive, so user actions in the workspace settle as deterministic state transitions rather than database mutations:
- Jobs & matters — escrow vaults with milestone-based release.
- Bookings — booking escrow with manual-capture payment lock.
- Invoices — DAO escrow execution bound to a signed-envelope hash.
- Governance — stake-weighted DAO with single-use
ExecutionCap. - Swap — constant-product AMM pools for TRUST / USDC liquidity.
- Bridge — lock-and-mint cross-chain settlement, replay-protected.
- AI agents — event triggers bound to contract calls under explicit policy.
Event-driven execution
Contracts react to a small, well-defined vocabulary of platform events — onBookingConfirmed, onMilestoneCompleted, onDocumentSigned, onMatterClosed, onBillableEvent, onAIApproval — each emitted by the orchestration layer and observed by both the AI fleet and the chain. Because events are derived from on-protocol state, not the platform's discretion, the same execution log can be independently verified by any party with read access to the underlying records.
Escrow & Payment Rails
Funds settle the way the matter settles — in milestones.
Retainers are funded into firm-owned vault addresses on Sui or Solana. Each deposit is recorded against an EscrowAccount that tracks the matter, the depositing client, and the asset. Funds move through four lifecycle states:
- held — funds are captured and locked to the matter.
- partially_released — a milestone was approved and a tranche was disbursed.
- released — every milestone is approved; the matter is closed.
- refunded — the engagement was terminated and the balance was returned.
For fiat workflows Stripe operates as a manual-capture gateway, giving the firm the same "auth now, charge on accept" behaviour at the rails layer. Either path emits a signed receipt written to the protocol's receipts index; clients can verify their payment trail without trusting the firm's internal records.
Privileged Messaging & Data Room
Encrypted at the edge, gated by escrow state.
Every matter has a messaging thread and a virtual data room (VDR). Messages are AES-256-GCM encrypted in the browser with a key derived from the matter id and a server-issued pepper — the server only ever sees ciphertext.
VDR folders use per-collaborator ACLs so external co-counsel, experts, or clients see only the subset the firm explicitly shares. Access can optionally be escrow-bound: the data room unlocks only while the retainer is in held or partially_released state, giving firms a cryptographic way to link privileged discussion to funded engagement.
AI & Agent Framework
Humans approve; agents propose.
Trustain ships a roster of specialised agents — Contracts, Research, Compliance, Escrow, Client Relations, Deadline Guardian — that operate over a shared matter context. Each agent is declared in agents/*.json with an allow-list of tools and entity scopes, so it can read what it needs and nothing more.
Output flows through three safety gates:
- Grounding. Every claim must cite a source the platform can resolve.
- Hallucination check. A second model re-verifies cited law before the response is sent.
- Human approval. Any action that mutates state (drafts, filings, escrow releases) is queued as an
Approvalrecord that a partner must sign off on.
The agent layer is a co-pilot, never a substitute for licensed counsel.
Marketplace & Storefront
Specialist agents, templates, and workflows — installed into the matter, not the firm.
Trustain exposes two adjacent distribution surfaces. The Marketplace is the public catalogue: sellers — partners, firms, third parties — publish Plugin listings (agents, tools, workflows, document templates) with a kind, a capability allow-list, and a pricing tier. Listings pass through a review queue before they go live; the plugin entity carries its own install count, rating, and revenue ledger so seller performance is auditable.
The Storefront is the consumer surface. It re-renders the approved catalogue inside the workspace and lets a user browse, filter by kind / capability / price, preview the plugin, and install it. Installation is matter-scoped: a Regulatory Compliance Agent or a Real Estate Due Diligence Agent is attached to a specific Matter, the capabilities it declared are enforced at runtime (via the same entity scopes used by the specialist agents in §09), and the agent appears in that matter's pipeline alongside the native roster.
- Discovery. Tag, kind, capability, price, and seller-level filters narrow the catalogue. Every card shows the seller, rating, install count, and the capability badges so consumers know exactly what the plugin will be allowed to touch.
- Consent. The install dialog spells out the plugin's capability list and the exact
Matterit will be bound to. No capability can be escalated after install — a new scope requires a new install. - Invocation. Once installed, the plugin's entrypoint runs through the same gated pipeline as native agents: grounded retrieval, hallucination check, and — for any mutating action — an
Approvalrecord a human must sign off on. - Settlement. Per-install or per-run revenue is recorded against the
Pluginand paid out via the same royalty ledger used by firm-to-firm licensing (§Referrals). Sellers see a live earnings dashboard; the protocol retains a transparent fee.
Because the marketplace shares the plugin schema, the capability model, and the approval pipeline with the rest of the protocol, a third-party agent cannot behave any differently than a first-party one — it is subject to the same audit surface, the same consent gate, and the same per-matter visibility rules. Extending Trustain is an act of publishing, not of privileged integration.
TRUST Token & Governance
A utility token for protocol participation.
TRUST is the protocol's native token, deployed on Sui with a wrapped representation on Solana (wTRUST) bridged via the TrustBridge lock-and-mint contract. It serves three functions:
- Staking. Validators and agent operators stake TRUST to earn protocol fees and signal reliability.
- Governance. Proposals over treasury allocation, protocol parameters, and ecosystem grants are voted on proportional to staked balance.
- Fee discounts. Firms that hold TRUST receive reduced protocol fees on retainer movements and marketplace transactions.
Monetary policy is disinflationary: emissions halve on a fixed cadence and a portion of every protocol fee is burned. Full token economics live on the Tokenomics page.
Rewards & Claim Mechanism
TRUST earned by contribution, claimed by signature.
Participation in Trustain generates TRUST rewards that accrue off-chain against the user's profile and settle on-chain when the user claims. The rewards engine routes emissions to the parties that actually move the protocol forward:
- Matter completion. Partners earn a fixed TRUST grant each time a matter reaches
Closedwith an executed invoice. - Milestone release. Dual-confirmed escrow releases mint TRUST to the counsel that delivered the tranche.
- Retainer funding. Clients receive a fixed percentage of their first retainer deposit back as TRUST credit, usable inside the marketplace.
- Staking yield. Staked TRUST and wTRUST accrue continuous protocol-fee yield that can be claimed weekly.
- Governance participation. Every signed ballot on an active proposal emits a participation reward, making voter turnout itself an incentive.
- RWA Vault activity. Minting a document NFT or completing a required signature both pay TRUST from the vault reward pool.
- Marketplace sales, referrals, grants, bounties. Ecosystem incentives are distributed as TRUST alongside any fiat revenue.
Each reward is recorded as a TokenReward entity with a lifecycle of pending → claimable → claimed. Claiming is gated by a real Sui wallet signature over a canonical message (amount · wallet · reward ids · timestamp), proving the claimer controls the payout address before any balance moves. Claims settle through the trustain_token Move package on Sui, with the signed payload archived for audit.
Because rewards are derived from deterministic on-protocol events — not issued at the platform's discretion — the same log can be independently verified by anyone with read access to the underlying records.
Security Model
Defense in depth across identity, network, and ledger.
- Identity. Authentication is delegated to the Base44 platform; every authenticated call carries a short-lived token that backend functions re-issue via
createClientFromRequest. - Row-level security. Every entity declares explicit read / write predicates; privilege escalation requires an admin role attested on the user record.
- Key custody. The platform never holds client keys. Wallet signatures happen in the user's browser via the injected Phantom / Solflare / Sui wallet.
- Rate limiting. Public endpoints (intake, magic links) are throttled by persistent
RateLimitRecordrows that survive cold starts. - Audit log. Every mutation to an escrow, approval, or document generates an append-only activity record; the public receipts index mirrors the subset that is safe to share.
Roadmap
What's shipped, what's next.
Trustain follows a quarterly release cadence. The current stable release (v1.0) covers intake, matter management, retainer escrow, privileged messaging, the agent framework, the marketplace, and TRUST bridging. Upcoming milestones include:
- Q2 2026. Zero-knowledge proofs for retainer funding (prove a deposit without revealing the amount).
- Q3 2026. Cross-firm matter referrals with automatic fee-split escrow.
- Q4 2026. On-chain jurisdictional licensing registry and delegated-voting upgrades to the DAO.
- 2027+. Public agent marketplace; third-party firms can publish their own agents against the same primitives.
Disclaimer
This paper is a technical overview, not an offer to sell securities or an invitation to form an attorney-client relationship. TRUST tokens are a utility token for protocol participation and are not offered or sold to the public. Readers should consult the full legal notices and review all platform actions with qualified counsel before relying on them.
End of document · v1.0 · April 2026