Skip to main content

Python bindings for the ed25519-dalek RUST crate

Project description

py-ed25519-bindings

Python bindings for the ed25519-dalek RUST crate

Documentation

https://docs.rs/py-ed25519-bindings

Installation

Install from PyPI

pip install py-ed25519-bindings

Compile for local development

pip install -r requirements.txt
maturin develop

Build wheelhouses

pip install -r requirements.txt

# Build local OS wheelhouse
maturin build

# Build manylinux1 wheelhouse
docker build . --tag polkasource/maturin
docker run --rm -i -v $(pwd):/io konstin2/maturin build

Usage

import bip39
import ed25519_dalek

message = b"test"

# Get private and public key from seed
seed = bip39.bip39_to_mini_secret('daughter song common combine misery cotton audit morning stuff weasel flee field','')
private_key, public_key = ed25519_dalek.ed_from_seed(bytes(seed))

# Generate signature
signature = ed25519_dalek.ed_sign(public_key, private_key, message)
print(signature.hex())

# Verify message with signature
if ed25519_dalek.ed_verify(signature, message, public_key):
    print('Verified')

License

https://github.com/polkascan/py-ed25519-bindings/blob/master/LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_ed25519_bindings-1.0.2.tar.gz (10.0 kB view hashes)

Uploaded source

Built Distributions

py_ed25519_bindings-1.0.2-cp310-none-win32.whl (194.4 kB view hashes)

Uploaded cp310

py_ed25519_bindings-1.0.2-cp39-none-win32.whl (194.4 kB view hashes)

Uploaded cp39

py_ed25519_bindings-1.0.2-cp38-none-win32.whl (194.4 kB view hashes)

Uploaded cp38

py_ed25519_bindings-1.0.2-cp37-none-win32.whl (194.3 kB view hashes)

Uploaded cp37

py_ed25519_bindings-1.0.2-cp36-none-win32.whl (194.5 kB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page