Skip to main content

quantumsafe

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

Docs: docs.qsafe.dev · Issues: GitHub · Changelog

Install

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.

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.

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

License

MIT — see LICENSE

Metadata

Release files for quantumsafe 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantumsafe 2.0.0
File Size Uploaded Provenance Actions
quantumsafe-2.0.0.tar.gz 11.8 kB Without provenance Details for quantumsafe-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quantumsafe 2.0.0
File Interpreter ABI Platform Actions
quantumsafe-2.0.0-py3-none-any.whl Python 3 none any Details for quantumsafe-2.0.0-py3-none-any.whl

Total release size: 25.1 kB

Release files / quantumsafe-2.0.0.tar.gz

Download URL quantumsafe-2.0.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3188063a341b94e87b31e2680213ab69cf77b34641c7469d2c521bf3302390cd
BLAKE2b-256 checksum
How to use checksums
b8ba1b2a7d9f5dab31633a504eaf084b691fcebb2eb53e6eb9f362b3fb994ded
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / quantumsafe-2.0.0-py3-none-any.whl

Download URL quantumsafe-2.0.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
459aac7d04a6954639d7751cef6bb694f2a16b5bb5e7a9c0254a8fc6077b9563
BLAKE2b-256 checksum
How to use checksums
9921c86a0653d0ccab90ba700661f5072e6d722a018581df97c1f68114d0c838
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for quantumsafe 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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