Chio/Docs
LOGIN · JOIN

Open Admission & Stake

Publish which admission classes a namespace accepts and what stake each needs, then evaluate a subject against that signed policy.

Concept chio@5f63e6e

On this page

Strangers can join a namespace on terms its governing operator signs in advance: the admission classes it accepts and the stake each one needs. The trust service evaluates every subject against those terms and its anti-sybil controls.

The running example is the reference policy foap-1 for registry.chio.example/liability, published twice: once open, and once as foap-1-guarded with eight bits of proof of work.

A subject joins the namespace after five checks, in a fixed order

The subject names a policy and the admission class it wants. The trust service runs its checks and stops at the first one that fails.

Admission at the namespaceChoose an outcome.
governing operatorreceiving operatorcclasshworkbbondsscorenrateevaluateacceptedlocal activationaπvKsubjectsubject-guide-1policy recordfoap-1visibleyour kernelaccepted: visible in the namespacegoverning operatorreceiving operatorcclasshworkbbondsscorenrateevaluateacceptedlocal activationaπvKsubjectsubject-guide-1policy recordfoap-1visibleyour kernelaccepted: visible in the namespace

The subject passes all five checks and becomes visible

The trust service returns accepted: true with the reason subject satisfied the configured federation reputation and anti-sybil controls. The subject now appears in the namespace. Your kernel admits nothing for it until your operator activates it locally. Trust Activation Exchange.

One evaluation at a namespace's trust service, with its five checks in the order the service runs them. The subject and records are the captured run's; the bond, reputation, and rate-limit refusals are drawn from the service's rules. Bond posting and slashing are left out.

An accepted subject is visible in the namespace and holds nothing at any kernel. The receiving operator's own activation, on the right of the boundary, is what turns visibility into runtime trust, and the policy cannot waive it.

A signed policy names the classes a namespace accepts and the stake each needs

A FederatedOpenAdmissionPolicyArtifact lists the namespace's allowed classes from four: public_untrusted, reviewable, bond_backed, and role_gated. Each class may carry one stake requirement. A bond_backed class must have one with a slashable bond, and a role_gated entry must require a governance case before admission.

The validator refuses three weakenings: a bond-backed class whose bond cannot be slashed, a policy that drops explicit local review, and a policy that drops visibility-only participation. The open_admission program shows the first two.

Validate an open-admission policy and publish it

Validate the reference policy, refuse a bond-backed class without a slashable bond, then sign two registry records: one open, one guarded by proof of work.

Complete the project setup, then run the program from federation-guide/. The download includes every constructor and input.

Terminalbash
cargo run --locked --bin open_admission
Output on darwin/arm64 · exit 0
reference policy foap-1: valid; admission classes [PublicUntrusted, Reviewable, BondBacked]
bond_backed class without a slashable bond: refused (invalid admission: bond_backed admission requires slashable collateral)
policy that drops explicit local review: refused (invalid admission: open admission must still require explicit local review)
wrote two signed registry records and two evaluation requests to open-admission-run/

The records are signed with a deterministic example key and published to a local file registry. Evaluating a peer needs the trust service; the transcript on the page runs that half. No bond is posted and no reputation history exists for the example subject.

Read the complete program 82 lines · complete file
src/bin/open_admission.rsrust
//! Validate an open-admission policy, refuse the unslashable variant, and
//! publish two signed registry records for the trust service.
use chio_core_types::crypto::Keypair;
use chio_federation::error::FederationContractError;
use chio_federation::open_admission::{
    validate_federated_open_admission_policy, FederatedOpenAdmissionPolicyArtifact,
    SignedFederatedOpenAdmissionPolicy,
};
use serde_json::{json, Value};

fn receive(value: Value) -> Result<FederatedOpenAdmissionPolicyArtifact, FederationContractError> {
    let policy: FederatedOpenAdmissionPolicyArtifact = serde_json::from_value(value)
        .map_err(|e| FederationContractError::InvalidAdmission(e.to_string()))?;
    validate_federated_open_admission_policy(&policy)?;
    Ok(policy)
}

fn record(
    policy: &FederatedOpenAdmissionPolicyArtifact,
    signer: &Keypair,
    anti_sybil: Value,
) -> Result<Value, Box<dyn std::error::Error>> {
    let signed = SignedFederatedOpenAdmissionPolicy::sign(policy.clone(), signer)
        .map_err(|e| format!("sign policy: {e:?}"))?;
    Ok(json!({
        "schema": "chio.permissionless-federation-policy.v1",
        "publishedAt": 1_743_552_200u64,
        "policy": serde_json::to_value(&signed)?,
        "antiSybil": anti_sybil,
        "note": "published by the federation guide open_admission program"
    }))
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    std::fs::create_dir("open-admission-run")?;
    let reference: Value = serde_json::from_slice(&std::fs::read("open-admission-policy.json")?)?;
    let policy = receive(reference.clone())?;
    println!(
        "reference policy {}: valid; admission classes {:?}",
        policy.policy_id, policy.allowed_admission_classes
    );
    let mut unslashable = reference.clone();
    unslashable["stakeRequirements"][0]["slashable"] = false.into();
    let err = receive(unslashable).unwrap_err();
    assert!(matches!(err, FederationContractError::InvalidAdmission(_)));
    println!("bond_backed class without a slashable bond: refused ({err})");
    let mut no_review = reference;
    no_review["explicitLocalReviewRequired"] = false.into();
    let err = receive(no_review).unwrap_err();
    println!("policy that drops explicit local review: refused ({err})");
    // Deterministic signer so the captured records are byte-stable across runs.
    let signer = Keypair::from_seed(&[7; 32]);
    let mut guarded = policy.clone();
    guarded.policy_id = "foap-1-guarded".into();
    for (name, artifact, anti_sybil) in [
        ("policy-open", &policy, json!({})),
        ("policy-guarded", &guarded, json!({ "proofOfWorkBits": 8 })),
    ] {
        std::fs::write(
            format!("open-admission-run/{name}.json"),
            serde_json::to_vec_pretty(&record(artifact, &signer, anti_sybil)?)?,
        )?;
    }
    std::fs::write(
        "open-admission-run/evaluate-open.json",
        serde_json::to_vec_pretty(&json!({
            "policyId": "foap-1",
            "subjectKey": "subject-guide-1",
            "requestedAdmissionClass": "reviewable"
        }))?,
    )?;
    std::fs::write(
        "open-admission-run/evaluate-guarded.json",
        serde_json::to_vec_pretty(&json!({
            "policyId": "foap-1-guarded",
            "subjectKey": "subject-guide-1",
            "requestedAdmissionClass": "public_untrusted"
        }))?,
    )?;
    println!("wrote two signed registry records and two evaluation requests to open-admission-run/");
    Ok(())
}

Open the source file. Each program asserts its expected refusals; keys, timestamps, and digests change between runs.

Read the complete reference policy and its fields.

The trust service publishes each policy with its anti-sybil controls

Each operator runs its own trust service, and its federation-policy registry is part of the trust control plane. A FederationAdmissionPolicyRecord wraps the signed policy with a rate limit, a proof-of-work difficulty, a bond-backed-only switch, and an optional local reputation floor.

Publish the open recordtranscript
$ chio --control-url http://127.0.0.1:8940 --control-token demo-token \
  trust federation-policy upsert --input ./policy-open.json
federation policy upserted: foap-1
exit 0
List the published recordstranscript
$ chio --control-url http://127.0.0.1:8940 --control-token demo-token \
  trust federation-policy list
federation_policies: 2
- foap-1 operator=origin-operator min_score=none
- foap-1-guarded operator=origin-operator min_score=none
exit 0

You should see both records under origin-operator, neither with a reputation floor. The record commands take a local registry file or a running service through the global --control-url; evaluate needs the service.

Publish to a file-backed registry instead

Publish both records to a local registry

Terminalbash
chio trust federation-policy upsert --input open-admission-run/policy-open.json --federation-policies-file open-admission-run/registry.json
chio trust federation-policy upsert --input open-admission-run/policy-guarded.json --federation-policies-file open-admission-run/registry.json
Output · exit 0
federation policy upserted: foap-1
federation policy upserted: foap-1-guarded

List the published policies

Terminalbash
chio trust federation-policy list --federation-policies-file open-admission-run/registry.json
Output · exit 0
federation_policies: 2
- foap-1 operator=origin-operator min_score=none
- foap-1-guarded operator=origin-operator min_score=none

An evaluation returns acceptance or the first check that failed

The request names the policy, the subject key, the requested class, and an optional proof-of-work nonce. The service checks, in order:

  1. Class. The signed policy allows the requested class.
  2. Proof of work. When the record sets a difficulty, the SHA-256 of policy_id:subject_key:nonce starts with that many zero bits.
  3. Bond-backed only. When the switch is on, the requested class is bond_backed.
  4. Reputation. When the record sets a floor, the subject's effective local score meets it.
  5. Rate limit. The evaluation fits the record's window for this subject, and counts against it.
Evaluate under the open recordtranscript
$ chio --control-url http://127.0.0.1:8940 --control-token demo-token \
  trust federation-policy evaluate --input ./evaluate-open.json
policy_id:               foap-1
subject_key:             subject-guide-1
accepted:                true
decision_reason:         subject satisfied the configured federation reputation and anti-sybil controls
minimum_reputation_score: none
observed_reputation_score: none
exit 0

You should see accepted: true and the reason the service returns when every check passes. The same subject against foap-1-guarded, sent without a nonce, is refused at the second check:

Evaluate under the guarded recordtranscript
$ chio --control-url http://127.0.0.1:8940 --control-token demo-token \
  trust federation-policy evaluate --input ./evaluate-guarded.json
policy_id:               foap-1-guarded
subject_key:             subject-guide-1
accepted:                false
decision_reason:         proof-of-work nonce did not satisfy the configured federation policy difficulty
minimum_reputation_score: none
observed_reputation_score: none
exit 0

Admission makes a subject visible, and the receiver decides trust

Every valid policy keeps explicitLocalReviewRequired and visibilityOnlyWithoutActivation set. A remote activation still crosses as its own exchange, which the receiving operator imports under its own controls. Reputation the subject earned elsewhere arrives weighted by the receiver.

Read more in Trust Activation Exchange and Reputation Clearing.

Policy, record, and evaluation fields

The policy artifact is crates/trust/chio-federation/src/open_admission.rs; the classes are GenericTrustAdmissionClass in crates/economy/chio-listing/src/trust_activation.rs; the record is crates/platform/chio-control-plane/src/federation_policy.rs. The policy rules are requirement TRUSTMAX-03 of the federation profile.

FederatedOpenAdmissionPolicyArtifact

  • schema: chio.federation-open-admission-policy.v1.
  • policyId: the policy's identifier.
  • issuedAt: issue time.
  • namespace: the registry namespace the policy governs.
  • governingOperatorId: the operator that publishes it.
  • allowedAdmissionClasses: the classes the namespace accepts.
  • stakeRequirements[]: at most one entry per allowed class. Required for bond_backed; a role_gated entry sets governanceCaseRequired.
  • governingCharterRef: the charter the policy sits under.
  • feeScheduleRef: the fee schedule participation is billed under.
  • explicitLocalReviewRequired: a receiver still reviews locally. Refused when false.
  • visibilityOnlyWithoutActivation: participation is visible until local activation. Refused when false.
  • note: free text.

FederatedStakeRequirement

  • admissionClass: the class the requirement applies to.
  • requiredBondClass: the bond class, for example listing.
  • minimumBondAmount: units and currency.
  • slashable: whether the bond can be slashed. A bond-backed class requires true.
  • governanceCaseRequired: whether a governance case precedes admission.

Reference policy

foap-1 allows three classes and backs bond_backed with a slashable listing bond of 10000 USD units.

docs/standards/CHIO_FEDERATION_OPEN_ADMISSION_POLICY_EXAMPLE.jsonjson
{
  "schema": "chio.federation-open-admission-policy.v1",
  "policyId": "foap-1",
  "issuedAt": 1743552120,
  "namespace": "registry.chio.example/liability",
  "governingOperatorId": "origin-operator",
  "allowedAdmissionClasses": [
    "public_untrusted",
    "reviewable",
    "bond_backed"
  ],
  "stakeRequirements": [
    {
      "admissionClass": "bond_backed",
      "requiredBondClass": "listing",
      "minimumBondAmount": {
        "units": 10000,
        "currency": "USD"
      },
      "slashable": true,
      "governanceCaseRequired": false
    }
  ],
  "governingCharterRef": {
    "kind": "governance_charter",
    "schema": "chio.registry.governance-charter.v1",
    "artifactId": "charter-1",
    "operatorId": "origin-operator",
    "sha256": "2222222222222222222222222222222222222222222222222222222222222222",
    "uri": "https://origin-operator.chio.example/artifacts/charter-1"
  },
  "feeScheduleRef": {
    "kind": "open_market_fee_schedule",
    "schema": "chio.registry.market-fee-schedule.v1",
    "artifactId": "fee-schedule-1",
    "operatorId": "origin-operator",
    "sha256": "3333333333333333333333333333333333333333333333333333333333333333",
    "uri": "https://origin-operator.chio.example/artifacts/fee-schedule-1"
  },
  "explicitLocalReviewRequired": true,
  "visibilityOnlyWithoutActivation": true,
  "note": "Allows public visibility, but runtime trust still requires explicit local review or bond-backed admission."
}

FederationAdmissionPolicyRecord

  • schema: chio.permissionless-federation-policy.v1.
  • publishedAt: publication time.
  • policy: the signed policy artifact.
  • antiSybil.rateLimit: maxRequests per windowSeconds, both non-zero.
  • antiSybil.proofOfWorkBits: the difficulty, from 1 to 24 bits.
  • antiSybil.bondBackedOnly: admit only bond_backed requests. Valid only when the signed policy allows bond_backed.
  • minimumReputationScore: an optional local reputation floor between 0.0 and 1.0.
  • note: free text.

Evaluation response

  • accepted and decision_reason: the decision and the service's reason for it.
  • proof_of_work_required, proof_of_work_verified: whether the record asked for proof of work and whether the nonce met it.
  • bond_backed_required, bond_backed_satisfied: whether the record is bond-backed only and whether the requested class satisfies it.
  • minimum_reputation_score, observed_reputation_score: the floor and the subject's effective local score.
  • rate_limit: the limit, window, remaining evaluations, and retry_after_seconds once the window is spent.

Decision reasons

  • Class: requested admission class is not allowed by the signed federation policy.
  • Proof of work: proof-of-work nonce did not satisfy the configured federation policy difficulty.
  • Bond-backed only: federation policy requires bond_backed admission for permissionless entry.
  • Reputation: effective local reputation score {observed} is below the federation threshold {minimum}, both to four decimal places.
  • Rate limit: federation admission rate limit exceeded for the configured policy window.
  • Accepted: subject satisfied the configured federation reputation and anti-sybil controls.

Trust service commands

  • chio trust federation-policy upsert: publish or update a record from a JSON FederationAdmissionPolicyRecord.
  • chio trust federation-policy list: enumerate published records.
  • chio trust federation-policy get: read one record by id.
  • chio trust federation-policy evaluate: evaluate one subject under a published record. With a rate limit set, each evaluation counts against the window.
  • chio trust federation-policy delete: remove a published record.

Next: activate an admitted participant

Open Admission & Stake · Chio Docs