Verifiable agent receipts with knowledge graph trust scoring
Project description
Nexus Ledger v4.3.0
The hash proves it wasn't tampered with. The knowledge graph proves it's actually good.
Nexus Ledger gives agents verifiable, dual-signed delivery receipts. Graphify adds a canonical structural fingerprint with adversarial quality scoring โ so you verify what the code is, not just that it arrived.
Drop-in trust layer for LangChain, CrewAI, AutoGen, OpenClaw, or any Python agent. No rewrite needed.
๐ Landing Page ยท ๐ฆ PyPI ยท ๐ Live Relay
Install
pip install nexus-ledger
Optional dependencies:
pip install 'nexus-ledger[graphify]' # Knowledge graph verification
pip install 'nexus-ledger[transport]' # WebSocket support
pip install 'nexus-ledger[ethereum]' # Ethereum anchoring
pip install 'nexus-ledger[erc8004]' # On-chain identity
Quick Start โ Add Trust to Your Agents in 5 Lines
from nexus_ledger import Agent
alice = Agent("Alice")
bob = Agent("Bob")
alice.request_task("Bob", description="market research", budget=100)
print(alice.trust_score()) # โ 0.46
alice.anchor_to_eth(chain="base") # Anchor to Ethereum
Full Task Lifecycle
# TaskRequest โ TaskAccepted โ TaskDelivered โ TaskConfirmed
alice.request_task("Bob", description="competitor analysis", budget=50, task_id="deal-001")
bob.accept_task("Alice", task_id="deal-001", estimated_delivery="2026-03-25")
bob.deliver_task("deal-001", artifact_hash="sha256:report_v1", to="Alice")
alice.confirm_task("deal-001", rating=5, feedback="Outstanding", to="Bob")
What's New in v4.3.0
- Graphify Bridge โ canonical knowledge graph receipts for code delivery verification
- Adversarial Quality Scoring โ dead code detection, functionality density analysis, suspicious pattern flagging
- Graph Canonicalization โ deterministic hashing across LLM extraction variance
- VerifiedDelivery โ end-to-end graph-verified deliver + verify-and-decide flow
- 44 Tests Passing โ full coverage including real Graphify integration tests
Previous (v4.2.x)
- Agent Refactored โ Agent + TaskManager + RelayClient architecture
- Sybil-Resistant Trust โ diversity weighting, 30-day temporal decay, 3-counterparty minimum
- Ethereum Anchoring โ receipts on Base L2, Ethereum mainnet, or Sepolia
- Relay Server โ HTTP + WebSocket with health dashboard
Features
| Feature | Description |
|---|---|
| ๐ Signed Receipts | Dual-signed Ed25519 receipts with hash-linked chains |
| ๐ E2E Encryption | NaCl box encryption (Ed25519 โ Curve25519) |
| โญ Trust Scores | Sybil-resistant local scoring (0.0 โ 1.0) |
| โ๏ธ Ethereum Anchoring | Receipt hashes on Base L2 / mainnet / Sepolia |
| ๐ Relay Network | HTTP + WebSocket with multi-relay failover |
| ๐ DID Identity | Cryptographic DID:key identities + ERC-8004 |
| ๐ป CLI | 10 commands: init, send, inbox, history, agents, verify, trust, task-chain, anchor, anchor-all |
| ๐งช 44 Tests | Full pytest suite passing in 0.21s |
CLI
nexus-ledger init # Create agent identity
nexus-ledger send Iris TaskRequest '{...}' # Send a receipt
nexus-ledger inbox # Check incoming
nexus-ledger history # View all activity
nexus-ledger agents # List online agents
nexus-ledger verify '{...}' # Verify signatures
nexus-ledger trust # Show trust report
nexus-ledger task-chain deal-001 # View receipt chain
nexus-ledger anchor --chain base # Anchor to Ethereum
nexus-ledger anchor-all --chain sepolia # Batch anchor all
Relay Server
python relay_server.py --port 8765
Provides: agent registration, discovery, message routing, WebSocket push delivery, health dashboard.
Live relay: grand-gentleness-production-a6d5.up.railway.app
Graphify Bridge โ Verify What Code Actually Is
Standard delivery receipts hash the artifact. Graphify goes deeper โ it extracts a knowledge graph from the delivered code, canonicalizes it for deterministic hashing (tolerating LLM extraction variance), and scores structural quality with adversarial checks.
from nexus_ledger import Agent
alice = Agent("Alice")
bob = Agent("Bob")
# Bob delivers with graph verification
vd = bob.verified_delivery()
receipt = vd.deliver(
task_id="deal-001",
codebase_path="/path/to/delivered/code",
artifact_hash="sha256:...",
to="Alice",
)
# receipt["data"]["graph_hash"] โ canonical structural fingerprint
# receipt["data"]["graph_metrics"] โ nodes, edges, communities, quality
# Alice independently verifies and auto-decides
vd_alice = alice.verified_delivery()
result = vd_alice.verify_and_decide(
task_id="deal-001",
codebase_path="/path/to/reviewed/code",
delivered_receipt=receipt,
)
# result["event_type"] โ "TaskConfirmed" or "TaskDisputed"
What it catches: dead code padding, structural-only scaffolding (imports/inherits without real behavior), suspiciously uniform community structure, low edge density. Grades A through F with detailed factor breakdown.
Architecture
Agent (identity + high-level API)
โโโ TaskManager (request/accept/deliver/confirm/dispute)
โโโ RelayClient (relay communication + failover)
โโโ Ledger (SQLite receipt storage)
โโโ TrustScorer (Sybil-resistant scoring)
โโโ EthAnchor (Ethereum proof anchoring)
โโโ Crypto (NaCl encryption + Ed25519 signing)
โโโ GraphifyBridge (knowledge graph verification)
โโโ GraphifyReceipt (canonical graph fingerprinting)
โโโ GraphDiff (structural comparison)
โโโ CodeQualityScorer (adversarial quality grading)
โโโ VerifiedDelivery (end-to-end verified flow)
Trust Scoring
Trust scores are computed from receipt history with Sybil resistance:
- Diversity weighting โ more unique counterparties = higher trust
- Temporal decay โ 30-day half-life on old receipts
- Counterparty minimum โ score capped at 0.5 until 3+ unique counterparties
- Rating integration โ weighted by delivery confirmation ratings
Encryption
When encrypted=True, receipt payloads are encrypted with NaCl Box (X25519 keys derived from Ed25519 identities). Relay servers see only signed envelope metadata and ciphertext.
Demo
python demo.py
Built By
Mercury & Vickson of Vickson Enterprises โฟ๏ธ
Your agents already work. Nexus makes them trustworthy. Works with any Python agent framework โ no vendor lock-in, no rewrite.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexus_ledger-4.3.0.tar.gz.
File metadata
- Download URL: nexus_ledger-4.3.0.tar.gz
- Upload date:
- Size: 44.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bdb2cdb067457be4f9c5f3753696038a3b6bef2e4507529251642c57218189e
|
|
| MD5 |
5bcf6810d1541e100a368952a1d7dc39
|
|
| BLAKE2b-256 |
b76acf3a30e2432f2f6142b5b859e72ce53891ac6b4a0f2ac79d6eba560f9e67
|
File details
Details for the file nexus_ledger-4.3.0-py3-none-any.whl.
File metadata
- Download URL: nexus_ledger-4.3.0-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a65d9727c2caac13c6d844129483c1ba9a82b176ceb96e2aad4b40de3e002ae
|
|
| MD5 |
6489b89e8c344b227785d12845a81491
|
|
| BLAKE2b-256 |
8567141f3156c05506f17d59051afdb0f8940f195a7a15e298b55acd23edfa9a
|