Skip to main content

DIAP Python SDK

Decentralized Intelligent Agent Protocol (DIAP) SDK for Python.

A Python implementation of the DIAP protocol for decentralized identity management and agent authentication using zero-knowledge proofs.

Features

  • Decentralized Identity: W3C DID:key implementation
  • Zero-Knowledge Proofs: ZKP-based authentication using snarkjs
  • IPFS Integration: Decentralized storage with IPNS support
  • P2P Networking: Hyperswarm and Iroh communication
  • Agent Authentication: Secure agent identity and verification
  • Encryption: Ed25519 keys with AES-256-GCM encryption

Installation

pip install diap-sdk

Or install from source:

git clone https://github.com/logos-42/DIAP_Python_SDK.git
cd DIAP_Python_SDK
pip install -e .

Quick Start

from diap import KeyManager, DIDBuilder

# Generate a key pair
km = KeyManager()
key_pair = km.generate()

# Create DID document
builder = DIDBuilder()
doc = builder.create_did_document(key_pair)
print(f"DID: {doc.id}")

Development

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest tests/

Project Structure

diap/
├── __init__.py           # Main package exports
├── key_manager.py         # Ed25519 key generation and management
├── did_builder.py         # W3C DID Document creation
├── did_cache.py          # DID document caching
├── identity_manager.py   # Identity registration and ZKP verification
├── noir_zkp.py          # ZKP circuit integration
├── ipfs_client.py       # IPFS HTTP API client
├── ipfs_node_manager.py # Local Kubo node management
├── ipns_manager.py      # IPNS publishing/resolution
├── kubo_installer.py    # Auto-install Kubo IPFS daemon
├── agent_auth.py        # Agent authentication
├── agent_verification.py # Agent verification
├── real_name_auth.py    # Real-name authentication
├── pubsub_authenticator.py # PubSub authentication
├── nonce_manager.py     # Nonce management
├── encrypted_peer_id.py # PeerID encryption
├── iroh_communicator.py # Iroh P2P communication
├── p2p/
│   └── hyperswarm_communicator.py  # Hyperswarm P2P
├── types/               # Type definitions
├── utils/               # Utilities
└── zkp/                 # ZKP backends

License

MIT License

Download files

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

Source Distribution

diap_sdk-0.1.3.tar.gz (53.3 kB view details)

Uploaded Source

Built Distribution

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

diap_sdk-0.1.3-py3-none-any.whl (67.4 kB view details)

Uploaded Python 3

File details

Details for the file diap_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: diap_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 53.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.8

File hashes

Hashes for diap_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 28bed9e7c450fa01d0d5f3e158a346adf4fc229d4a9f8ed07f3459585ca0dba4
MD5 5044ce9fee028f76ba79c3a8bee452fa
BLAKE2b-256 7715fb00cf4fdf6c518d172dbdc32a13b7883b4e94af6f134262a1637d47ba84

See more details on using hashes here.

File details

Details for the file diap_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: diap_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 67.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.8

File hashes

Hashes for diap_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fafc45448e14871e798e49e9f88b7dbdafdce6343a19f8409979fe679235f0d3
MD5 77e699204014c6120c8cd1bfcb214dc6
BLAKE2b-256 82ef5645618fd346c778094f830e8c7295e0277393cc91a5dc73d44773f2e88f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page