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.13.0.tar.gz (52.7 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.13.0-cp39-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

nano_rspow_python-0.13.0-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.13.0-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.13.0-cp39-abi3-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

nano_rspow_python-0.13.0-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.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

Hashes for nano_rspow_python-0.13.0.tar.gz
Algorithm Hash digest
SHA256 3ce2d31618d604f97e525c697b8186d10b748467e832bd40eb61549b53fb919c
MD5 eeb573edd954283faa0f2f07167c3c9f
BLAKE2b-256 e35de14e5f689ed7149d3a69eca56448e270ad6b3f0f6b7dcc2bc5cc4df71fb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 92f050948b5513f85f78df2fd6581955eadf315912212ff6122a5233b2821ece
MD5 30da20569a02513e5d805506a0ec762f
BLAKE2b-256 d7904c0f48fb966bd380b42cdd200ceeb255479eb826ce6e18d4fa593adc4614

See more details on using hashes here.

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

File hashes

Hashes for nano_rspow_python-0.13.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04b0b2a5213fb4a0aed2fadd2f8fe095995db425f0d2c7672bf10f529260931e
MD5 b12166e9a4ab11bf9e048ac9634ab198
BLAKE2b-256 c927693a524d17b9569b650a0d145c732c9742f633335ee5abb8b15f25daf3e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 17f32b4ee1efa6bb22059cf0c1d236292325b91fc143b7b37516cd6772d15b78
MD5 da1c2eefd83eeb7098c43bb4c053ff89
BLAKE2b-256 0ec15d8ac150485c58daec25d3229db83e59dc11c5d221bf4fa6aeb073e74332

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55d5ba86aa6a396d211ed5f5f983fe66ad418cd83629d1eae76b07491696a517
MD5 4aa83dd42b3408d4f68cdf1761ed0e11
BLAKE2b-256 f05560687c350183d015806bc5cc88f955a59f2a96fc7d5af2162bda1fa3ef06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f9eeb606872c69d22b86b92436b3aa8b730439c00bba2943be1bf445f19f8bbd
MD5 32c84efc12ba7c67d3313c09463feaee
BLAKE2b-256 49ad4949e316e4f4bbcec5133f681786de818e12b7ebe5d6b65a78e0e08b4b96

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

This release

0.13.0 This release

6 files

0.12.1

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