Metadata-Version: 2.4
Name: zktls-py-sdk
Version: 0.1.2
Summary: A Python SDK for Primus Labs' Zero-Knowledge TLS (ZK TLS) protocol, enabling secure attestation and proxy TLS functionality for privacy-preserving data verification
Project-URL: Homepage, https://primuslabs.xyz
Project-URL: Repository, https://github.com/pkjha527/zktls-py-sdk.git
Project-URL: Documentation, https://github.com/pkjha527/zktls-py-sdk#readme
Project-URL: Bug Tracker, https://github.com/pkjha527/zktls-py-sdk/issues
Author-email: Praveen Kumar Jha <praveen@gamp.gg>
License-Expression: MIT
License-File: LICENSE
Keywords: attestation,blockchain,ethereum,privacy,tls,zero-knowledge,zk
Classifier: Development Status :: 4 - Beta
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.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: asyncio>=3.4.3
Requires-Dist: eth-account>=0.8.0
Requires-Dist: eth-typing>=3.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: web3>=6.0.0
Provides-Extra: dev
Requires-Dist: black>=22.0.0; extra == 'dev'
Requires-Dist: flake8>=4.0.0; extra == 'dev'
Requires-Dist: isort>=5.10.0; extra == 'dev'
Requires-Dist: mypy>=0.900; extra == 'dev'
Requires-Dist: pylint>=2.12.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser>=0.18.0; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == 'docs'
Requires-Dist: sphinx>=4.0.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.18.0; extra == 'test'
Requires-Dist: pytest-cov>=3.0.0; extra == 'test'
Requires-Dist: pytest-mock>=3.6.0; extra == 'test'
Requires-Dist: pytest>=7.0.0; extra == 'test'
Description-Content-Type: text/markdown

# ZK TLS Python SDK

A Python SDK for integrating Zero-Knowledge TLS attestation into your applications.

## Overview

The ZK TLS Python SDK provides a seamless interface to the ZK TLS protocol, enabling secure and private attestation of network interactions. It wraps the Node.js ZK TLS Core SDK and provides a Pythonic interface for easy integration.

## Features

- 🔒 Secure TLS attestation
- 🔍 Response verification
- 📝 Custom templates support
- 🛠️ Configurable attestation conditions
- 🔄 Automatic SSL cipher configuration
- 🐍 Native Python async/await support

## Installation

```bash
pip install zktls-py-sdk
```

### Prerequisites

- Python 3.8+
- Node.js 14+
- npm 6+

The SDK will automatically check for these dependencies during initialization.

## Quick Start

```python
import asyncio
from zktls import NodeWrapper

async def main():
    # Initialize SDK
    wrapper = NodeWrapper()
    await wrapper.init("your-app-id", "your-app-secret")
    
    # Define request
    request = {
        "url": "https://api.example.com/data",
        "header": {"Accept": "application/json"},
        "method": "GET",
        "body": ""
    }
    
    # Define response resolves
    response_resolves = [
        {
            "keyName": "field1",
            "parseType": "string",
            "parsePath": "$.field1"
        }
    ]
    
    # Start attestation
    attestation = await wrapper.start_attestation(
        request=request,
        response_resolves=response_resolves
    )
    
    # Verify attestation
    is_verified = await wrapper.verify_attestation(attestation)
    print(f"Attestation verified: {is_verified}")

if __name__ == "__main__":
    asyncio.run(main())
```

## Documentation

- [Quick Start Guide](docs/quickstart.md)
- [API Reference](docs/api.md)
- [Examples](examples/)

## Key Concepts

### Attestation Flow

1. **Initialization**: Create a NodeWrapper instance and initialize with credentials
2. **Request Definition**: Define the HTTP request and response parsing rules
3. **Attestation**: Start the attestation process with optional custom parameters
4. **Verification**: Verify the attestation response

### Response Resolves

Response resolves define how to parse and extract data from the response:

```python
response_resolves = [
    {
        "keyName": "field1",    # Name for the extracted field
        "parseType": "string",  # Expected type
        "parsePath": "$.field1" # JSONPath to the field
    }
]
```

### Templates

Templates allow customization of attestation behavior:

```python
attestation = await wrapper.start_attestation(
    request=request,
    response_resolves=response_resolves,
    template_id="my-custom-template"
)
```

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Security

For security issues, please email security@primuslabs.xyz instead of using the issue tracker.
