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
Metadata
Release files for py-sr25519-bindings-fork 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_sr25519_bindings_fork-0.2.4.tar.gz | 21.1 kB | Details |
Built distributions (wheels)
Total release size: 21.5 MB
Release files / py_sr25519_bindings_fork-0.2.4.tar.gz
| Download URL | py_sr25519_bindings_fork-0.2.4.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dc152439e1bec272fa18e11458474fdf7f41144e8ae5dffa5438309df1c4137
|
|
BLAKE2b-256 checksum How to use checksums |
8eb63d5cd736629f7698e4212d25b859f5bc65f5361786f2f2e2e654ca405045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3 |
|
SHA-256 checksum How to use checksums |
8a5a81d72c43c069a8eccac1bfab783a20fbf1b24570aa782bf3e164b7530620
|
|
BLAKE2b-256 checksum How to use checksums |
b058e56e1507ac32c0e2bdb8fb06c5001e595b2e9fa7b51891c629809028e3d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_24_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_24_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 |
|
SHA-256 checksum How to use checksums |
60051e8e3d56afc23168b9c3d8be4db653a1902472dd750c55b164edfdf4c610
|
|
BLAKE2b-256 checksum How to use checksums |
32f371ee02259af96e965aed05433d46eee9b499fac7565f53ea26568e45c11f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
5602fbc512dfe34a84d4bdd23643514478a5630939ac177d7848f78baa090d08
|
|
BLAKE2b-256 checksum How to use checksums |
10952a7d6119a4904a32ea3cdeff4df8a23a28d6231d48d27d70727d0eca54f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
ff2c527992aad2a02b17bf254e2efcbcf0255109b031d7034dd97ede14effb98
|
|
BLAKE2b-256 checksum How to use checksums |
dbf1dc6e386bbbd7aa98213a3f4cb0b680e045ca10b2cd423f1903c1ae4327d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
8352f2a474d7be2d6080a4bb7936e842249687ddb702dd57823478538dd8ecf4
|
|
BLAKE2b-256 checksum How to use checksums |
da7dea22a1ca703c9101bf2d52a198f736438280f5c000837f6ddba9c4564333
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
9bddb4d0ac0afb93669620b8ac360f55262adc0087bd1f049b45b73ba0070a4d
|
|
BLAKE2b-256 checksum How to use checksums |
d407f0b9b1c74403439c3d4c3fbff3bfd475582e9daa5cc40d88b9313635ca0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|
Release files / py_sr25519_bindings_fork-0.2.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | py_sr25519_bindings_fork-0.2.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
f96a314aad55d7fbcbdb2d1d6c5785206a0ff4b41c39da8d77c26897c31a67bd
|
|
BLAKE2b-256 checksum How to use checksums |
b1e230e3b2c329fdc51af5026a1b2e013664827e9aefc2b80a1385121e65f8ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.1
|