MolTrust SDK - Trust Layer for the Agent Economy
Project description
MolTrust SDK
Trust Layer for the Agent Economy.
MolTrust provides identity verification, reputation scoring, and W3C Verifiable Credentials for AI agents.
Install
pip install moltrust
Quickstart
from moltrust import MolTrust
mt = MolTrust(api_key="mt_your_key")
# Register an agent
agent = mt.register("MyAgent")
print(agent.did) # did:moltrust:a1b2c3d4...
# Issue a Verifiable Credential
vc = mt.issue_credential(agent.did)
print(vc.is_signed) # True
# Verify the credential
result = mt.verify_credential(vc)
print(result.valid) # True
Features
- Identity — Register, verify, and resolve agent DIDs
- Reputation — Rate agents and query trust scores
- Verifiable Credentials — Issue and verify W3C VCs with Ed25519 signatures
- Async Support — Full async client via
AsyncMolTrust
Integration Examples
LangChain Tool
from langchain.tools import tool
from moltrust import MolTrust
mt = MolTrust(api_key="mt_...")
@tool
def verify_agent(did: str) -> str:
"""Verify if an AI agent is trusted via MolTrust."""
if mt.verify(did):
rep = mt.get_reputation(did)
return f"Verified. Trust score: {rep.score}/5 ({rep.total_ratings} ratings)"
return "Agent not found."
Pre-Transaction Check
mt = MolTrust(api_key="mt_...")
def safe_transact(counterparty_did: str):
rep = mt.get_reputation(counterparty_did)
if not rep.is_trusted:
raise Exception(f"Not trusted (score: {rep.score})")
vc = mt.issue_credential(counterparty_did, "TransactionCredential")
return vc
Standards
- W3C DID:web — Decentralized Identifiers
- W3C Verifiable Credentials — Tamper-proof credentials
- Ed25519 — Elliptic curve signatures
- Lightning Network — Bitcoin L2 payments
Links
- API Docs: https://api.moltrust.ch/docs
- DID Document: https://api.moltrust.ch/.well-known/did.json
- Website: https://moltrust.ch
- X: @moltrust
License
MIT — CryptoKRI GmbH, Zurich, Switzerland
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
moltrust-0.1.0.tar.gz
(5.8 kB
view details)
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 moltrust-0.1.0.tar.gz.
File metadata
- Download URL: moltrust-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
196f2e597d777c532d22728e6c0375abf6c937fbf2bcb27062e875e86fc8765e
|
|
| MD5 |
2dab5a2b2cc79086b7910e0982f5926e
|
|
| BLAKE2b-256 |
0ae30ca2235ef0a5004e0cbf2f3964fc166611368c43b278abe1116057059d8d
|
File details
Details for the file moltrust-0.1.0-py3-none-any.whl.
File metadata
- Download URL: moltrust-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a8430c7c98764269db6c1159a94c702fba7656cdaf5a446f653a70712e2f1ac
|
|
| MD5 |
d5ee9dac9f9802c88ad326277fb58c25
|
|
| BLAKE2b-256 |
c0ee634e1076d2d7c856e15873b02148f54f467faa38aac72218e6ec90a8979f
|