Skip to main content

DIAP Python SDK - Decentralized Intelligent Agent Protocol

Project description

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

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

diap_sdk-0.1.0.tar.gz (42.8 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.0-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for diap_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f206a939ce63a68e5deb4a218675263fd5c236779ad0ad0b5612baae17e725fc
MD5 6557c9752da55ac1073db5d9b20cf5b8
BLAKE2b-256 b07beb4b362f446a8258adbd975142cd22bc10f3c7c7eaf23e9569dd10f1c2a7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for diap_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7afe61417cc4d3782a7c36354496de0b51572b1f8444b2bc81dbbf639e6bc66a
MD5 dfdb5ab6ad0d6ddc46555ebd89772023
BLAKE2b-256 e6ed85c1634464072e92c31127720d8fb82f137018e9b7af6d7e555684d830a2

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