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

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 polkasource/maturin build

Examples

import bip39
import ed25519

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.ed_from_seed(bytes(seed))

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

# Verify message with signature
if ed25519.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-0.1.0.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distributions

py_ed25519_bindings-0.1.0-cp38-cp38-macosx_10_7_x86_64.whl (178.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

py_ed25519_bindings-0.1.0-cp37-cp37m-macosx_10_7_x86_64.whl (178.6 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

py_ed25519_bindings-0.1.0-cp36-cp36m-macosx_10_7_x86_64.whl (178.8 kB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

py_ed25519_bindings-0.1.0-cp35-cp35m-macosx_10_7_x86_64.whl (178.7 kB view hashes)

Uploaded CPython 3.5m macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page