Skip to main content

QoreSign for Python

Hybrid secp256k1 + ML-DSA-87 (FIPS 204) signing, verification and Sign In With QoreChain (SIWQ) for Python 3.9+. The package wraps the Rust implementation (crates/qoresign) through UniFFI, so its output is byte-identical to the TypeScript, Rust, Go, Swift and Kotlin packages; all of them are checked against vectors/qoresign-v1.json.

It is offline: key derivation, signing, verification, key registration messages, message signing and SIWQ. Fetching account numbers and broadcasting stay in your app.

Lanes

Lane Today
native hybrid ML-DSA-87 (FIPS 204) signature plus secp256k1
EVM quantum-ready only: the account registers an ML-DSA-87 key and opens an authorization window from the native lane; EVM transactions carry no ML-DSA-87 signature
SVM not available (LANE_NOT_AVAILABLE)

Install

pip install qorechain-qoresign
import qoresign

Wheels: macOS 11+ (arm64, x86_64), Linux manylinux2014 (x86_64, aarch64) and Windows (x86_64). One wheel per platform serves every Python 3 version: the bindings call the native library through ctypes. Other platforms build from the source distribution, which needs Rust 1.95.

Example

import qoresign as qs

# Public BIP-39 test phrase: never send funds to it.
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"

classical = qs.derive_classical_key(mnemonic, qs.ClassicalKeyType.SECP256K1)  # m/44'/118'/0'/0/0
account = qs.address_from_public_key(classical.public_key, qs.ClassicalKeyType.SECP256K1)
pq_key = qs.derive_canonical_pq_key(mnemonic, account.bech32)  # the key QoreChain wallets register

# body_bytes, auth_info_bytes and account_number come from the transaction you build.
signed = qs.sign_hybrid("qorechain-vladi", account_number, body_bytes, auth_info_bytes, classical, pq_key=pq_key)
# signed.tx_bytes is the encoded TxRaw, ready to broadcast.

result = qs.verify_hybrid_tx(
    signed.tx_bytes, "qorechain-vladi", account_number, classical.public_key,
    pq_public_key=pq_key.public_key,
)
assert result.valid and result.classical and result.pq.valid

Sign arbitrary data (spec/message-signing-v1.md):

data = b"Approve export of report 2026-10"
sig = qs.sign_message("qorechain-vladi", account.bech32, data, classical, pq_key=pq_key)
as_json = qs.message_signature_to_json(sig)  # JSON shape shared by every implementation

# pq_public_key: the key registered on chain for the signer.
qs.verify_message(
    "qorechain-vladi", account.bech32, data,
    qs.message_signature_from_json(as_json), pq_public_key=pq_key.public_key,
)  # raises QoreSignError when the signature does not verify

Verify a sign-in on the server (spec/siwq-v1.md):

fields = qs.verify_siwq(
    message,                               # the text the wallet signed
    qs.siwq_signature_from_json(sig_json), # the signature the wallet returned
    "app.example.com",                     # your domain
    nonce,                                 # the nonce you issued
    pq_public_key=registered_pq_key,       # the account's key registered on chain
    chain_id="qorechain-vladi",
)
print(fields.address)  # qor1...

A wallet creates the message with create_siwq_message(qs.SiwqFields(...)) and signs it with sign_siwq(message, classical, pq_key=pq_key).

Errors are QoreSignError; code is the stable code shared by every implementation:

try:
    qs.derive_classical_key("not a phrase", qs.ClassicalKeyType.SECP256K1)
except qs.QoreSignError as e:
    print(e.code, e.detail)  # INVALID_MNEMONIC ...

Byte fields are bytes; records are plain classes with keyword-only constructors and value equality. Optional arguments default to the same values as the TypeScript package (v2 sign-bytes, deterministic ML-DSA-87, hybrid mode). verify_siwq(..., now_ms=...) takes Unix milliseconds; None reads the system clock. A sign-in message without an expiration time is accepted for max_age_seconds after its issued-at time (default 600; pass a positive value to change it). Format constants (ML_DSA_87_SIGNATURE_LENGTH, PQC_HYBRID_TYPE_URL, ...) are module attributes.

Build locally

Needs Rust 1.95 and Python 3.9+.

python3 -m venv .venv && . .venv/bin/activate
pip install -r python/requirements-dev.txt
scripts/build-python-wheels.sh                # this machine's wheel -> python/dist/
pip install --no-index --find-links python/dist qorechain-qoresign
pytest python/tests

scripts/build-python-wheels.sh takes a list of targets: host, macos-arm64, macos-x86_64, sdist, and check (scans python/dist for build-machine paths, which every build also does). The release workflow builds the Linux and Windows wheels. python/qoresign/_ffi/ is UniFFI output, generated at build time.

License

Apache-2.0

Metadata

Release files for qorechain-qoresign 0.2.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 qorechain-qoresign 0.2.0
File Size Uploaded Provenance Actions
qorechain_qoresign-0.2.0.tar.gz 62.7 kB Without provenance Details for qorechain_qoresign-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for qorechain-qoresign 0.2.0
File Actions
qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
qorechain_qoresign-0.2.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for qorechain_qoresign-0.2.0-py3-none-macosx_11_0_x86_64.whl
qorechain_qoresign-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for qorechain_qoresign-0.2.0-py3-none-macosx_11_0_arm64.whl

Total release size: 2.4 MB

Release files / qorechain_qoresign-0.2.0.tar.gz

Download URL qorechain_qoresign-0.2.0.tar.gz
Size 62.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2acd1ae229b0defc630aeda57a9637855e3c4902243dd083ac0a189cac3c637c
BLAKE2b-256 checksum
How to use checksums
5e64a29734d18b889ca5ba1acf505e119eb787e174d380a92f32c11a0a6f8713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 609.9 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
91569f5d7c24cfb43a19eb838487b69e9cda916ea933d5ee9209c541fb7fdc94
BLAKE2b-256 checksum
How to use checksums
cec64608b7180bea98893d3cc209626a39574e422f3012e6172a5cbadb69df50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qorechain_qoresign-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 614.4 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
3abf104c544db0b554aa5b9f11f37f4842da9176eefa46ec681f44b13fd171e4
BLAKE2b-256 checksum
How to use checksums
740445351f0c1026acfe2a764c3987de56db0b81ab8c0094e66a795407da34b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / qorechain_qoresign-0.2.0-py3-none-macosx_11_0_x86_64.whl

Download URL qorechain_qoresign-0.2.0-py3-none-macosx_11_0_x86_64.whl
Size 584.4 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
6b1a4ee3edd0803fd796544e3f1bed91bebbffb4a9ef4ade362f6be3342f4f94
BLAKE2b-256 checksum
How to use checksums
ece19cdb0f2b15a16a6fff2a23a3f463c097e4133234b6fe68460f6646f3006f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / qorechain_qoresign-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL qorechain_qoresign-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 569.6 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
91b8783ef1dd4b7da564b22a87bda8d7ccdc63e7b00c3de7c81a60c704e057fb
BLAKE2b-256 checksum
How to use checksums
ef289efd2a40cb31ef5802ffe1687682502c441b61ce64a3f02cf8ff8d7bc849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for qorechain-qoresign 0.2.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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

5 release files No provenance

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