BlogTangle Network Basicspart 3 of 6
How Decentralized AI Infrastructure Verifies Work
Which check answers which claim: matching results, stake thresholds, challenge windows, trusted hardware, zero-knowledge proofs, and evaluations.
This post is about the Tangle Network protocol, a separate project from Tangle's infrastructure for AI agents. Introduction to Tangle covers the agent infrastructure.
A customer sees a JobResultSubmitted event and assumes the work is finished.
The event proves that an operator, the party running the service, submitted bytes to the protocol.
It does not prove that the right program ran, that the input stayed private, or that a language model produced a useful answer.
Each check answers a different claim. “Two operators returned the same deterministic result” needs result comparison. “This measured workload ran in protected hardware” needs attestation. “This answer passed the task’s evaluation set” needs a task evaluation. Each rule supports only its own conclusion.
Tangle is a coordination network for services that independent parties run. Its contracts record selected registration, service, payment, verification, and lifecycle state, while application work runs outside the chain. A Blueprint is a reusable service template that declares jobs, operators, result handling, payment, and optional protocol logic. A Service is a configured instance of it, a Job is one callable unit of work, and an operator runs the artifact and submits a result. The Blueprint Service Manager is the protocol-facing contract that can customize registration, service creation, authorization, payment, result checks, and slashing. A caller observes the submission event and the verification state the contracts record. The Blueprint introduction describes these objects and the manager role.
The verification stack starts by separating five questions.
| Question | What a passing check would support |
|---|---|
| Did a result arrive? | The protocol received a submission for this Job call |
| Did the approved code run? | The execution matched a pinned artifact or measured workload |
| Was the input protected? | A defined privacy boundary held during execution |
| Is the result mathematically valid? | The result satisfies a formal relation or proof |
| Is the result useful for this task? | The output passes a task-specific evaluation |
No single receipt answers all five.
Start with a deterministic job
Consider a Job that accepts an integer and returns its square. The function is deterministic: the same input and approved implementation should produce the same output.
If three operators receive 7 and return 49, the Blueprint can accept two matching results under a 2-of-3 rule.
That gives the customer redundancy and a way to detect disagreement.
It does not prove that 49 is the square of 7 if every operator ran a common faulty implementation, or if the Blueprint encoded the wrong function.
Job call: square(7)
Operator A: 49
Operator B: 49
Operator C: 42
Acceptance: 2 matching results are required
What is known: A and B agree under the configured rule
What is open: Whether the rule and implementation express the intended task
A quorum is the minimum number or weight of participants whose result counts for acceptance.
Tangle’s public service-manager interface exposes a required result count and an aggregation threshold.
The threshold can be count-based or stake-weighted, where basis points express a percentage and 6700 means 67%.
The public interface reference documents getRequiredResultCount, requiresAggregation, and getAggregationThreshold.
The operator count is a policy choice, not a source of truth. Operator agreement becomes a correctness check only when its assumptions match the job.
Where the Blueprint controls verification
The Runner guide describes the Blueprint Runner, which executes jobs off-chain. A producer turns an external event into a job call. A job router maps a Job identifier to its handler. A consumer sends the handler’s result back to its destination. A trace is the ordered evidence of what the runtime did.
The service manager sees lifecycle calls such as operator registration, service activation, Job submission, and result submission.
Its onJobCall hook can validate inputs and caller permissions.
Its onJobResult hook can validate the result format, check operator eligibility, and aggregate results, so it is where a service-specific result rule goes.
This is an illustrative evidence record, not a claim that every Tangle result uses these fields:
{
"serviceId": 42,
"job": 0,
"jobCallId": 17,
"artifactDigest": "sha256:approved-image",
"operatorResults": [
{ "operator": "A", "outputHash": "0xabc", "status": "submitted" },
{ "operator": "B", "outputHash": "0xabc", "status": "submitted" },
{ "operator": "C", "outputHash": "0xdef", "status": "submitted" }
],
"rule": "2 matching normalized outputs",
"status": "accepted",
"evaluation": { "name": "square_examples", "status": "passed" }
}
The public contract interface receives encoded inputs and outputs. The Blueprint decides what to store, compare, or emit. The protocol can record the operator submissions and the rule that accepted them. The developer still defines text normalization, response scoring, and the evidence a caller receives.
The Blueprint lifecycle article shows where result checks sit between the operator runtime and the customer’s Service.
Agreement is useful when the work is deterministic
Redundant execution sends the same Job to more than one operator and compares the results. It fits arithmetic, hashing, signature checks, fixed-format transformations, and other jobs with a stable output.
The assumption is usually “enough operators are independent and at least one is honest.” It fails in several ways:
- Operators may download the same corrupted artifact.
- Operators may share a cloud account, region, dependency, or administrator.
- The input may be ambiguous or malformed.
- A floating-point or time-dependent program may not be bit-for-bit reproducible.
- A majority may collude.
Independence is an operational property, not a count. Three wallet addresses do not create three independent executions if one company controls all three machines.
For non-deterministic work, exact equality is often the wrong rule. A transcription service may differ in punctuation while preserving the words. A language model may sample two valid explanations. Define a normalized representation, a tolerance, or a separate evaluation; do not treat exact string equality as a universal truth test.
Cost is visible. A three-operator comparison runs the work up to three times before coordination overhead. The extra cost buys a disagreement signal and availability tolerance, not a free answer key.
Thresholds can count people or stake
Tangle’s service-manager interface supports two threshold types for aggregated results:
| Threshold | What is counted | Example |
|---|---|---|
| Count-based | Number or percentage of operators | Two of three operators sign the same output |
| Stake-weighted | Percentage of committed stake | Operators representing at least 67% of the configured stake agree |
The protocol can combine the matching result with Boneh–Lynn–Shacham (BLS) signatures. BLS is a signature scheme whose signatures from several keys aggregate into one compact signature, which a client checks against the participating public keys. The aggregated signature proves that the selected operators signed the output. It does not prove that the output is semantically correct.
Stake-weighted thresholds give more influence to an operator with more committed stake. They do not make stake independent, and they do not catch the case where the largest operators share the same bug. The service description should state the threshold and why it matches the threat model.
Optimistic checks trade time for lower normal cost
An optimistic scheme assumes the submitted result is correct and allows a challenge during a defined window. A challenge window is the period in which a participant can submit evidence that the result violates the rule. A fraud proof is evidence or a protocol interaction that demonstrates an incorrect deterministic execution.
The common pattern is:
- An operator commits to a result.
- The result remains provisional during the challenge window.
- A challenger posts evidence and, where required, a bond.
- The protocol narrows the disagreement or verifies the fraud proof.
- The result is finalized or the proposal is rejected.
This can reduce duplicate work on the happy path. It adds delay before finality, requires someone to monitor the window, and needs deterministic replay or another way to show the divergence. An open-ended language-model response fits poorly with instruction-by-instruction fraud proofs, because the protocol lacks a stable execution trace to replay.
The Arbitrum Nitro whitepaper is a primary source for the challenge-period model in optimistic rollups. It describes a design pattern, not a claim that every Tangle Blueprint has native fraud proofs enabled.
Protected execution answers a different question
A trusted execution environment (TEE) is a hardware-backed area that isolates a workload from ordinary host software. An attestation report is signed evidence about the protected environment and the code or configuration measured at start. A measurement is a cryptographic fingerprint of a relevant image, binary, boot component, or configuration.
TEE evidence can support a claim such as “the approved container started inside the required confidential-computing boundary.” It can help a client decide whether to release a secret to the workload. It does not prove that the code implements the desired algorithm or that the output is useful.
The AWS Nitro Enclaves attestation guide explains that an enclave can request a signed document containing measurements. The external service must compare those measurements with its access policy. An unvalidated report is a statement from the workload, not a completed trust decision.
| TEE can help establish | TEE does not establish |
|---|---|
| The report came from the provider’s attestation root | The provider’s software outside the TEE is honest |
| The measured workload matches an approved value | The measured workload is correct for the customer’s task |
| Memory is protected under the provider and hardware model | Logs, outputs, network endpoints, or side channels are harmless |
| A secret was released only after a policy check | The model’s answer passes a quality evaluation |
The Tangle execution confidentiality guide treats confidentiality as a deployment policy.
It documents tee_required as a fail-closed choice when the operator cannot satisfy the runtime prerequisites.
A protected job can stop rather than silently run on an ordinary host.
The TEE article goes deeper on protected execution and attestation policy.
ZK proofs verify a formal statement
A zero-knowledge proof (ZK proof) lets a prover demonstrate that a formal statement is true without revealing the private witness used to construct it. The proof is checked against a circuit or relation.
For a data transformation, the statement might be “this output is the result of applying function F to input commitment H.” If the proof verifies and the circuit matches the intended function, the client has a strong correctness claim without seeing the input.
“If the circuit matches” carries the weight. A valid proof for a circuit that omits a safety condition, rounds a value incorrectly, or encodes the wrong model proves the wrong thing. Proof generation can also cost far more than running the computation directly.
The Ethereum Foundation’s zero-knowledge overview explains completeness, soundness, and zero-knowledge as separate properties. Those describe the proof system. The Blueprint still chooses the statement the proof is about.
MPC protects inputs through a threshold assumption
Multi-party computation (MPC) lets several parties compute from secret shares of an input without giving the complete input to one party. The NIST definition of MPC describes the same privacy boundary. A threshold assumption says how many parties may be unavailable or malicious before the privacy or correctness claim fails.
MPC reduces the risk that one operator sees a customer’s complete document. It adds communication, key management, protocol complexity, and a dependency on enough participants being available. MPC alone does not show that the output answers the business question. Pair it with a correctness check, a proof, or an evaluation.
AI quality needs an evaluation loop
Neural-network inference can be reproducible under controlled conditions and still produce a poor answer. The failure is often semantic rather than a byte-level mismatch.
An AI evaluation is a repeatable test of a model or agent on a defined task set. A grader is the code, model, or human process that judges each example against its expected answer or property. A canary is a small known input chosen to catch a particular regression, such as an unexpected model substitution.
A useful evaluation record names all of them:
Evaluation: invoice_fields_v3
Inputs: 200 labeled invoices
Checks: vendor, invoice date, total, currency, required citations
Grader: schema checks plus human review for ambiguous fields
Threshold: 100% schema validity, 95% field agreement on labeled cases
Result: pass, fail, or review-required
The numbers in this block are illustrative acceptance criteria, not a Tangle benchmark. The important property is that the rule is visible before the result is accepted.
A canary suite can detect a large behavior change while missing a subtle quality drop. A model fingerprint can show which files loaded while missing a prompt-policy regression. A human grader can catch ambiguity while adding reviewer variance. The evaluation record should show those tradeoffs rather than reduce them to a green badge.
Anthropic’s guide to evaluating AI agents makes a related point: agent behavior spans many turns, tool calls, state changes, and intermediate results, so a final score without the path loses information.
An agent claim checked by running it
The smallest agent-side version of this rule is to rerun the check yourself.
The script below asks a Claude Code agent to fix a failing test in a repository, then runs npm test itself, because a finished turn is not a finished task.
The calls that matter are client.create with a git source, box.prompt for the agent’s turn, box.exec for the independent check, and run.costUsd for the metered cost.
import { writeFile } from "node:fs/promises";
import { Sandbox } from "@tangle-network/sandbox";
const client = new Sandbox({
apiKey: process.env.TANGLE_API_KEY!,
baseUrl: "https://sandbox.tangle.tools",
});
const box = await client.create({
git: { url: "https://github.com/tangle-network/sandbox-demo" },
backend: { type: "claude-code" }, // or "codex", "opencode", "pi"
});
try {
const run = await box.prompt("`npm test` fails. Find the cause and fix it.");
if (!run.success) throw new Error(run.error);
// Check the result yourself.
const tests = await box.exec("npm test");
if (tests.exitCode !== 0) throw new Error("The tests still fail.");
await writeFile("fix.patch", (await box.exec("git diff")).stdout);
console.log(run.usage, run.costUsd); // metered per turn
} finally {
await box.delete();
}The run shows that, in one sandbox after one prompt, npm test exited with code 0 after the agent’s patch.
It does not show that the patch is minimal, that the test covers the bug, or that the answer is useful.
To score the agent’s trace rather than its test result, use evals/score-a-trace, where a model judge on the Router reads the answer and every tool call.
What a trace contributes
For an AI Job, a trace may connect:
- The caller and Service.
- The input fingerprint and access policy.
- The artifact digest and model identifier.
- Tool calls, retries, and resource limits.
- Operator submissions and aggregation state.
- The evaluation inputs, grader, and result.
A trace does not become proof by being detailed. It is an operational record unless an independent mechanism protects its origin and integrity. TEE attestation can protect a specific measurement claim. A cryptographic signature can protect authorship of an event. A chain record can make selected state transitions publicly inspectable. The service should say which protection applies to each field.
How slashing fits after detection
Staking creates an economic commitment from an operator. Slashing burns or redistributes part of that commitment after a defined violation.
The Tangle slashing guide describes a lifecycle with a proposal, a dispute window, and an executable or cancelled outcome. The dispute window gives the operator or an authorized party a chance to contest the evidence.
The expected-cost argument is simple:
expected penalty = probability of detection × slash amount
If a rational operator expects the penalty to exceed the benefit of cheating, the incentive can deter the behavior. The calculation is a model, not a guarantee. It fails when detection is weak, the stake is small, the benefit is immediate and hard to recover, or the attacker accepts losing the stake.
Slashing cannot retrieve a leaked document, make an ambiguous evaluation fair, or compensate for a service that had no available operators. Use it as recourse after a defined violation, not as a substitute for prevention or evaluation.
A decision table for Blueprint authors
Choose the mechanism from the property the customer needs:
| Customer need | First mechanism to consider | Add this check |
|---|---|---|
| Same deterministic result from independent operators | Count-based or stake-weighted aggregation | A reference evaluation and artifact identity check |
| Private input during execution | TEE policy or MPC | Attestation validation, secret-release policy, and output controls |
| Proof of a formally specified computation | ZK proof | Circuit review and test vectors |
| Low normal cost with delayed finality | Optimistic challenge | Monitoring, deterministic replay, and a dispute process |
| Useful language-model output | Task evaluation and trace | Canaries, human review, and prompt/model identity evidence |
| Consequence for a detected violation | Stake and slashing | Clear evidence format, authority, dispute window, and recovery |
Layering is often appropriate. A private inference service might require TEE execution, record a model measurement, run a small canary suite, and ask two operators to agree on a structured result. Each layer answers a different question, and the service should not claim one larger guarantee than the intersection of its documented assumptions.
Failure cases to test before launch
One operator never responds
The service should distinguish an unavailable operator from a wrong result. Set the required result count and timeout so a customer can tell whether the Job can complete with fewer responses.
Operators return different outputs
Preserve each result and the comparison rule. Do not overwrite the disagreement with a majority result without keeping the minority evidence and the reason for acceptance.
All operators share a faulty release
Run known test vectors and a task evaluation against the exact artifact digest. Agreement is weak evidence when every execution shares the same bug.
The attestation is old or replayed
Validate the signature, expected measurements, audience, nonce or freshness value, and expiry according to the provider’s report format. The client should refuse to release secrets when the report fails policy.
A ZK proof verifies for the wrong statement
Review the circuit, public inputs, witness binding, and test vectors. The proof system cannot repair a specification error.
A slash proposal is disputed
Preserve the evidence, bond, deadlines, and final state. An accusation is not a final slash, and a cancelled proposal is not evidence that the underlying job was correct.
Does Tangle verify every AI answer?
No. Tangle provides protocol surfaces for Blueprint-specific input checks, result checks, aggregation, payment, and lifecycle rules. An AI Blueprint must define the evaluation and evidence that make its own answer claims meaningful.
Does operator agreement prove correctness?
Only under the assumptions behind the agreement rule. Matching results show consistency among operators, while a common faulty artifact or shared input can make every result wrong in the same way.
What does a TEE attestation prove?
It provides signed evidence about a protected workload, its hardware-backed environment, and selected measurements. It does not prove that the code is correct or that its output is useful.
What is the difference between an evaluation and a proof?
An evaluation checks behavior on selected examples or criteria. A proof checks a formally specified statement with cryptography. An evaluation can judge open-ended quality but has coverage and grader limits. A proof can be mathematically sound for a specification that omits the property the customer wants.
Does slashing happen immediately after a bad result?
Not by default. The public Tangle slashing path includes a proposal, a dispute period, and an executable or cancelled result. The Blueprint must define how a bad result becomes admissible evidence.
Where should a Blueprint put its verification rule?
Put the rule in public job metadata and in the service-manager or application code that enforces it. The customer should be able to inspect the required result count, threshold type, artifact identity, evaluation, evidence fields, timeout, and dispute behavior before submitting a job.
The practical decision
Start by writing “This Job is accepted when…” and complete it with a rule a machine or reviewer can execute.
Then write “This rule does not prove…” and list the nearest failure case.
Before accepting a Blueprint’s claims, read its job metadata, manager code, artifact release, operator policy, and evaluation definition.
For agent output, run the check yourself, as the sandboxes/fix-a-test example does, instead of accepting a finished turn.
Write the rule first, then build it with How to Build a Tangle Blueprint: Test and Deploy.
Next in Tangle Network Basics: How to Build a Tangle Blueprint: Test and Deploy