trackmcp
Back to directory
Mediaeater

swarm-at-ledger

View on GitHub

Public settlement ledger for swarm.at — 901 hash-chained entries, 76 types

1 stars PythonOthers Updated Mar 3, 2026
ai-agentsaudit-trailhash-chainledgersettlementswarma2aautonomous-agentsmcpsettlement-protocol

Documentation

swarm.at Public Ledger

Hash-chained public record of verified agent settlements. Append-only, tamper-evident, auditable by anyone.

Every entry in `ledger.jsonl` is a SHA-256 hash-chained settlement that passed the full verification pipeline: integrity check, confidence threshold, and shadow audit. Modifying any entry breaks all subsequent hashes.

Ledger Format

Each line in `ledger.jsonl` is a JSON object:

json
{
  "timestamp": 1770480398.05,
  "task_id": "fingerprint-pg84",
  "parent_hash": "000000...000000",
  "payload": { "type": "text-fingerprint", "title": "Frankenstein", "..." : "..." },
  "current_hash": "453eaa...178b287"
}
  • parent_hash links to the previous entry's `current_hash` (genesis = `0` x 64)
  • current_hash = SHA-256 of the entry with `current_hash` set to `""`
  • The chain is tamper-evident: modifying any entry breaks all subsequent hashes

Canonical Hash Algorithm

To verify any entry:

1. Parse the JSON line into a dict

2. Set `current_hash` to `""` (empty string)

3. Serialize with `json.dumps(entry, sort_keys=True).encode()` (UTF-8)

4. Compute `hashlib.sha256(serialized).hexdigest()`

5. Compare against the stored `current_hash`

The genesis (first entry's `parent_hash`) is always `"0" * 64` (64 zero characters).

Data Provenance

Entries in this ledger are synthetic seed data generated from public domain sources (Project Gutenberg texts, scientific constants, geographic facts). They demonstrate the settlement protocol's hash-chaining and verification pipeline. They are not records of real agent interactions.

Verification

Three ways to verify the chain:

Standalone (zero dependencies, Python 3.8+):

bash
python verify.py
# OK: 1107 entries, chain intact

SDK:

python
from swarm_at.settler import Ledger
ledger = Ledger(path="ledger.jsonl")
print(ledger.verify_chain())  # True

API:

bash
curl https://api.swarm.at/public/ledger/verify
# {"intact": true, "entry_count": 1107}

Settlement Receipts

Every settled entry produces a receipt that any agent can look up by hash. No authentication required.

bash
curl https://api.swarm.at/public/receipts/{hash}
# {"status": "SETTLED", "hash": "...", "task_id": "...", "timestamp": ..., "parent_hash": "..."}

Receipts let third parties verify that a specific settlement happened, when it happened, and where it sits in the chain.

Trust Verification

Check an agent's trust level without authentication:

bash
# Does this agent meet a trust threshold?
curl "https://api.swarm.at/public/verify-trust?agent_id=X&min_trust=trusted"
# {"agent_id": "X", "meets_requirement": true, "trust_level": "trusted", "reputation_score": 0.95}

# How many agents at each trust level?
curl https://api.swarm.at/public/trust-summary
# {"total_agents": 5, "by_trust_level": {"untrusted": 0, "provisional": 0, "trusted": 4, "senior": 1}}

Trust Badges

Embeddable SVG badges show an agent's trust level at a glance. No authentication required.

code
https://api.swarm.at/badge/{agent_id}

Colors: untrusted (red), provisional (yellow), trusted (green), senior (blue).

MCP Server

29 tools available via the Model Context Protocol:

bash
mcp add swarm-at -- python -m swarm_at.mcp
ToolDescription
settle_actionValidate an action against institutional rules
check_settlementQuery ledger status for a task or hash
ledger_statusCurrent chain state (latest hash, entry count, integrity)
guard_actionSettle before acting — propose + settle + receipt in one call
list_blueprintsBrowse workflow blueprints by tag
get_blueprintFull blueprint detail with steps and credit cost
get_creditsCheck an agent's credit balance
topup_creditsAdd credits to an agent
fork_blueprintFork a blueprint into an executable workflow
verify_receiptLook up a settlement receipt by hash
check_trustCheck if an agent meets a minimum trust threshold
settle_batchSettle multiple proposals in one call
register_agentRegister a new agent identity with trust tracking
get_agentLook up an agent's profile and reputation
list_agentsBrowse agents by trust level and role
whoamiAgent self-introspection (trust, tools, next promotion)
execute_stepExecute a single workflow step in a molecule
list_moleculesList active workflow molecules with progress
get_moleculeGet full molecule state with all beads
register_webhookSubscribe to settlement events
list_webhooksList registered webhook subscriptions
unregister_webhookRemove a webhook subscription
claim_authorshipCreate a verifiable authorship record
verify_authorshipCheck authorship claims by content hash
start_writing_sessionStart tracking authorship provenance
record_writing_eventRecord a creative event in a session
approve_writingRecord final approval of content
get_provenance_reportGenerate a verifiable provenance report
list_writing_sessionsList active authorship sessions

Framework Adapters

Seven adapters settle agent outputs with zero hard dependencies on the framework:

FrameworkAdapterEntry Point
LangGraph`SwarmNodeWrapper`Wraps node functions
CrewAI`SwarmTaskCallback`Task completion callback
AutoGen`SwarmReplyCallback`Agent reply observer
OpenAI Assistants`SwarmRunHandler`Run and step settlement
OpenAI Agents SDK`SwarmAgentHook`Runner result and tool call settlement
Strands (AWS)`SwarmStrandsCallback`Tool and agent completion callbacks
Haystack`SwarmSettlementComponent`Pipeline component returning receipts

Install adapters via optional extras:

bash
pip install swarm-at-sdk[langgraph]
pip install swarm-at-sdk[openai-agents]
pip install swarm-at-sdk[strands]
pip install swarm-at-sdk[haystack]

Blueprint Catalog

58 pre-validated blueprints across 9 categories:

CategoryCountExamples
Procurement & Supply Chain5vendor-negotiation, purchase-approval, delivery-confirmation
Software Development5code-review-pipeline, pr-merge-audit, incident-escalation
Finance & Compliance5invoice-matching, kyc-verification, financial-close
Content & Knowledge5research-workflow, fact-checking, translation-verification
Customer Operations5escalation-routing, refund-approval, sla-compliance
Specialty6audit-chain, healthcare-referral, insurance-adjudication
AI & ML Ops9model-validation, training-pipeline, prompt-regression
Security & Compliance9vulnerability-triage, access-review, incident-response
Data Engineering9etl-pipeline, data-quality, schema-migration

Browse: api.swarm.at/public/blueprints

Each blueprint defines 2-4 steps with role assignments (worker, auditor, specialist, orchestrator, validator), dependency chains, and credit costs (2.0-8.0 per settlement).

Settlement Types

42 types covering knowledge verification, agent behaviors, and protocol operations

Knowledge Verification

TypeDescription
text-fingerprintPublic domain text ingestion + hashing
qa-verificationFactual Q&A with multi-agent consensus
fact-extractionStructured entity extraction from text
classificationGenre/topic/tone multi-label tagging
summarizationText condensation with cross-verification
translation-auditCross-language verification
data-validationMath constants + periodic table verification
code-reviewAlgorithm correctness + complexity analysis
sentiment-analysisDimensional sentiment scoring
logical-reasoningSyllogism and formal logic verification
unit-conversionMetric/imperial/scientific unit verification
geo-validationGeographic fact verification
timeline-orderingChronological event ordering
regex-verificationPattern matching correctness
schema-validationData schema conformance checking

Agent Behaviors

TypeDescription
code-generationNew code creation with language + framework metadata
code-editModifications to existing code with diff tracking
code-refactorStructural improvements preserving behavior
bug-fixDefect resolution with root cause analysis
test-authoringTest creation with coverage and assertion tracking
codebase-searchCode search operations with match scoring
web-researchWeb research with source verification
planningTask decomposition and execution planning
debuggingDiagnostic investigation with hypothesis tracking
shell-executionShell command execution with safety classification
file-operationFile system operations with change tracking
git-operationGit operations with ref and diff metadata
dependency-managementPackage and dependency management
agent-handoffTask delegation between agents
consensus-voteMulti-agent consensus participation
task-delegationWork distribution to sub-agents
documentationDocumentation creation and updates
api-integrationExternal API calls with endpoint tracking
deploymentBuild, deploy, and release operations
conversation-turnConversational exchange settlement

Protocol Operations

TypeDescription
blueprint-forkBlueprint forked into executable workflow
guard-actionPre-action settlement check (settle before you act)
trust-checkAgent trust level verification against threshold
credit-topupCredits added to agent balance
receipt-verifySettlement receipt lookup by hash
badge-requestTrust badge SVG generation
adapter-settlementFramework adapter settling agent output

Lexicon

TermDefinition
SettlementA verified, hash-chained record of an agent action. One credit = one settlement.
LedgerAppend-only JSONL file where settlements are recorded. Each entry's hash chains to the previous.
ProposalAn agent's request to settle an action. Contains a header (task ID, parent hash) and payload (data, confidence score).
ReceiptProof that a settlement occurred. Contains hash, task ID, timestamp, and parent hash. Publicly verifiable.
BlueprintA pre-validated workflow template with ordered steps, role assignments, and credit cost. Forkable by any agent.
WorkflowAn executable instance of a blueprint. Created by forking. Each step maps to one settlement.
Trust LevelAgent reputation tier: untrusted, provisional, trusted, senior. Computed via Bayesian credible intervals.
CreditUnit of settlement currency. 1 credit = 1 settlement. New agents get 100 free.
Guard ActionPattern: settle before you act. Propose, settle, get receipt in one call. Raises error on rejection.
Shadow AuditCross-model verification where a second model independently checks the primary's output.
DivergenceWhen a shadow audit disagrees with the primary. Penalizes the agent's trust score.
AdapterFramework integration that settles agent outputs without hard-importing the framework. Uses duck typing.
Agent CardA2A discovery document at `/.well-known/agent-card.json` describing the protocol's capabilities.
TierSettlement strictness level: sandbox (log-only), staging (writes, no chain enforcement), production (full).

© 2026 Mediaeater. All rights reserved.

Frequently asked questions

What is swarm-at-ledger?

swarm-at-ledger is Public settlement ledger for swarm.at — 901 hash-chained entries, 76 types

How do I install swarm-at-ledger?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is swarm-at-ledger open source?

Yes — it is hosted on GitHub at https://github.com/Mediaeater/swarm-at-ledger and has 1 stars.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP