Skip to main content

Fork Python bindings for sr25519 library

Project description

py-sr25519-bindings

Python bindings for sr25519 library: https://github.com/w3f/schnorrkel

Reference to https://github.com/LocalCoinSwap/kusama-reference-implementation/tree/improve-trading-tests/bindings and https://gitlab.com/kauriid/schnorrpy/ for the initial work

Documentation

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

Installation

Install from PyPI

pip install py-sr25519-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

Usage

import bip39
import sr25519

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','')

public_key, private_key = sr25519.pair_from_seed(bytes(seed))

# Generate signature
signature = sr25519.sign(
    (public_key, private_key),
    message
)

print('Signature', signature.hex())

# Verify message with signature
if sr25519.verify(signature, message, public_key):
    print('Verified')

License

https://github.com/polkascan/py-sr25519-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_sr25519_bindings_fork-0.2.4.tar.gz (21.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_24_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64

py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.5+ x86-64

py_sr25519_bindings_fork-0.2.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

py_sr25519_bindings_fork-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

py_sr25519_bindings_fork-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

py_sr25519_bindings_fork-0.2.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

File details

Details for the file py_sr25519_bindings_fork-0.2.4.tar.gz.

File metadata

  • Download URL: py_sr25519_bindings_fork-0.2.4.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.1

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4.tar.gz
Algorithm Hash digest
SHA256 4dc152439e1bec272fa18e11458474fdf7f41144e8ae5dffa5438309df1c4137
MD5 08cceb9bd53dc13f74e00f97b1865acf
BLAKE2b-256 8eb63d5cd736629f7698e4212d25b859f5bc65f5361786f2f2e2e654ca405045

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8a5a81d72c43c069a8eccac1bfab783a20fbf1b24570aa782bf3e164b7530620
MD5 880908ae4ec7e543f8ecbc4bf040f07c
BLAKE2b-256 b058e56e1507ac32c0e2bdb8fb06c5001e595b2e9fa7b51891c629809028e3d1

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 60051e8e3d56afc23168b9c3d8be4db653a1902472dd750c55b164edfdf4c610
MD5 61cbcb8c86510b61b778bf71532856a4
BLAKE2b-256 32f371ee02259af96e965aed05433d46eee9b499fac7565f53ea26568e45c11f

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5602fbc512dfe34a84d4bdd23643514478a5630939ac177d7848f78baa090d08
MD5 32e8c2e1656ba18589cc5a5c70ea7bf8
BLAKE2b-256 10952a7d6119a4904a32ea3cdeff4df8a23a28d6231d48d27d70727d0eca54f9

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ff2c527992aad2a02b17bf254e2efcbcf0255109b031d7034dd97ede14effb98
MD5 0be7820aae57900d16baec0cbbd75cfc
BLAKE2b-256 dbf1dc6e386bbbd7aa98213a3f4cb0b680e045ca10b2cd423f1903c1ae4327d8

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8352f2a474d7be2d6080a4bb7936e842249687ddb702dd57823478538dd8ecf4
MD5 2087e3ad9fdd4307d58bcefe082f604d
BLAKE2b-256 da7dea22a1ca703c9101bf2d52a198f736438280f5c000837f6ddba9c4564333

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9bddb4d0ac0afb93669620b8ac360f55262adc0087bd1f049b45b73ba0070a4d
MD5 7961255decdb3a3e11919df5cd17669b
BLAKE2b-256 d407f0b9b1c74403439c3d4c3fbff3bfd475582e9daa5cc40d88b9313635ca0a

See more details on using hashes here.

File details

Details for the file py_sr25519_bindings_fork-0.2.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for py_sr25519_bindings_fork-0.2.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f96a314aad55d7fbcbdb2d1d6c5785206a0ff4b41c39da8d77c26897c31a67bd
MD5 0c311e171500b59f266aceb30324438a
BLAKE2b-256 b1e230e3b2c329fdc51af5026a1b2e013664827e9aefc2b80a1385121e65f8ae

See more details on using hashes here.

Supported by

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