Part 2: Discovery
Serve legal-context.json at your domain. Enable any agent to discover your terms in a single HTTP call.
Part 2 adds machine discovery. Any agent can find your terms, verify them, and interact with them through a standard API -- all from a single well-known URL.
Serve legal-context.json
Create a file at /.well-known/legal-context.json on your domain:
{
"version": "1.0",
"contentHash": "0x7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069",
"api": "https://api.integraledger.net/v1/records/0xabcdef1234567890"
}Serve it over HTTPS. That is the entire integration.
What the API Provides
The api field points to an ALC API endpoint that fronts your on-chain record. Through this single endpoint, any agent can:
| Action | Endpoint | What It Returns |
|---|---|---|
| Get record metadata | GET /v1/records/{recordId} | contentHash, state, version history, resolver references |
| Get terms document | GET /v1/records/{recordId}/terms | The exact document bytes (verifiable against the hash) |
| Verify a hash | GET /v1/verify/{contentHash} | Whether the hash is valid, which record it belongs to |
| Get contact info | GET /v1/records/{recordId}/contact | Legal, technical, and dispute contacts |
| Get dispute process | GET /v1/records/{recordId}/dispute | Method, jurisdiction, automated resolution details |
All GET endpoints are publicly accessible. No authentication required for reading.
Creating the On-Chain Record
Before you can serve legal-context.json, you need an on-chain record. You can create one via the API:
POST /v1/records{
"terms": {
"url": "https://your-domain.com/terms"
},
"resolvers": {
"documentLocation": true,
"contact": {
"legal": "[email protected]",
"technical": "[email protected]"
},
"disputeResolution": {
"method": "Internal review",
"jurisdiction": "Delaware, USA"
}
}
}The API will:
- Fetch your terms document and snapshot the exact bytes
- Compute the contentHash
- Create the on-chain record
- Return the recordId, contentHash, and API URL
Put the contentHash and API URL in your legal-context.json. Done.
Three Hosting Options
You choose where the API runs:
| Option | Setup | Control |
|---|---|---|
| Hosted (e.g., Integra) | Use a hosted ALC API URL directly. Zero infrastructure. | Provider operates |
| Self-hosted | Run the API yourself, point at your own on-chain records. | Full control |
| Third-party | A platform or consortium hosts for its members. | Shared |
All three serve the same endpoints with the same response schemas. The choice is invisible to agents.
What You Get at Part 2
| Capability | Status |
|---|---|
| Document integrity | Yes |
| Timestamp proof | Yes |
| Terms-to-payment binding | Yes (from Part 1) |
| Machine-discoverable terms | Yes -- agents fetch legal-context.json |
| Verification API | Yes -- agents verify hashes via the API |
| Contact information | Yes -- structured contact data via API |
| Dispute process | Yes -- dispute resolution details via API |
| Per-protocol integration | No -- requires Part 3 |
| Explicit acceptance | No -- requires Part 3 |
| Full dispute resolution | No -- requires Part 4 |
Next: Protocol Extensions
Part 2 gives agents discovery and verification. Part 3 embeds the contentHash into existing payment protocol flows, creating automatic per-transaction terms binding.