Skip to content

MoltyCel/moltrust-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

MIT — CryptoKRI GmbH, Zurich, Switzerland

About

Python SDK for MolTrust — Trust Layer for the Agent Economy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages