Metadata-Version: 2.4
Name: quantumsafe
Version: 2.0.0
Summary: QuantumSafe — Post-quantum cryptography SDK for blockchain
License: MIT
Project-URL: Homepage, https://qsafe.dev
Project-URL: Documentation, https://docs.qsafe.dev
Project-URL: Repository, https://github.com/qshield-xyz/quantumsafe-python-sdk
Project-URL: Issues, https://github.com/qshield-xyz/quantumsafe-python-sdk/issues
Project-URL: Changelog, https://github.com/qshield-xyz/quantumsafe-python-sdk/blob/main/CHANGELOG.md
Keywords: quantum,pqc,blockchain,ml-dsa,post-quantum,cryptography,ethereum,solana,bitcoin
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: pqcrypto<2.0.0,>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: respx>=0.21.0; extra == "dev"
Dynamic: license-file

# quantumsafe

Post-quantum cryptography SDK for blockchain. Scan wallets for quantum risk, generate PQC keys, and verify PQC signatures.

Docs: [docs.qsafe.dev](https://docs.qsafe.dev) · Issues: [GitHub](https://github.com/qshield-xyz/quantumsafe-python-sdk/issues) · [Changelog](CHANGELOG.md)

## Install

```bash
pip install quantumsafe
```

## Quick Start

Set `QSAFE_API_KEY` to your server-side secret API key. Generate a local key pair, register the public key and verify a PQC signature over a message.

```python
import os
from pqcrypto.sign import ml_dsa_65
from quantumsafe import QuantumSafe

with QuantumSafe(api_key=os.environ["QSAFE_API_KEY"]) as qs:
    keypair = qs.keys.generate(algorithm="ml-dsa-65")
    qs.keys.register(public_key=keypair.public_key, chain="ethereum")
    message = bytes.fromhex("deadbeef")
    signature = ml_dsa_65.sign(bytes.fromhex(keypair.private_key), message)
    result = qs.verify(public_key=keypair.public_key, message=message.hex(), signature=signature.hex())
    print(result.valid)
```

In the updated SDK source, set `QSAFE_ADDRESS` to an address on the chain you want to scan.

```python
with QuantumSafe(api_key=os.environ["QSAFE_API_KEY"]) as qs:
    scan = qs.scan.wallet(chain="bitcoin", address=os.environ["QSAFE_ADDRESS"])
    print(scan.methodology_version, scan.public_key_status, scan.history_status)
    if scan.address_risk_score is not None:
        print(scan.address_risk_score, scan.address_risk_grade)
    if scan.token_data_unavailable:
        print("Token data unavailable")
    for tx in scan.exposed_transactions or []:
        print(tx.hash, tx.explorer_url)
```

## Supported Chains

Wallet scans support `ethereum`, `base`, `arbitrum`, `polygon`, `linea`, `scroll`, `gnosis`, `celo`, `mantle`, `blast`, `optimism`, `bsc`, `avalanche`, `sonic`, `zksync`, `solana`, `bitcoin`, `cosmos`, and `tron`. The exported `ScanChain` type lists these values. Key registration and hybrid signing support `ethereum`, `base`, and `arbitrum`.

`history_status` reports `complete`, `limited`, or `unavailable`. `public_key_status` reports `exposed`, `safe`, or `unknown`. A scan can include transaction evidence even with limited history. An unavailable score and grade are `None`; a measured zero is returned as `0`. Older responses that omit the coverage fields return `None` for those fields.

## Documentation

Full API docs: [https://docs.qsafe.dev](https://docs.qsafe.dev)

## License

MIT — see [LICENSE](./LICENSE)
