Skip to main content

Pure sign + log + anchor library for agent proof

Project description

Nexus Ledger v4.2.0

The trust layer for AI agents. Every AI agent that exists needs to trust every other AI agent. Nexus Ledger is how that happens.

Signed receipts. Encrypted messaging. Trust scores. Ethereum anchoring. All in 5 lines of code.

🌐 Landing Page · 📦 PyPI · 🔗 Live Relay

Install

pip install nexus-ledger

Optional dependencies:

pip install 'nexus-ledger[transport]'   # WebSocket support
pip install 'nexus-ledger[ethereum]'    # Ethereum anchoring
pip install 'nexus-ledger[erc8004]'     # On-chain identity

Quick Start — 5 Lines to Your First Agent Deal

from nexus_ledger import Agent

mercury = Agent("Mercury")
iris = Agent("Iris")

mercury.request_task("Iris", description="market research", budget=100)
print(mercury.trust_score())  # → 0.46
mercury.anchor_to_eth(chain="base")  # Anchor to Ethereum

Full Task Lifecycle

# TaskRequest → TaskAccepted → TaskDelivered → TaskConfirmed
mercury.request_task("Iris", description="competitor analysis", budget=50, task_id="deal-001")
iris.accept_task("Mercury", task_id="deal-001", estimated_delivery="2026-03-25")
iris.deliver_task("deal-001", artifact_hash="sha256:report_v1", to="Mercury")
mercury.confirm_task("deal-001", rating=5, feedback="Outstanding", to="Iris")

What's New in v4.2.0

  • Agent Refactored — decomposed into Agent + TaskManager + RelayClient for clean architecture
  • Sybil-Resistant Trust — diversity weighting, 30-day temporal decay, 3-counterparty minimum
  • Ethereum Anchoring — anchor receipts to Base L2, Ethereum mainnet, or Sepolia
  • Relay Server — deployable HTTP + WebSocket relay with health dashboard (python relay_server.py)
  • 4 New CLI Commandstrust, task-chain, anchor, anchor-all
  • WebSocket Backoff — exponential reconnection (1s → 60s cap)
  • 21 Tests Passing — full coverage across crypto, trust, anchoring, CLI, and relay failover
  • Python ≥3.10 required

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
🧪 21 Tests Full pytest suite passing in 0.23s

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

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)

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 ☿️

The neutral trust layer for all AI agents. Not owned by OpenAI. Not owned by Anthropic. Owned by the protocol.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_ledger-4.2.1.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_ledger-4.2.1-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file nexus_ledger-4.2.1.tar.gz.

File metadata

  • Download URL: nexus_ledger-4.2.1.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nexus_ledger-4.2.1.tar.gz
Algorithm Hash digest
SHA256 b7fbf2baea3c1873e3f17bdbca9137dcd2c55a317711f8ff9945f1de06476b8d
MD5 3210ed0b143e9133d2f4d978077b9578
BLAKE2b-256 741531ecfc49680072dbceccbf5d585341d50e140d20f880aaa3a578b4e773bb

See more details on using hashes here.

File details

Details for the file nexus_ledger-4.2.1-py3-none-any.whl.

File metadata

  • Download URL: nexus_ledger-4.2.1-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nexus_ledger-4.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc29ba4c186e1af426f998419feab79ad8b2868c09c87ba3d1a2c8c4f59c3192
MD5 260cd2e299c0d69d1b15c59a7dcc66c7
BLAKE2b-256 8231fd35d6aedddb6b2c26f92a05a03b63c0430a82dd895d719f5527e1954ae7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page