Chio/Docs
LOGIN · JOIN

ReferenceSpec

Swarm Protocol

The chio-swarm/v1 authority bundle: the signed artifacts a verifier accepts, the fixed order it checks them in, and the graph invariants.

Source

This page normatively reflects spec/PROTOCOL.md section 6.4.2 and the schemas under spec/schemas/chio-swarm/v1/ in the chio repository. Status: Current bounded Chio release profile. Version 1.0. The keywords MUST, SHOULD, and MAY are normative.

Where the crate is the truth for behavior the page follows the crate and names the file: crates/kernel/chio-swarm-authority/src/verifier.rs with its submodules verifier/witness.rs, verifier/util.rs, and verifier/budget_accounting.rs; the bundle types in crates/kernel/chio-swarm-authority/src/types.rs; the budget-pool digest projection in crates/kernel/chio-swarm-authority/src/finding_pool.rs; and the worked example crates/kernel/chio-swarm-authority/examples/agent_os.rs.

This specification describes chio-swarm/v1. Validate against the schema identifier carried in the artifact. A change to the shape or meaning of any required field mints a new version identifier.


Synopsis

A hop presents one bundle, and verify_swarm_authority_bundle accepts it whole or rejects it.

crates/kernel/chio-swarm-authority/src/types.rs29-40rust
pub struct SwarmAuthorityBundle {
    pub task_graph: SwarmTaskGraph,
    pub continuation_tokens: Vec<SwarmContinuationToken>,
    pub witness_chains: Vec<SwarmDelegationWitnessChain>,
    pub join_receipts: Vec<SwarmJoinReceipt>,
    pub route_plan_receipts: Vec<SwarmRoutePlanReceipt>,
    pub budget_pool: SwarmBudgetPool,
    pub revocation_epoch: SwarmRevocationEpoch,
    #[serde(default)]
    pub terminal_receipts: Vec<SwarmTerminalGraphReceipt>,
    pub now_unix_ms: u64,
}

Bundle artifacts

The registry tracks 9 schema files under chio-swarm/v1. Every artifact is a signed, closed object: unknown fields are rejected on both the schema and the Rust side. The field shape of each one is specified on its own page.

Schema titleRegistry idWhat it provesField shape
Chio Swarm Task Graphchio.swarm.task-graph.v1The signed DAG the whole bundle belongs to, carrying the structural ceilings a verifier enforces across every task and every hop.Task graphs
Chio Swarm Continuation Tokenchio.swarm.continuation-token.v1That one hop was authorized, binding the child task to its graph digest, its single parent context, its route, its allocation, and the revocation epoch it was checked against.Continuations
Chio Swarm Delegation Witness Chainchio.swarm.delegation-witness-chain.v1That authority only ever narrowed from parent to child across the hop, with a checked scope subset proof and a pinned signature at every step.Witness chains
Chio Swarm Join Receiptchio.swarm.join-receipt.v1That a fan-in fired against exactly the parent set the graph declared for it, under the predicate that fan-in carries.Terminal receipts
Chio Swarm Route Plan Receiptchio.swarm.route-plan-receipt.v1That egress for one task was pinned to a chosen route, bridge, and target before dispatch, under the single egress constraint the protocol defines.Route plans
Chio Swarm Budget Poolchio.swarm.budget-pool.v1What each task may spend and what it has already spent, in a per-task rollup that must balance and a total the tasks together may not exceed. A market purchase names the pool by the digest of its projection rather than by the pool JSON.Budgets
Chio Swarm Revocation Epochchio.swarm.revocation-epoch.v1The block list the whole bundle was checked against, hashed over its own contents so the list cannot be widened after signing.Revocation epochs
Chio Swarm Terminal Graph Receiptchio.swarm.terminal-graph-receipt.v1That the graph closed over exactly the task set, the fan-in set, and the route set it declared, with a final spend rollup that reconciles against the pool.Terminal receipts
Chio Swarm Authority Verifier Reportchio.swarm.authority-verifier-report.v1The accepted verdict, one entry per delegating hop, and the claim ids for the checks that ran.Swarm authority

An accepted report carries claim ids drawn from a closed set of 8, declared as constants in crates/kernel/chio-swarm-authority/src/types.rs: claim.swarm.task_graph_bound, claim.swarm.continuation_fresh, claim.swarm.attenuation_witness_chain_bound, claim.swarm.route_plan_bound, claim.swarm.join_receipt_bound, claim.swarm.budget_pool_bound, claim.swarm.revocation_epoch_bound, and claim.swarm.terminal_graph_receipt_bound. All but one appear on every acceptance. A graph with no fan-in in it carries no fan-in receipt, so its report omits claim.swarm.join_receipt_bound.


Verification order

A verifier runs these steps in this order. Any failing step rejects the bundle immediately and produces no partial report.

  1. Reject if the trusted witness issuer key set is empty, before any artifact is read.
  2. Validate task-graph shape, then its signature.
  3. Require at least one continuation token and one witness chain.
  4. Validate and index route plan receipts, then join receipts, then the budget pool, then the revocation epoch, in that order.
  5. Validate terminal graph receipts against the task, route, fan-in, and budget indexes.
  6. Validate continuation tokens against the task graph canonical sha256, witness chains, routes, budget allocations, and the revocation epoch.
  7. Validate that witness chains cover every task-graph hop exactly once, with continuous scope hashes and capability digests hop to hop.
  8. Assemble the verifier report: one hop report per continuation-bearing task, plus the claim ids for the checks that ran.

Step 4 is not uniform in how it binds. Route plan receipts, join receipts, and the revocation epoch each carry an issuer and a signature, and a verifier checks the signature against a pinned key. The budget pool carries neither. It binds to the bundle through the signed graph, which names the graph the pool must belong to and the pool identifier itself, and through the allocations the continuation tokens draw on. A caller who trusts a pool because it looks signed has misread the artifact.


Invariants

Schema conformance does not make a delegation graph admissible. The structural rules below are checked in code, and a bundle that breaks any one of them is rejected whole.

  1. Single root. A task graph MUST contain exactly one task at root depth, that task MUST have no parent, and every task below root depth MUST name one. Checked by validate_roots.
  2. Acyclic. The graph MUST be acyclic. A verifier walks it depth first and rejects on re-entry to a task already on the current path. Checked by validate_acyclic and visit_task.
  3. Exact depth arithmetic. Every hop target MUST sit at exactly the source depth plus one. Depth overflow MUST reject instead of wrapping. Checked by validate_edge_depths, and stated in spec/PROTOCOL.md section 6.4.2.
  4. Signed ceilings, enforced graph-wide. The depth ceiling and the fan-out ceiling MUST sit inside the signed body, so widening either one requires a fresh signature from a pinned key. A verifier MUST enforce both across the whole graph: any task deeper than the depth ceiling rejects the bundle, and so does any task with more outgoing hops than the fan-out ceiling. The fan-out ceiling MUST be positive. Checked by validate_graph_limits.
  5. Exactly one parent context per hop. Each continuation token MUST name either a direct parent task or a fan-in receipt. Naming both rejects. Naming neither rejects. Checked by validate_continuation_parent.
  6. Witness coverage exactly once per hop. Every hop in the graph MUST be covered by exactly one witness chain. A missing chain rejects and a duplicate chain rejects. Every chain MUST terminate on a hop the graph actually declares. Checked by validate_witness_chains in crates/kernel/chio-swarm-authority/src/verifier/witness.rs.
  7. Budget balance and budget ceiling. Each allocation's own five-way unit rollup MUST equal its ceiling exactly, and arithmetic overflow MUST reject instead of clamping. The allocation ceilings summed MUST NOT exceed the pool total. A terminal receipt's per-dimension rollup MUST equal the sum over allocations exactly, and its total MUST NOT exceed the pool total. Checked by validate_budget_allocation_units, validate_budget_pool, and validate_terminal_budget_rollups. A cognition-market pool_sha256 MUST hash the RFC 8785 canonical bytes of the chio.swarm.budget-pool-digest-projection.v1 preimage rather than the wire serialization of the pool. That preimage carries the projection identifier, the source pool schema, the pool id, graph id, and currency, and the allocations in their original order; the pool total and every allocation unit field MUST be the shortest unsigned base-10 string, with 0 as the only representation carrying a leading zero. Built by swarm_budget_pool_digest_projection_bytes and hashed by swarm_budget_pool_sha256 in crates/kernel/chio-swarm-authority/src/finding_pool.rs.
  8. Closed egress constraint set. A route plan receipt MUST carry a non-empty, duplicate-free constraint list, and every entry MUST be deny-private-network. That is the whole set: any other string rejects the bundle as an unsupported constraint, and the schema enum lists the same one value. Checked by validate_route_plan_egress_constraints at crates/kernel/chio-swarm-authority/src/verifier.rs:979, and mirrored in spec/schemas/chio-swarm/v1/route-plan-receipt.schema.json:70. Route plans carries the rest of the receipt.

Run it

The crate ships one runnable bundle. examples/agent_os.rs mints a three-task incident graph, signs every artifact with keys it generates in process, verifies the bundle, and then re-verifies four tampered copies of it.

agent-os · runtranscript
$ cargo run -p chio-swarm-authority --example agent_os
chio swarm authority  ·  one task graph, verified before any child runs

task graph  swarm-incident-42
  orchestrator      depth 0  scope 6ab7b09faf2a  route -                budget holds the pool
  researcher        depth 1  scope c5a04ca641ec  route route-researcher budget 2500 of 10000 units
  writer            depth 1  scope c5a04ca641ec  route route-writer     budget 2500 of 10000 units
  join researcher + writer -> orchestrator  (all_success)

verdict  verified  (3 tasks, 2 continuations, 1 joins, 2 routes)
  researcher   continuation continuation-researcher    witness witness-researcher (1 hop)
  writer       continuation continuation-writer        witness witness-writer (1 hop)
claims   claim.swarm.task_graph_bound, claim.swarm.continuation_fresh, claim.swarm.attenuation_witness_chain_bound, claim.swarm.route_plan_bound, claim.swarm.join_receipt_bound, claim.swarm.budget_pool_bound, claim.swarm.revocation_epoch_bound, claim.swarm.terminal_graph_receipt_bound

then someone tries to
  add an edge from the writer back to the orchestrator rejected: swarm task graph cycle at task-orchestrator
  hide a hop by understating the writer's depth        rejected: swarm task depth mismatch: task-researcher -> task-writer
  allocate 5,000 units out of a 100 unit pool          rejected: swarm budget allocations exceed pool total
  run the researcher after its task was revoked        rejected: swarm task is revoked: task-researcher
exit 0in ../../../home/connor/backbay/arc
The agent_os example verifies one signed incident graph, then refuses four tampered copies of the same bundle. Every key and artifact is minted in process, so the run touches no store and no trust anchor on disk.
sourcecrates/kernel/chio-swarm-authority/examples/agent_os.rsat fe56570

The checked-in fixtures verify the same way through the CLI. The proof doctor loads one valid bundle and the negative bundles beside it, and reports whether each was rejected for the reason its fixture pins, which is a different check from rejecting at all.

reference · proof-doctor-swarmtranscript
$ source scripts/proof-room-quickstart-env.sh
$ chio proof doctor --scenario swarm-authority --root .
chio proof doctor swarm-authority
  [passed] swarm_recursive_delegation: transaction passport verified
  [passed] swarm_stale_continuation: transaction passport rejected
  [passed] swarm_budget_allocations_exceed_pool: transaction passport rejected
  [passed] swarm_graph_cycle: transaction passport rejected
  [passed] swarm_join_parent_set_mismatch: transaction passport rejected
  [passed] swarm_replayed_continuation_nonce: transaction passport rejected
  [passed] swarm_revoked_task: transaction passport rejected
  [passed] swarm_stale_route_plan: transaction passport rejected
  [passed] swarm_route_plan_mismatch: transaction passport rejected
  [passed] swarm_witness_child_scope_mismatch: transaction passport rejected
verdict: passed
exit 0in ../../../home/connor/backbay/arc
The proof doctor verifies the valid swarm bundle and confirms each negative fixture is refused for the reason it pins. The trust anchors come from the checked-in fixture keys, so the run needs no operator key material.
sourcefixtures/proof-room/swarm-authority/at fe56570

The refusals in that output are the verifier's own sentences. Swarm denial codes indexes every one of them back to the check that produced it, and the 11 signed negative bundles under fixtures/proof-room/swarm-authority/ replay the same refusals through chio proof verify.


Guarantees and limits

StatusClaimEvidence
ShippedOne function decides admission. The runtime admission hook, the proof room, and the CLI proof path all call it, so the workspace holds one definition of acceptance.verify_swarm_authority_bundle, crates/kernel/chio-runtime-core/src/admission_hook/swarm_authority.rs, crates/products/chio-proof-room/src/source_verifier.rs
ShippedAcceptance is whole or absent. Any failing check returns immediately, and the report shape pins a single verdict value, so a partial report has no representation.spec/schemas/chio-swarm/v1/authority-verifier-report.schema.json
ShippedAn empty trusted key set rejects the bundle before any artifact is read. Fail-closed is the first step of the check order.require_trusted_witness_issuer_keys
ShippedA well formed graph with no delegation in it never verifies. A bundle carrying no continuation token, or no witness chain, is refused.require_signed_swarm_delegation_evidence
Proved by testA back hop from a child to the root rejects as a cycle. The same case is frozen as a signed negative fixture and bound to a claim id.swarm_authority_stage0_rejects_graph_cycle, fixtures/proof-room/swarm-authority/graph-cycle/, claim.swarm.task_graph_bound
Proved by testA stale continuation token rejects, and so does a second token reusing a nonce. Two negative fixtures back one claim id.fixtures/proof-room/swarm-authority/stale-continuation/, fixtures/proof-room/swarm-authority/replayed-continuation-nonce/, claim.swarm.continuation_fresh
Proved by testA child scope that does not match the scope the graph signed rejects the chain.swarm_authority_stage0_rejects_witness_child_scope_mismatch, fixtures/proof-room/swarm-authority/witness-child-scope-mismatch/, claim.swarm.attenuation_witness_chain_bound
Proved by testA stale route plan receipt rejects, and so does one naming a constraint outside the closed set.fixtures/proof-room/swarm-authority/stale-route-plan/, fixtures/proof-room/swarm-authority/egress-constraint-unsupported/, claim.swarm.route_plan_bound
Proved by testA fan-in that omits a parent the graph declared for it rejects.swarm_authority_stage0_rejects_join_parent_set_mismatch, fixtures/proof-room/swarm-authority/join-parent-set-mismatch/, claim.swarm.join_receipt_bound
Proved by testAllocations that outrun the pool total reject, and so does a terminal rollup that fails to reconcile against them.swarm_authority_stage0_rejects_budget_allocations_exceeding_pool, swarm_authority_stage0_rejects_terminal_budget_rollup_mismatch, fixtures/proof-room/swarm-authority/budget-allocations-exceed-pool/, claim.swarm.budget_pool_bound
Proved by testA revocation epoch naming a task the bundle carries rejects the whole bundle, and so does one naming a subject the bundle's authority rests on.swarm_authority_stage0_rejects_revoked_task, swarm_authority_stage0_rejects_revoked_authority_subject, fixtures/proof-room/swarm-authority/revoked-task/, claim.swarm.revocation_epoch_bound
Proved by testWidening a ceiling and re-sealing every downstream token against the new graph digest does not rescue the bundle.swarm_authority_stage0_rejects_task_graph_tampering_after_continuations_are_resealed
Proved by testThe signed positive fixture verifies. The randomized conformance test then mutates that bundle case by case and asserts the rejection message each mutation is expected to produce.crates/tooling/chio-conformance/tests/r_t03_recursive_swarm_conformance.rs:132-138, fixtures/proof-room/swarm-authority/valid-recursive-delegation/
SpecThe protocol text states the same admission binding, the same two ceilings, and the same depth arithmetic. Code and text agree, and the text is the contract a third-party implementation is held to.spec/PROTOCOL.md section 6.4.2
BoundedThe verifier refuses with English sentences. Its error type carries two variants over free-form text, so a caller matches on prose instead of on a registry code.SwarmAuthorityError, crates/kernel/chio-swarm-authority/src/error.rs
BoundedVerification is the specified surface. Issuance is a separate contract, and the minting and signing helpers in this crate serve fixtures, examples, and tests.crates/kernel/chio-swarm-authority/ARCHITECTURE.md
BoundedThe budget pool is the one artifact in the bundle with no issuer and no signature of its own. It binds through the signed graph that names it.validate_budget_pool, SwarmBudgetPool
Not claimedThat schema validation happens. The nine schemas are hash-pinned and closed to unknown fields, and no crate loads them. The verifier is the enforcement, and the schemas are the published shape.spec/schemas/MANIFEST.sha256, crates/kernel/chio-swarm-authority/src/verifier.rs
Not claimedThat every structural rule carries a regression test. The single-root rule, the fan-out ceiling, hop coverage, and the both-or-neither parent branches are enforced in code with no test asserting their refusal message.validate_roots, validate_graph_limits, validate_witness_chains, validate_continuation_parent
Not claimedThat every rule carries a negative fixture. 12 scenarios ship, 11 of them negatives. Three of those negatives carry no claim binding, and the terminal-receipt claim has no negative fixture bound to it.crates/core/chio-core-types/tests/claim_registry_integrity.rs, claim.swarm.terminal_graph_receipt_bound
Not claimedThat the ceilings bound graph size. They bound depth per task and outgoing hops per source. Nothing caps the total task count, so a full tree at both ceilings is well formed and grows exponentially in the depth ceiling. The only quantitative bound on spend is the pool.validate_graph_limits, validate_budget_pool