TrustChain - decentralized trust for AI agents. Rust core, QUIC P2P, transparent proxy, MCP server, dashboard
trustchain is an early-stage Rust project in the AI payments / x402 ecosystem, focused on agent-economy, ai-agents, distributed-systems, ietf. It currently has 7 GitHub stars and 1 forks, and sits alongside related tools like froglet, scoutscore, trstlyr-protocol, beacon-skill, rustchain-mcp, raxol.
Interaction-record and coordination layer for autonomous agents and agent networks.
Agent communication, identity, authorization, and payment rails are arriving fast. The missing layer is what actually happened between autonomous parties once they start delegating work, calling tools, and transacting across frameworks and platforms.
TrustChain gives agents portable identity, bilateral signed interaction history, delegation evidence, and trust-weighted coordination primitives. Trust scores emerge from that shared history, but the same substrate also powers discovery, routing, audit, disputes, and risk-aware decisions.
Built on the TrustChain protocol (Otte, de Vos, Pouwelse — TU Delft), extended with pluggable trust computation (NetFlow max-flow + MeritRank random walks) and an IETF Internet-Draft for agent economies.
TrustChain aims to become the base interaction-record and coordination layer for autonomous agents and agent networks. The primitive is portable identity plus bilateral signed interaction history. Trust is one major application over that history, but the same substrate also powers delegation, audit, disputes, and trust-weighted discovery/routing.
This repository is the authoritative Rust implementation of that substrate: the node, sidecar, transparent proxy, transport stack, delegation protocol, and trust engine.
pip install trustchain-py
from trustchain import with_trust
@with_trust(name="my-agent")
def main():
# All HTTP calls are now trust-protected. Binary downloads automatically.
...
main()
Download prebuilt binaries (Linux, macOS, Windows) from GitHub Releases.
# Generates identity, starts all services, prints HTTP_PROXY
trustchain-node sidecar --name my-agent --endpoint http://localhost:8080
# Then in your agent:
export HTTP_PROXY=http://127.0.0.1:8203
python my_agent.py # all outbound HTTP calls are now trust-protected
trustchain-node launch --name my-agent -- python my_agent.py
HTTP_PROXY once; trust is handled invisiblyGET /dashboardX-TrustChain-Score, X-TrustChain-Pubkey, X-TrustChain-Interactions injected into proxied responsesBlockType::Audit for unilateral events; self-referencing, no counterparty neededgraph TD
Agent["Agent Process\n(any framework)"]
Proxy["Transparent Proxy\n:8203"]
HTTP["HTTP REST API\n:8202"]
GRPC["gRPC API\n:8201"]
QUIC["QUIC P2P\n:8200"]
Dashboard["Dashboard\n/dashboard"]
MCP["MCP Server\n/mcp or stdio"]
Core["TrustEngine\nNetFlow | MeritRank"]
Store["SQLite BlockStore"]
Agent -->|HTTP_PROXY=:8203| Proxy
Proxy --> Core
HTTP --> Core
GRPC --> Core
Dashboard --> HTTP
MCP --> Core
Core --> Store
QUIC <-->|proposal/agreement| RemoteSidecar["Remote Sidecar"]
| Crate | Description |
|---|---|
trustchain-core |
Identity, half-blocks, block storage, trust engine, NetFlow, MeritRank, CHECO consensus, delegation |
trustchain-transport |
QUIC P2P, gRPC, HTTP REST, transparent proxy, IPv8 UDP, dashboard, peer discovery, MCP server |
trustchain-node |
CLI binary — sidecar, launch wrapper, keygen, MCP stdio |
trustchain-wasm |
WASM bindings for browser/edge (experimental) |
| Port | Protocol | Purpose |
|---|---|---|
| 8000 | UDP | IPv8 peer-to-peer (feature ipv8) |
| 8200 | QUIC/UDP | P2P transport |
| 8201 | gRPC/TCP | Protobuf API |
| 8202 | HTTP/TCP | REST API + dashboard + MCP |
| 8203 | HTTP/TCP | Transparent proxy |
All ports shift with --port-base.
| Method | Path | Description |
|---|---|---|
GET |
/healthz |
Liveness probe |
GET |
/status |
Node status: pubkey, chain length, peer count |
GET |
/dashboard |
Live trust dashboard (embedded HTML) |
GET |
/metrics |
Prometheus metrics |
GET |
/trust/{pubkey} |
Trust score (0.0–1.0) with tier + evidence |
GET |
/tier-requirements |
Tier qualification table (5 tiers) |
POST |
/check-threshold |
Decision support: should I transact? |
POST |
/propose |
Initiate bilateral interaction |
GET |
/peers |
List known peers |
GET |
/discover |
Discover peers by capability |
POST |
/delegate |
Create delegation |
POST |
/revoke |
Revoke delegation |
GET |
/chain/{pubkey} |
Full chain for a peer |
GET |
/block/{pubkey}/{seq} |
Single block by sequence |
GET |
/crawl/{pubkey} |
Crawl peer's chain |
GET |
/delegations/{pubkey} |
List delegations |
GET |
/identity/{pubkey} |
Resolve identity |
POST |
/accept_delegation |
Accept inbound delegation |
POST |
/accept_succession |
Accept identity succession |
Trust = (0.3 × structural + 0.7 × behavioral) × confidence_scale (weighted-additive model, v4)
| Component | Formula | What it measures |
|---|---|---|
| structural | connectivity × integrity | Sybil resistance × chain integrity |
| behavioral | recency (quality-weighted, λ=0.95) | Recent interaction quality |
| confidence_scale | min(interactions / 5, 1.0) | New agents ramp up gradually |
| connectivity | MeritRank or NetFlow | Independent paths from seed nodes |
| integrity | valid_blocks / total_blocks | Hash links, sequence continuity, Ed25519 signatures |
diversity (unique_peers / 5.0) is tracked in the TrustEvidence bundle but does not enter the final score.
Two pluggable algorithms for the connectivity factor:
| Algorithm | Type | Feature flag |
|---|---|---|
| MeritRank (default) | Personalized random walks with bounded Sybil resistance | meritrank (in default features) |
| NetFlow | Max-flow (Edmonds-Karp) from seed super-source | always available |
Proven fraud → permanent hard-zero trust score. No seeds configured → (0.3 × integrity + 0.7 × recency) × confidence_scale.
TrustChain's trust computation is implemented as a 7-layer engine across 8 modular Rust crates in trustchain-core/src/:
| Layer | Module | What it does |
|---|---|---|
| L1 | trust.rs |
Quality signals — transaction quality scores, value-weighted recency, timeout tracking |
| L2 | trust.rs |
Statistical confidence — Wilson score lower bound, Beta reputation (Bayesian updating) |
| L3 | tiers.rs, thresholds.rs |
Trust tiers — progressive capability unlocking, Josang threshold enforcement |
| L4 | sanctions.rs, correlation.rs, forgiveness.rs |
Sanctions & recovery — graduated penalties, correlated-delegate penalty, forgiveness |
| L5 | behavioral.rs, collusion.rs |
Behavioral detection — change detection, selective scamming, collusion ring identification |
| L6 | trust.rs |
Requester reputation — payment reliability, rating fairness, dispute rate |
| L7 | protocol.rs |
Delegation quotas — MAX_ACTIVE_DELEGATIONS=10, scope escalation prevention |
All 7 layers feed into the TrustEvidence struct (34 fields) returned by compute_trust() and compute_requester_trust(),
including current_tier and max_transaction_value for progressive trust unlocking.
Research basis (all references point to files in trustchain-economy/research/):
risk-scaled-trust-thresholds §4 (Olariu et al. 2024, value weighting), trust-model-gaps §4 (timeout enforcement)risk-scaled-trust-thresholds §2.4 (Josang & Ismail 2002, Beta reputation), §2.2 (TRAVOS confidence)risk-scaled-trust-thresholds §1.3 (Josang & Presti 2004), §9.2 (tiers), game-theory/market-mechanisms §4 (Rothschild-Stiglitz)negative-feedback-punishment §2.1 (Ostrom 1990, graduated sanctions), §5 (forgiveness, Axelrod 1984, Vasalou 2008)negative-feedback-punishment §4 (Sun 2012, Hooi 2016 FRAUDAR), trust-model-gaps §5 (behavioral detection)trust-model-gaps §6 (PeerTrust, Xiong & Liu 2004)ATTACK-TAXONOMY §1.1 (delegation quota limits)Based on IETF draft-pouwelse-trustchain:
Alice's chain: Bob's chain:
┌──────────────┐ ┌──────────────┐
│ PROPOSAL │──────────► │ AGREEMENT │
│ seq=2, sig=A │ ◄───────── │ seq=2, sig=B │
└──────────────┘ └──────────────┘
▲ ▲
┌──────────────┐ ┌──────────────┐
│ PROPOSAL │──────────► │ AGREEMENT │
│ seq=1, sig=A │ ◄───────── │ seq=1, sig=B │
└──────────────┘ └──────────────┘
git clone https://github.com/viftode4/trustchain.git
cd trustchain
cargo build --release
cargo test --workspace # 523 tests
cargo test --workspace --features meritrank # include MeritRank tests
cargo test --workspace --features ipv8 # include IPv8 transport tests
Core paper: Otte, de Vos, Pouwelse — TrustChain: A Sybil-resistant scalable blockchain (Future Generation Computer Systems, 2020)
Trust algorithms:
IETF drafts:
A public seed node is running at http://5.161.255.238:8202 (pubkey: 2ab9b393...). It is the default bootstrap peer in all SDKs — new agents connect automatically without any configuration.
@with_trust and sidecar-managed instrumentationApache-2.0
A protocol and node for a bot economy — bots create, publish, discover, buy, sell, and compose remote resources for value.
ScoutScore - Trust Infrastructure for AI Agents. Score any x402 service before your agent pays.
No description.
Beacon - agent-to-agent pings with optional RTC value attached (BoTTube/Moltbook/RustChain + UDP bus)
MCP server for RustChain blockchain and BoTTube video platform — AI agent tools for earning RTC tokens. Built on createkr's RustChain SDK.
Write one app, render it to a terminal, a browser, or as agent tools. The terminal for your Gundam.
Agent behavior that compiles
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
x402 payments in Rust: verify, settle, and monitor payments over HTTP 402 flows
The self-improving LLM router that optimize your agentic workflows with every runs, works with any harnesses, any models, any loops.
Production-ready x402 facilitator server.
Rust SDK for the x402 payment protocol.