Tersign Evidence
v0.6.8The record layer for the machine age: counter-signed receipts and agent action records.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
issue_receipt Issue signed receipt
Issue an x402 offer-receipt (EIP-712) plus a Tersign compliance record (returned as `compliance`; verify_compliance_record checks it) for a payment that has ALREADY settled; when a ledger is configured, the ledger counter-signs the receipt into your hash chain, while the compliance-fields record is not counter-signed and is bound to its receipt only by your own signature, which covers the receipt's digest. Use this for money that moved; use record_disclosure for a non-payment agent action. Recording only: it moves no money and executes no payment. Side effects: signs with your signing key (the…
| Parameter | Type | Description |
|---|---|---|
network * | string | settlement network as CAIP-2, e.g. "eip155:8453" for Base mainnet |
payer * | string | 0x address that paid — the party who can later open a dispute against this receipt |
resourceUrl * | string | absolute URL of the resource that was paid for; appears verbatim in the receipt |
supplyDescription * | string | what was supplied, in the seller's own words; the human-readable line an auditor or venue reads |
currency | string | settlement currency code, e.g. "USDC" or "USD" |
principal | string | the party on whose authority the paying agent acted (x402 sense: the buyer who delegated). Omit when a human paid directly |
settledAt | integer | unix seconds when settlement occurred; defaults to now. Set it explicitly when back-filling |
taxScheme | string | tax regime the seller is accounting under; recorded, never computed — Tersign does not calculate tax |
txHash | string | on-chain settlement transaction hash, when one exists; omit for off-chain or fiat settlement |
verify_receipt Verify signed receipt
Verify an x402 offer-receipt artifact, fully OFFLINE (no network, no API key, no account; checks no ledger or chain): recover the address whose key produced its EIP-712 signature over the six signed payload fields (version, network, resourceUrl, payer, issuedAt, transaction), and compute its canonical digest (the content address a ledger records it under). Recovery yields SOME address for any payload, so without expectedSigner the signer is UNAUTHENTICATED: valid:true then proves neither who signed nor that the receipt is unmodified — an edited receipt recovers a different address and still…
| Parameter | Type | Description |
|---|---|---|
artifact * | object | the receipt artifact exactly as issued: { format, payload, signature }. Pass the object, not a JSON string |
expectedSigner | string | 0x address the receipt MUST be signed by — obtain it out-of-band, never from the artifact. Omit to recover the signer without binding it (it is then reported UNAUTHENTICATED) |
record_disclosure Record counter-signed disclosure
One-call disclosure evidence (EU AI Act Art 50 dialect): digests the disclosure text LOCALLY, signs an action record with your key, and the public ledger counter-signs it into your per-signer hash chain. It moves no money. No API key needed — the first call self-provisions a free signer-keyed account, except when your key is already registered to an API-key account (409) or the daily provisioning caps are reached (429; https://tersign.ai/pricing).
| Parameter | Type | Description |
|---|---|---|
agentId * | string | stable identifier for the disclosing agent — keep it constant across calls so one chain accumulates per agent |
kind | string | what was disclosed: 'ai-interaction' = the user was told they are talking to an AI; 'synthetic-content' = output was marked machine-generated. Defaults to 'ai-interaction' |
medium | string | channel: 'chat' | 'api' | 'voice' | 'ui' … |
resourceUrl | string | absolute URL of the surface the disclosure was presented on, when there is one |
text | string | the disclosure text as presented — digested locally, never transmitted |
textDigest | string | pre-computed digest (wins over text) |
verify_compliance_record Verify compliance record
Verify ONE record type: the compliance record that issue_receipt returns beside a receipt (`compliance`: a ComplianceRecordV1 `record` plus its ComplianceAttestation `attestation`, EIP-712 domain "compliance-fields"), fully OFFLINE (no network, no API key, no account): recompute the record's canonical digest, check that the attestation's signed payload names that exact digest and the same receiptDigest as the record, and recover the address that signed the attestation. It does NOT verify the disclosure record record_disclosure returns: that is a different record type (an action record, EIP-712…
| Parameter | Type | Description |
|---|---|---|
attestation * | object | the attestation returned with it (`compliance.attestation`): the seller's EIP-712 signature over the record digest |
record * | object | the compliance record exactly as issue_receipt returned it (`compliance.record`, ComplianceRecordV1 shape). Pass the object, not a JSON string; any field edit changes the digest and fails verification… |
expectedSigner | string | 0x address the record MUST be signed by: the SELLER's signing address (the key that signed the receipt and this record), obtained out-of-band — not the ledger's counter-signing key, which never sign… |
record_refund Record refund
Log a refund against a receipt already on your chain, as the SELLER. The ledger stores it as a PENDING refund entry that references the original receipt digest; the entry is NOT counter-signed or appended to the hash chain, and it has no digest or sequence number of its own. Nothing is edited or deleted: the original receipt and its chain position stay exactly as they were. Requires a ledger URL, API key and seller id (the Tersign plugin's settings in Claude Code, or the TERSIGN_* environment variables) and performs one network write; errors if the original digest is not on your chain. This RE…
| Parameter | Type | Description |
|---|---|---|
amount * | string | refunded amount as a decimal STRING in the original settlement currency, e.g. "12.50". A string, not a number, so no precision is lost. Partial refunds are allowed |
originalDigest * | string | 0x-prefixed keccak256 digest of the receipt being refunded — the digest returned by issue_receipt, and it must already exist on your chain |
reason * | string | why the refund was issued, in your own words; recorded verbatim for whoever reads the chain later |
open_dispute Open dispute
Open an objective dispute against a counter-signed receipt as the PAYER (the configured key must be the receipt payer). Reasons: not_delivered, wrong_content, duplicate_charge. Recording only: the ledger records your signed claim and opens an evidence window; it moves no money. The ledger opens a dispute only with room reserved in its dispute capacity for the claim, its triage and each party's first evidence item, the same on every plan; while that capacity is full it opens none (HTTP 503). adjudicate_dispute later runs deterministic triage on it, which classifies a duplicate_charge from the l…
| Parameter | Type | Description |
|---|---|---|
claimAmount * | string | amount claimed back, as a decimal STRING in the receipt's settlement currency, e.g. "12.50". The ledger records it as stated and checks it against no payment; a refund triage result logs this amount a… |
reason * | string | grounds: 'not_delivered' nothing arrived · 'wrong_content' delivered but not what was bought · 'duplicate_charge' the same supply was billed twice (classified by triage from the ledger's own receipt… |
receiptDigest * | string | 0x-prefixed keccak256 digest of the counter-signed receipt being disputed |
statement | string | for humans reading the record — never an input to the triage rules |
submit_dispute_evidence Submit dispute evidence
Submit signed evidence to an open dispute before its evidence deadline. Claimant evidence must be signed by the payer key; respondent evidence additionally requires the seller API key (the Tersign plugin's settings in Claude Code, or the TERSIGN_* environment variables). Each artifact is sent as its digest and kind, plus its time and note when given; its content never leaves your side. Triage (adjudicate_dispute) uses only whether each side filed, never the content, kind or note of what was filed; the evidence stays on the record for the parties and any external venue. It moves no money. Each…
| Parameter | Type | Description |
|---|---|---|
artifacts * | array | at least one evidence reference; submit every artifact you want on the record in a single call |
disputeDigest * | string | 0x-prefixed digest of the open dispute, as returned by open_dispute |
role * | string | which side you are filing as: 'claimant' = the payer who opened it (payer key) · 'respondent' = the seller answering it (also needs the seller API key) |
adjudicate_dispute Run dispute triage
Run deterministic triage on an open dispute and record the result. Triage applies fixed rules, stated here, to the dispute record: R1 (duplicate_charge) looks up the receipts the ledger counter-signed for the same seller, payer and settlement transaction hash, reading the hash only in 0x-prefixed 64-hex-digit form and the payer only in 0x-prefixed 40-hex-digit form (either letter case), and lists at most 16 of those receipts, the earliest ones and the disputed one (on a settlement of more than 16 the rationale says "more than 16 receipts" and which are listed, and adjudicationInputs carries sa…
| Parameter | Type | Description |
|---|---|---|
disputeDigest * | string | 0x-prefixed digest of the open dispute to triage, as returned by open_dispute |
get_dispute Get dispute record
Fetch a dispute in full: its status, claim and evidence deadline, both sides' signed evidence references, and, once triage has run, the triage result (verdict: refund, uphold, or null when escalated), its rationale, the inputs the rules ran on, and the ledger signature over the result. Read-only — one network read, no key required, and safe to poll while a dispute is open.
| Parameter | Type | Description |
|---|---|---|
disputeDigest * | string | 0x-prefixed digest of the dispute to fetch, as returned by open_dispute |