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.2.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.2-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diap_sdk-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 07eadc86ed223230ea6ba5e0b9594c2ef1cd5c28fe4b101f256a7b71c73f186e
MD5 830bc987f053fd928cfbf0e02e2b5969
BLAKE2b-256 f3ee9b5dfd0d0f8af2bebb45f9c0ac7358007d060cf413255a7d87be7249481a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: diap_sdk-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da095ed05a830287672ed86dc792b9530cc4b43d421c73c78911019daabaf9d4
MD5 3b3687cbd176fdd86acaad0608280e5e
BLAKE2b-256 47e41d54ac72d3d2899c05c33429de20f1ff94bb80ead4674129817d5b69c42d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

This release

0.1.2 This release

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