nano-rspow-python
Native Nano (XNO) proof-of-work bindings for Python. The extension selects an available GPU backend when possible and otherwise uses the CPU backend. generate_work releases the Python GIL while it searches.
Install
pip install nano-rspow-python
Usage
import nano_rspow
from nano_rspow import WorkType
root = "718CC2121C3E641059BC1C2CFC45666C99E8AE922F7A807B7D07B62C995D79E2"
result = nano_rspow.generate_work(root, WorkType.Send)
print(result.nonce_hex)
assert result.is_valid
assert nano_rspow.validate_work(root, result.nonce_hex, WorkType.Send)
API reference
generate_work(hash_hex, work_type) -> WorkResult
Generates work for a 32-byte hexadecimal block root. Raises ValueError for invalid hexadecimal input or a root that is not 32 bytes. Raises RuntimeError if generation does not return a result.
validate_work(hash_hex, work_hex, work_type) -> bool
Tests a hexadecimal nonce against a block root and the threshold selected by work_type. Raises ValueError for invalid input.
compute_difficulty(hash_hex, nonce_hex) -> str
Returns the raw difficulty as a 16-character lowercase hexadecimal string. Raises ValueError for invalid input.
backend_name() -> str
Returns the selected backend name, such as cpu, wgpu, or opencl.
WorkType
| Value | Use |
|---|---|
Send |
Epoch 2 send and change blocks |
Receive |
Epoch 2 receive blocks |
LegacyEpoch1 |
Historical epoch-1 validation only |
Epoch1 |
Compatibility alias for LegacyEpoch1 |
WorkResult
generate_work returns a read-only result with nonce_hex, difficulty_hex, is_valid, and multiplier properties.
thresholds
The nano_rspow.thresholds submodule provides EPOCH2_SEND, EPOCH2_RECEIVE, LEGACY_EPOCH1, EPOCH1, BETA_LEGACY_EPOCH1, BETA_EPOCH1, DEV, and BASE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nano_rspow_python-0.13.0.tar.gz.
File metadata
- Download URL: nano_rspow_python-0.13.0.tar.gz
- Upload date:
- Size: 52.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ce2d31618d604f97e525c697b8186d10b748467e832bd40eb61549b53fb919c
|
|
| MD5 |
eeb573edd954283faa0f2f07167c3c9f
|
|
| BLAKE2b-256 |
e35de14e5f689ed7149d3a69eca56448e270ad6b3f0f6b7dcc2bc5cc4df71fb9
|
File details
Details for the file nano_rspow_python-0.13.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: nano_rspow_python-0.13.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92f050948b5513f85f78df2fd6581955eadf315912212ff6122a5233b2821ece
|
|
| MD5 |
30da20569a02513e5d805506a0ec762f
|
|
| BLAKE2b-256 |
d7904c0f48fb966bd380b42cdd200ceeb255479eb826ce6e18d4fa593adc4614
|
File details
Details for the file nano_rspow_python-0.13.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: nano_rspow_python-0.13.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04b0b2a5213fb4a0aed2fadd2f8fe095995db425f0d2c7672bf10f529260931e
|
|
| MD5 |
b12166e9a4ab11bf9e048ac9634ab198
|
|
| BLAKE2b-256 |
c927693a524d17b9569b650a0d145c732c9742f633335ee5abb8b15f25daf3e8
|
File details
Details for the file nano_rspow_python-0.13.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: nano_rspow_python-0.13.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17f32b4ee1efa6bb22059cf0c1d236292325b91fc143b7b37516cd6772d15b78
|
|
| MD5 |
da1c2eefd83eeb7098c43bb4c053ff89
|
|
| BLAKE2b-256 |
0ec15d8ac150485c58daec25d3229db83e59dc11c5d221bf4fa6aeb073e74332
|
File details
Details for the file nano_rspow_python-0.13.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: nano_rspow_python-0.13.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d5ba86aa6a396d211ed5f5f983fe66ad418cd83629d1eae76b07491696a517
|
|
| MD5 |
4aa83dd42b3408d4f68cdf1761ed0e11
|
|
| BLAKE2b-256 |
f05560687c350183d015806bc5cc88f955a59f2a96fc7d5af2162bda1fa3ef06
|
File details
Details for the file nano_rspow_python-0.13.0-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: nano_rspow_python-0.13.0-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9eeb606872c69d22b86b92436b3aa8b730439c00bba2943be1bf445f19f8bbd
|
|
| MD5 |
32c84efc12ba7c67d3313c09463feaee
|
|
| BLAKE2b-256 |
49ad4949e316e4f4bbcec5133f681786de818e12b7ebe5d6b65a78e0e08b4b96
|