Metadata-Version: 2.4
Name: diap-sdk
Version: 0.1.1
Summary: DIAP Python SDK - Decentralized Intelligent Agent Protocol
Home-page: https://github.com/logos-42/DIAP_Python_SDK
Author: DIAP Team
Author-email: dev@diap.ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: ipfshttpclient>=0.8.0a2
Requires-Dist: cryptography>=41.0.0
Requires-Dist: cachetools>=5.3.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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

```bash
pip install diap-sdk
```

Or install from source:

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

## Quick Start

```python
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:

```bash
pip install -e ".[dev]"
```

Run tests:

```bash
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
