Back to Discover

tersign-js

connector

tersignhq

Counter-signed evidence records for agent commerce: receipts, verification, dispute envelopes.

View on GitHub
0 starsSynced Aug 2, 2026

Install to Claude Code

/plugin marketplace add tersignhq/tersign-js

README

Tersign — the evidence layer for the agent economy

npm version MIT license npm provenance attested MCP registry

Tersign is the evidence layer for the agent economy — a neutral, counter-signed, hash-chained ledger for agent commerce. Sellers sign EIP-712 receipts; Tersign chains them per seller and counter-signs every entry. When the dispute comes, the transcript is already sealed.

Venues rotate. The transcript endures.


Verify a Real Entry — Right Now

No account. No API key. This is the genesis receipt, seq 1 on the production chain:

npx tersign verify 0xe5874f1ffe87f0a6dd9eb157730f67b86ee4538b125fe30fcc4e165213dd3fc4 --ledger https://tersign.ai
ledger: counter-signed OK (seller tersign-first, seq 1 …) VALID

npx tersign verify <receipt.json | 0xdigest> [--ledger url] recovers the EIP-712 signature locally, then checks the entry against the public chain — yours or anyone's. Prefer raw HTTP? The same proof, no CLI:

curl https://tersign.ai/v1/receipts/0xe5874f1ffe87f0a6dd9eb157730f67b86ee4538b125fe30fcc4e165213dd3fc4/verify

Chain of Custody

Every entry takes the same path: the seller signs the receipt (EIP-712, x402 offer-receipt extension) → Tersign computes the keccak256 canonical digest → the digest joins that seller's hash chain, each seq n bound to seq n−1 → the neutral ledger counter-signs (secp256k1) → anyone verifies, and any venue gets a serialized envelope.

graph LR
    A["agent transaction<br/>x402"] --> B["seller-signed receipt<br/>EIP-712"]
    B --> C["canonical digest<br/>keccak256"]
    C --> D["per-seller hash chain<br/>seq n binds seq n−1"]
    D --> E["neutral counter-signature<br/>secp256k1 ledger"]
    E --> F["verifiable by anyone<br/>venue-ready envelope"]

Diagram renders on GitHub. On npm, the paragraph above IS the diagram.

Refunds chain back to the original receipt via refundOf. Disputes attach to the digest with objective reason codes. Party statements are structurally segregated behind an UNVERIFIED marker — the evidence stays prompt-injection-hardened.

Enter the Record

npm i tersign

withAssure() wraps your x402 fetch handler so every paid call issues a signed, chained receipt. The full register:

CapabilityIn the record
ReceiptsSeller-signed EIP-712 (x402 offer-receipt extension), keccak256 canonical digests
withAssure()x402 fetch-handler adapter — a receipt per paid call
Compliance recordsEU Art-226b minimal tier · EN 16931 full tier · HK IRO s.51C retention
Action recordsActionRecordV1 — GDPR-minimized; captures the content of an Art-50 disclosure so the disclosure itself is independently attested, not self-reported
RefundsChained to the original receipt via refundOf
Disputes v0Objective reason codes, evidence submission, adjudication
Venue envelopesInternet Court (5,000-char slot) · Kleros ERC-1497 · UMA · generic
Evidence packsformat=art50 · format=safr (beta)
IdempotencyIn-memory + Cloudflare D1 stores

For Agents — the MCP Server

npx tersign starts the MCP server (stdio). Official registry entry: io.github.tersignhq/evidence (active).

{
  "mcpServers": {
    "tersign": {
      "command": "npx",
      "args": ["tersign"],
      "env": { "TERSIGN_SELLER_KEY": "0x<your-seller-key>" }
    }
  }
}

Toolsissue_receipt · verify_receipt · verify_compliance_record · record_refund · open_dispute · submit_dispute_evidence · adjudicate_dispute · get_dispute

Env varRequiredPurpose
TERSIGN_SELLER_KEYyes0x-prefixed private key that signs your receipts and records
TERSIGN_LEDGER_URLnohosted ledger for counter-signing + chain checks
TERSIGN_LEDGER_API_KEYnoyour seller API key on that ledger
TERSIGN_LEDGER_SELLER_IDnoyour seller id on that ledger
TERSIGN_ISSUER_NAMEnoissuer name stamped on compliance records
TERSIGN_ISSUER_JURISDICTIONnoissuer jurisdiction stamped on compliance records

Cold to counter-signed in one session: call issue_receipt, then check the issued receipt's digest with npx tersign verify <digest> --ledger <url>.

The agent skill tersign-evidence ships at tersignhq/skills.

The Live Record

  • Ledger + dashboard — public verify page: https://tersign.ai/verify
  • Census — hash-chained observations across the live x402 seller catalog, probed autonomously; the numbers are served live, never quoted stale: https://prober.tersign.ai/v1/prober/stats
  • Conformance — RFC 8785 (JCS) canonical serialization, keccak256 digests, and the public two-sided vector suite (independence, completeness, existence, phase): tersignhq/evidence-record-conformance. Reproduce the bytes and your implementation is conformant — in any language.
  • Standards — the compliance-fields extension — a typed compliance-record schema plus three evaluator-side disqualifications (independence, completeness/existence, economic-phase separation), each executable as a two-sided conformance vector — is under review upstream (x402-foundation/x402#2853) and referenced in the x402 TSC's evidence-record charter agenda (tsc#4). The merged offer-receipt spec already carries the completeness criterion at SHOULD strength (§4.5.1, #2811).

Machine Surfaces

Full URLs, readable without auth. If you are an agent, start here.

SurfaceAddress
npm packagetersignhttps://www.npmjs.com/package/tersign
MCP registryio.github.tersignhq/evidence
ARD catalog (Agentic Resource Discovery)https://tersign.ai/.well-known/ai-catalog.json
Verify APIGET https://tersign.ai/v1/receipts/{digest}/verify
Envelope APIGET https://tersign.ai/v1/receipts/{digest}/envelope?venue={internet-court|kleros|uma|generic}
Ledger statsGET https://tersign.ai/v1/stats
Ledger signerGET https://tersign.ai/v1/ledger
llms.txthttps://raw.githubusercontent.com/tersignhq/tersign-js/main/llms.txt
Conformance vectors (RFC 8785 + keccak256)https://github.com/tersignhq/tersign-js/blob/main/test/fixtures/canonical-vectors.json
Sample compliance record + digestshttps://github.com/tersignhq/tersign-js/blob/main/test/fixtures/compliance-record.json
Genesis verifynpx tersign verify 0xe5874f1ffe87f0a6dd9eb157730f67b86ee4538b125fe30fcc4e165213dd3fc4 --ledger https://tersign.ai

Tersign seal

MIT · built and published from tersignhq/tersign-js via trusted-publishing CI, provenance attested · tersign reserved on PyPI

Venues rotate. The transcript endures.

Rendered live from tersignhq/tersign-js's GitHub README — not stored, always reflects the source repo.

1 Install Method

NameDescriptionCategorySource
npm packageInstall via npm (stdio transport)mcp-servertersign

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.