Skip to main content

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

nano_rspow_python-0.12.1.tar.gz (52.3 kB view details)

Uploaded Source

Built Distributions

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

nano_rspow_python-0.12.1-cp39-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

nano_rspow_python-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

nano_rspow_python-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

nano_rspow_python-0.12.1-cp39-abi3-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

nano_rspow_python-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file nano_rspow_python-0.12.1.tar.gz.

File metadata

  • Download URL: nano_rspow_python-0.12.1.tar.gz
  • Upload date:
  • Size: 52.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for nano_rspow_python-0.12.1.tar.gz
Algorithm Hash digest
SHA256 d18e8a8aba4f572e4863951da1b2f17ae32f40d0e327da4fbb2ebbb204afee1c
MD5 4a25b42507aa4ee52e0ee6430fcafe29
BLAKE2b-256 1bc64876600ba95452b9c0578ee7b40ce436b75c2694fa15102607c50176fdf3

See more details on using hashes here.

File details

Details for the file nano_rspow_python-0.12.1-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nano_rspow_python-0.12.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 694f5b0a6201ebbae6bd7138eb15bf0ce1063109975c397ca986034763abc8bc
MD5 fd9072d1185a8bf1987a75f4a33c49fb
BLAKE2b-256 7e4fa7e8a6f99bec5d87d4833d4e97042f35ef2f060e4796580f0abad0bf3b10

See more details on using hashes here.

File details

Details for the file nano_rspow_python-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nano_rspow_python-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53a65b53437c7ffa606f6b271e95f28b912afb536541a9fb196ee5e5b34d67da
MD5 82808f69d56a9c1418fca9d2c94a3d94
BLAKE2b-256 809f5afca07e3c544d546d4ad9c1b14d8ebe8d647d7eda1c2497d684c7e739c6

See more details on using hashes here.

File details

Details for the file nano_rspow_python-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nano_rspow_python-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e6954928cca83c004cc6437241a9edb5be10c5aa37fdfbdaf31b1b1f2fdcd165
MD5 a729ced7dba375f694b93d149438cbf2
BLAKE2b-256 51481b653df2479498661fa96314024b7a922ba54106392bb34a9437de139272

See more details on using hashes here.

File details

Details for the file nano_rspow_python-0.12.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nano_rspow_python-0.12.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 480c1363174372b511285bae24737e69761644339875ab6a2899f5aebb2384a8
MD5 f26c96123cfb719a19423e84eba419d0
BLAKE2b-256 e5ea817f9ae370aaaee5f1552e1d0970921416a0ff4b1ff4b4de129a4e6db32a

See more details on using hashes here.

File details

Details for the file nano_rspow_python-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nano_rspow_python-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 17c09c91c2db90ef7276f47e94d162bb23de65f92fd8fd755fd0ab523fc9f74a
MD5 2c91297b8bbab2099c81d9eaaf2b3d7b
BLAKE2b-256 ab328a407be43d9ca1367912ad1d3736f4140d55e63863ccbbd44aa4efef34ed

See more details on using hashes here.

Release history Release notifications | RSS feed

0.17.1

6 files

0.17.0

6 files

0.16.0

6 files

0.13.1

6 files

0.13.0

6 files

This release

0.12.1 This release

6 files

0.12.0

6 files

0.11.3

6 files

0.11.2

6 files

0.11.1

6 files

0.11.0

6 files

0.10.0

6 files

0.9.0

6 files

0.8.0

6 files

0.7.0

6 files

0.6.0

6 files

0.5.14

6 files

0.5.13

6 files

0.5.12

6 files

0.5.11

6 files

0.5.10

6 files

0.5.7

6 files

0.5.0

6 files

0.2.5

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page