Reference Implementation
Integra's implementation of the LCP standard — one way to implement it, not the only way.
This section is supplementary. For the normative appendix, see Appendix A: Relationship to Reference Implementations.
The LCP standard defines the discovery mechanism and document convention. How a service implements the legal infrastructure behind legal-context.json is not specified by the standard. Integra provides one reference implementation.
Two Distinct Concepts
contentHash identifies the terms document. One document can govern millions of transactions. A company's terms of service apply to every purchase — the same contentHash for all of them. The contentHash is a Level 2+ concept defined by the LCP standard.
IntegraRecord identifies a specific agreement. This buyer, this seller, this transaction, these parties, under these terms. Unique to the relationship or transaction instance. The IntegraRecord references the contentHash — these parties agreed to these terms.
Terms document (one)
-> contentHash (identifies the document)
Transaction (one of many under those terms)
-> IntegraRecord (specific to this agreement)
-> references contentHash (under these terms)
-> records parties, identity, authorization
-> hangs resolvers (dispute, returns, escrow, etc.)The contentHash is shared across many transactions. The IntegraRecord is specific to one.
What Integra Hangs Off the IntegraRecord
All optional, all independently valuable:
| Resolver | Purpose |
|---|---|
| Document location | Where to find the terms (backup to vendor URL) |
| Contact information | Legal, technical, and dispute contacts |
| Dispute resolution | ADR backed by AAA, filing process, jurisdiction |
| Returns/claims | API for returns, refunds, and claims |
| Identity | Party identity attestations |
| Escrow conditions | Conditions for payment release |
| Compliance | Regulatory checks |
| State transitions | Agreement lifecycle management |
| Tokenizer | Party permissions and agent authorization scope |
Each resolver is independently attachable. A simple vendor might only attach contact info and returns. A financial institution might attach all of them.
Middleware with Zero Latency
Creating an IntegraRecord at transaction time requires server-side tooling. The recommended integration pattern is middleware — the vendor wraps their existing payment handler with Integra middleware. The vendor's existing flow does not change.
The key to performance: the integraHash (unique record identifier) is generated client-side, instantly, deterministically — no API round-trip required. The middleware:
- Generates the
integraHashlocally (instant, deterministic) - Inserts it in the transaction receipt (synchronous, zero latency added)
- Fires off the record creation to Integra's API (asynchronous, non-blocking)
- Integra's backend guarantees the on-chain record creation completes — eventual but guaranteed execution
Vendor's existing flow:
Agent request -> Payment processing -> Receipt
With Integra middleware:
Agent request -> Payment processing -> [Middleware: generate integraHash,
insert in receipt, async: create IntegraRecord] -> ReceiptThe receipt has the integraHash immediately. The on-chain anchoring, resolver attachment, and party registration happen in the background. Zero latency added to the transaction.
IPFS Re-Pinning via Pinata
For public terms (the vast majority of transactions), an IPFS re-pinning service solves the document preservation problem at scale.
The problem: A million agents transacting with the same vendor all download the same terms document. Every agent saving its own copy is redundant. Not every agent infrastructure has reliable long-term storage. If the vendor takes down their URL and an agent loses its copy, the proof chain is broken.
The solution: Integra automatically pins public terms documents to IPFS via Pinata whenever a contentHash passes through the system.
- First encounter with a
contentHash— document is fetched and pinned to IPFS - The document is permanently available — any agent, any time, any infrastructure
- Download from IPFS, compute SHA-256, compare to
contentHash— proof chain intact - Vendor URL can go down. Agent can lose its copy. The document persists.
Cost is minimal — legal documents are small (KBs). Not applicable to private terms — ephemeral/private terms (Level 4) are intentionally not persistent.
ADR Backed by AAA
The dispute resolution resolver connects to the American Arbitration Association's institutional infrastructure. Arbitration awards issued under AAA Commercial Rules are enforceable under the New York Convention in over 170 countries.
This is what separates institutional dispute resolution from algorithmic dispute resolution. An AAA arbitration award is a legal instrument — recognized by courts, enforceable across borders, binding on the parties. This is the infrastructure that makes the disputeResolution field in legal-context.json meaningful for high-value, cross-border transactions.
Relationship to the Standard
The standard defines the interface (/.well-known/legal-context.json). Integra provides one implementation behind that interface. The api field in legal-context.json is the hook from the standard to the implementation.
Other implementations are possible and encouraged. Any legal infrastructure reachable via an API endpoint can serve behind the same standard.