Registry /
auth-security / py-ed25519-zebra-bindings
Install & Compatibility
Where this runs
tested against v1.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.9MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ed25519_zebra
✓ import ed25519_zebra
✗ from ed25519_zebra import generate_keypair
ed_from_seed
✓ from ed25519_zebra import ed_from_seed
ed_sign
✓ from ed25519_zebra import ed_sign
This example demonstrates how to generate an Ed25519 keypair, sign a message with the secret key, and then verify the signature using the public key. It also shows how to convert keys to and from byte representations and derive the public key from a secret key.
from ed25519_zebra import generate_keypair, sign, verify, PublicKey, SecretKey, ed_public_from_secret
# Generate a new keypair
secret_key, public_key = generate_keypair()
print(f"Secret Key: {secret_key.to_bytes().hex()}")
print(f"Public Key: {public_key.to_bytes().hex()}")
# Message to sign (must be bytes)
message = b"This is a test message to be signed."
# Sign the message
signature = sign(secret_key, message)
print(f"Signature: {signature.to_bytes().hex()}")
# Verify the signature
is_valid = verify(public_key, signature, message)
print(f"Signature valid: {is_valid}")
# Example of converting bytes to key objects
public_key_bytes = public_key.to_bytes()
secret_key_bytes = secret_key.to_bytes()
reconstructed_public_key = PublicKey.from_bytes(public_key_bytes)
reconstructed_secret_key = SecretKey.from_bytes(secret_key_bytes)
print(f"Reconstructed Public Key Matches: {reconstructed_public_key == public_key}")
print(f"Reconstructed Secret Key Matches: {reconstructed_secret_key == secret_key}")
# Derived public key from secret (available from v1.1.0+)
derived_public_key = ed_public_from_secret(secret_key)
print(f"Derived Public Key from Secret Matches: {derived_public_key == public_key}")
Debug
Known issues
gotchaType Mismatches for Cryptographic Operations. Functions like `sign` and `verify` expect byte strings (`bytes`) for messages and specific key/signature objects (`SecretKey`, `PublicKey`, `Signature`). Passing regular `str` objects or incorrect types will lead to `TypeError`.fixAlways ensure messages are `bytes` (e.g., `b"your_message"`) and use `SecretKey.from_bytes()` or `PublicKey.from_bytes()` when loading keys from raw bytes.
affects: All
breakingMinimum Python Version. The library requires Python 3.9 or higher. Attempting to install or run on older Python versions will result in installation failures or runtime errors.fixUpgrade your Python environment to 3.9 or newer.
affects: All versions >= 1.0.0
gotchaSource Compilation Requirements. If pre-built wheels are not available for your specific OS/architecture/Python version, `pip` will attempt to build the library from source, which requires a Rust toolchain (Rust compiler, Cargo).fixEnsure Rust and Cargo are installed (e.g., `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`) or switch to a platform/Python version with available wheels.
affects: All
breakingNew Functions in Newer Versions. The `ed_public_from_secret` function was added in v1.1.0. Attempting to use this function in versions prior to 1.1.0 will result in an `AttributeError`.fixEnsure your `py-ed25519-zebra-bindings` version is 1.1.0 or newer if you need to use `ed_public_from_secret`.
affects: < 1.1.0
Upgrade
Version history
1.3.0latest on PyPI · released Sep 3, 2025
Audit
Dependencies
No dependency data recorded yet.