algorand-falcon
Python bindings for the Algorand deterministic Falcon (det1024) post-quantum signature scheme, built directly over the algorand/falcon C implementation with cffi in API mode.
- Deterministic: the same
(private key, message)always produces a byte-identical signature (no nonce). This is what Algorand consensus requires. - Bit-exact: compiled with the emulated floating-point, no-SIMD configuration, so signatures are identical across compilers and CPU architectures. This is locked in by the upstream known-answer tests (KATs).
- Small surface: generate, sign, verify. The C-mirroring layer is private, so there is no low-level API to misuse. See ADR 0006.
- Typed: ships
py.typed, and the public surface is fully annotated. - abi3 wheels: one wheel per platform works on CPython 3.10+.
Installation
pip install algorand-falcon
Prebuilt cp310-abi3 wheels are published for Linux (x86_64/aarch64, manylinux and musllinux), macOS (x86_64/arm64), and Windows (amd64). The only runtime dependency is cffi.
Quickstart
from algorand_falcon import falcon1024, InvalidSignature
signer = falcon1024.Signer.generate() # or generate(seed) for deterministic keygen
signature = signer.sign(b"hello world") # deterministic, compressed format
verifier = signer.verifying_key()
verifier.verify(b"hello world", signature) # returns None; raises on failure
assert verifier.is_valid(b"hello world", signature)
try:
verifier.verify(b"tampered", signature)
except InvalidSignature:
print("rejected")
Using with py-algorand-sdk
py-algorand-sdk has no Falcon dependency: its post-quantum signer takes a public key plus a callback that signs exact preimage bytes. signer.sign is that callback.
from algosdk import mnemonic, constants
from algosdk.signer import Falcon1024TransactionSigner
from algorand_falcon import falcon1024
seed = mnemonic.to_pq_seed(my_mnemonic, constants.falcon_1024_scheme) # 32 bytes
signer = falcon1024.Signer.generate(seed)
txn_signer = Falcon1024TransactionSigner(signer.public_key, signer.sign)
The same signer serves both preimage families the SDK produces: transactions ("TX" + msgpack) and delegated logic signatures ("PQProgram" + address + program).
API
The parameter set lives in the falcon1024 namespace module; the exceptions are shared at the top level. The scheme is det1024 (deterministic Falcon-1024), and its signatures are not interoperable with standard randomized ("salted") Falcon-1024.
falcon1024.Signer
falcon1024.Signer.generate(seed: bytes | None = None) -> Signer: create a new keypair.seed=Nonederives from a fresh 48-byte OS CSPRNG seed. Otherwiseseeddeterministically derives the keypair and may be any non-empty length. For Algorand accounts it is the 32 bytesalgosdk.mnemonic.to_pq_seed()returns.falcon1024.Signer(private_key: bytes): load from stored private key bytes. The public key is recomputed from the private key, so the two can never disagree..sign(message: bytes) -> bytes: deterministic compressed signature..verifying_key() -> falcon1024.Verifier.private_key,.public_key: rawbytes.
falcon1024.Verifier
falcon1024.Verifier(public_key: bytes).verify(message, signature) -> None: raisesInvalidSignatureon failure..is_valid(message, signature) -> bool.public_key
Key hygiene
sign and verify operate on raw bytes with no domain separation: the message is signed verbatim. A key that signs arbitrary caller-supplied bytes can be made to sign a valid transaction preimage, so use one key for one protocol. To reproduce a signature an application made over a structured object, sign the digest that application hashes to, not the object itself.
Constants
falcon1024.PUBLIC_KEY_SIZE=1793, falcon1024.PRIVATE_KEY_SIZE=2305, falcon1024.COMPRESSED_SIG_MAX_SIZE=1423. Resolved from the C header macros at build time, so they can never drift from the vendored library.
Exceptions
FalconError is the base class. InvalidSignature, KeygenError, and SigningError derive from it. Wrong key sizes raise the built-in ValueError (signatures are variable-length, so a malformed one fails verification with InvalidSignature instead), and arguments of the wrong type raise TypeError.
Development
Requires uv. The Falcon C sources are vendored as a git submodule.
git clone --recurse-submodules https://github.com/algorandfoundation/falcon-py
cd falcon-det1024
uv sync # builds the cffi extension + installs dev deps
uvx pre-commit install # ruff format + lint on every commit
uv run pytest # roundtrip, determinism, tamper, surface, and 512+32 KATs
uv run mypy # strict
uv run ruff format . && uv run ruff check --fix . # or let the pre-commit hook do it
Wheels are built with cibuildwheel (uvx cibuildwheel locally). Releases are cut by python-semantic-release from conventional commits.
See docs/adr/ for the key decisions and docs/DESIGN.md for the binding and packaging reference.
License
MIT. See LICENSE. Bundles the Falcon C implementation (Copyright (c) 2017-2020 Falcon Project, MIT).
Metadata
Release files for algorand-falcon 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| algorand_falcon-0.1.0.tar.gz | 183.1 kB | With provenance | Details for algorand_falcon-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 1.9 MB
Release files / algorand_falcon-0.1.0.tar.gz
| Download URL | algorand_falcon-0.1.0.tar.gz |
|---|---|
| Size | 183.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f09a43c240a6182436b6878b552ba55d4e62f4a61512c0f899039379d65551f6
|
|
BLAKE2b-256 checksum How to use checksums |
86546f2116607309602a4fc081c78cb0087ea109b09665070bb280d4e4f886b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 78.2 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
eb440d73eca868e4a1f06d274690bf7f2f6d9d2b4cae14ee2d1ef3ee3871164e
|
|
BLAKE2b-256 checksum How to use checksums |
0f32ee852631ecf8e7e4ef4825054977bda45dbafe46dea450f450c454207959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-win32.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-win32.whl |
|---|---|
| Size | 75.3 kB |
| Tags | CPython 3.10 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
6be23ea214c6609c6670b6c1af7b7040f2db7741adee1caddb8b83ee45d96e30
|
|
BLAKE2b-256 checksum How to use checksums |
95a8885f9b630868be1731b1a5d43d47f189415ac7f849a6132716323e562d3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 340.9 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
afe3b55ad7b040f4bd9f50ebfe84f36135eac72dfc213b53b25e83bcea3d65c3
|
|
BLAKE2b-256 checksum How to use checksums |
18557fcf1da6cbd6f308df11c8d0b2339c4ab3ec22b32f709b17876d1161d75b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 310.7 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
844d814e8206a4237074a25b05b99848a6fb8bc9adf9699383ebfe4bf6e260c2
|
|
BLAKE2b-256 checksum How to use checksums |
c6a24124b7304808cd3f16cac9b4960ae38dfebf445bb8ed6f0108e71b92866c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 343.9 kB |
| Tags | CPython 3.10 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8365a0a54b653649f94c6e080d20b00ef8d1dca20f2b128dc787ae1535bc58ac
|
|
BLAKE2b-256 checksum How to use checksums |
92d3799db6fceedd9956d8d10f9b650adea43e47a0e1c750535a597d141f46f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 319.2 kB |
| Tags | CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
02b5c1743b5e1f00aa2837c0749ed48503a336ca21cf33470d30c94872694ca7
|
|
BLAKE2b-256 checksum How to use checksums |
1e6677e1710daffca63397f4cf5d8ecec7a250a8a6c0dea63b582a1166963080
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 100.2 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3421fab415e7cb3349327644c06dd489bf974516b3f7549d87d455faf1398ffe
|
|
BLAKE2b-256 checksum How to use checksums |
e11cbbc170908f4cb65c00a04e57fed210fc3242808e0e5c6044d2c41a750d6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / algorand_falcon-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl
| Download URL | algorand_falcon-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 109.5 kB |
| Tags | CPython 3.10 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
2d24a49a250883efca44bdb97b16804c2282eed9ffc951d77eab5dc002ec270b
|
|
BLAKE2b-256 checksum How to use checksums |
ecf44aead6fd851ec226556a5610e35c8f7a2a16ad4a97888544c187169b14af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logSecurity for algorand-falcon 0.1.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.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for algorand_falcon-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logA 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.