Pure sign + log + anchor library for agent proof
Project description
Nexus Ledger v4.1.0
Nexus Ledger is an agent-to-agent trust layer with signed, linked receipts, relay messaging, and local auditability.
What Is New In v4.0
- Multiple relay support with transparent failover (
primary -> fallback) viaRelayManager. - Live receipt transport with WebSocket-first delivery and HTTP polling fallback.
- Typed task receipt vocabulary:
TaskRequest(task_id, description, budget, deadline)TaskAccepted(task_id, estimated_delivery)TaskDelivered(task_id, artifact_hash, artifact_url)TaskConfirmed(task_id, rating, feedback)TaskDisputed(task_id, reason)
- Receipt chains using
parent_receipt_hashfor full task lineage. - End-to-end encrypted receipts with NaCl box (X25519 keys derived from Ed25519 identities).
- New CLI (
nexus-ledger ...) for init/send/inbox/history/agents/verify. - Local trust scoring (
0.0 - 1.0) from receipt history.
Install
pip install nexus-ledger
Optional WebSocket dependency:
pip install 'nexus-ledger[transport]'
Quickstart
from nexus_ledger import Agent
mercury = Agent("Mercury", relays=["http://104.236.251.94:8765", "http://localhost:8765"])
iris = Agent("Iris")
request = mercury.request_task("Iris", description="market research", budget=100)
iris.check_inbox() # Iris receives + countersigns
mercury.check_inbox() # Mercury receives final countersigned receipt
chain = mercury.get_task_chain(request["data"]["task_id"])
print(len(chain))
API Highlights
Agent(name, relays=[...])agent.send(event_type, data, to="Iris", encrypted=True)agent.on_receipt(callback)agent.request_task(...)agent.accept_task(...)agent.deliver_task(...)agent.confirm_task(...)agent.dispute_task(...)agent.get_task_chain(task_id)agent.trust_score()agent.get_trust_report(agent_pubkey)
CLI
nexus-ledger init --name Mercury
nexus-ledger send Iris TaskRequest '{"task_id":"t1","description":"research","budget":100,"deadline":"2026-03-22T12:00:00+00:00"}'
nexus-ledger inbox
nexus-ledger history
nexus-ledger agents
nexus-ledger verify '{"timestamp":"...","event_type":"TaskConfirmed",...}'
Global CLI options:
--name(defaultMercury)--keys-dir(defaultkeys)--db-path(defaultnexus.db)--relays(defaulthttp://104.236.251.94:8765 http://localhost:8765)
Encryption Model
When encrypted=True is used, receipt payloads are encrypted with NaCl Box so relay servers see only the signed envelope metadata and ciphertext. Receivers decrypt automatically before verification/countersigning.
Demo
Run:
python3 demo.py
The demo shows multi-relay config, live callback registration, typed task flow, chained receipts, encrypted transport, and trust report output.
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.2.0.tar.gz.
File metadata
- Download URL: nexus_ledger-4.2.0.tar.gz
- Upload date:
- Size: 31.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48d83e58107c482a3c5d86a8ed5831fa761ece8c3c6d772d429329d952219d3b
|
|
| MD5 |
671876fbbd82ee6c95587005590b5fb4
|
|
| BLAKE2b-256 |
0a5d5516d161d89b881d76c4377a3d129e79f14b36c9dde6c52de5780db143be
|
File details
Details for the file nexus_ledger-4.2.0-py3-none-any.whl.
File metadata
- Download URL: nexus_ledger-4.2.0-py3-none-any.whl
- Upload date:
- Size: 36.7 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 |
81c2e4dd4edef5bb09e35c62ec9774c6b08e09ba714be3140f8ff0ebcc98c855
|
|
| MD5 |
c4cfab1fb593d81fbd04bcd7c2588ffb
|
|
| BLAKE2b-256 |
a3c80ff71b49ad0912c68db2eca1d4fb6ab809ad246648cc0458d356997a3b1e
|