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.1.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.1-cp39-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

nano_rspow_python-0.13.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.13.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.13.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.13.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.13.1.tar.gz.

File metadata

  • Download URL: nano_rspow_python-0.13.1.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.1.tar.gz
Algorithm Hash digest
SHA256 291f5969a8f838c6b929f45522aea5eadd56db4c60bc8264d0ed26dc41fa73db
MD5 e61efda4ca425219e9d1da74f51afce7
BLAKE2b-256 16ab51220e412a1d8a3dee97327ff42a74d9cb83e3ca1c4cee23216cbff28d42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f2e154b763a2f89825dd9068ef7ae2a6a9b3b63f9ab2c1d7867f07f35428a998
MD5 62f06d344671f5c598e8b33fce33f1ef
BLAKE2b-256 52fcc8a9c94ac77d17fe9d2556a44ce6534ecbc79ad5f7dda707bb904094ddd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ff6220b78bf365a3bb95d3165aee9eaab304fb239409851dd8cbc41ee4a299b
MD5 326f2923bddadd88f1c22ff5e256dd4f
BLAKE2b-256 62ad1919891c4d674685cab81c4ea720efe4fd7c9b0b80995bfa66180c21597f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 51448866c44846d6e54c33f45c0416dcaef42597833d8cd8f50f8f3195df7d53
MD5 866b15323d8599e59cb2512e946a10b3
BLAKE2b-256 2ca48ddd49f075a1814f42675f07696860d2af96865d6ce9498d54b97b5141f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 50ac9c44ff461b0c6b15fbd8ddf0a83e10e8ce166668de80b921fb1b08f9c0b0
MD5 8f4f08fa1cfa901f332686b933e405e8
BLAKE2b-256 ab74bf9c5a8bfd064516282b6f214afeace34037cbdb749d2c44476d117c7775

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0b1cf7661f131e63b57198b3c51339845fc29a8c5ae3e15e1a1dd32aeb7ea52e
MD5 99d4a871710dc022600e1f08737fe479
BLAKE2b-256 59be8704b39a30cdd4d5db85aa28df9e35a4c0e1e998ebb5a8f11bd64d2ff3ab

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

This release

0.13.1 This release

6 files

0.13.0

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