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: Real BN128 elliptic-curve Schnorr proofs via py_ecc (snarkjs CLI as optional backend)
- IPFS Integration: Decentralized storage with IPNS support
- P2P Networking: Real iroh gossip communication + libp2p identity/signing
- Agent Authentication: Secure agent identity and verification
- Encryption: Ed25519 keys (pynacl, RFC 8032) with AES-256-GCM + ECIES 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.4.tar.gz
(63.1 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
diap_sdk-0.1.4-py3-none-any.whl
(76.0 kB
view details)
File details
Details for the file diap_sdk-0.1.4.tar.gz.
File metadata
- Download URL: diap_sdk-0.1.4.tar.gz
- Upload date:
- Size: 63.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c734d475b5cbaed8f645280e455e21cc8a1e4e8f083bec217a7aea2c78fb3d8d
|
|
| MD5 |
d1bbfdc6c8f09d2684984976729d373a
|
|
| BLAKE2b-256 |
6ed5f7c369904a594f043627d990f0a7e2bad91a9b310624ef51122f36a956be
|
File details
Details for the file diap_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: diap_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 76.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88cc22d6c87ffc3b8cc8358b0ff7687e98f45196e8ce6fab899b3c75ff385844
|
|
| MD5 |
ee5a2d6bf136f0b6853a1abb234a1634
|
|
| BLAKE2b-256 |
1e2f30010fb1885baa169b6613e1553e001f59034918ecf480ce6fe15527a30d
|