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

The package also installs a minimal streaming executable named nano-rspow-python. It accepts no options except --help and uses the same line protocol as nano-rspow generate --stream:

<hash_hex>[:0x<threshold_hex>]
<hash_hex>:0x<threshold_hex>:<work_hex>

nano-rspow remains the full-featured CLI provided by the Rust nano-rspow-cli crate; this Python package intentionally exposes only the nano-rspow-python entrypoint.

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

Uploaded CPython 3.9+Windows x86-64

nano_rspow_python-0.16.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.16.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

nano_rspow_python-0.16.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.16.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.16.0.tar.gz.

File metadata

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

File hashes

Hashes for nano_rspow_python-0.16.0.tar.gz
Algorithm Hash digest
SHA256 0a5e493861301802e576708fae5c28e72fa0c4abd80a707164c213c5783b75bf
MD5 151de24c165c3b8489ed305fce93101b
BLAKE2b-256 4dfb67027faaa435a8d2d48a94be8a56803a808ee7877c52f822410ba9ca440b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.16.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a2d45ca7cd428fc7516d0a6e2c8cb04a77ae6ca226c9dc70b29941c76b76b32c
MD5 9c00a95d2e12822d5dcd6cc1a9795277
BLAKE2b-256 77ac9867309651a8b836ebde1593019e9e1eac85f685118be3285c3636be7fa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 852893b21cc78ee2da382360dcafd94a5d7642887bdf68b6d563efbe4ae1d656
MD5 74da7e345237a1b977939eeb52b34ea6
BLAKE2b-256 87c8e0e817e92b017d0b856a18070ae5ec3118dc2274ac7756196bc8bedc721a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.16.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4401600d3bc2d682b4e539c5c4503fc17312d76332364455b08fcf854ec8117
MD5 aa49c5f0cb881428a2cbb830af7c0aa1
BLAKE2b-256 1614b26e983246019fc3f865be8105704b359505b619192a6fcc7a7f7fafb512

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.16.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd11a606952e1b9eff0f35fb233a2bc085cad8fed94d4120f49c1ca61fe5f72c
MD5 3b8b9ba804f35bc272155a550c052e68
BLAKE2b-256 5937060b931d1dea9387994d92cb7f73cf26b6298c303f80cfa760d452a12b85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nano_rspow_python-0.16.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 df249ee145b04940e77e8b0b8cdaf258daadd0f2d040f8fff887b196dc36414f
MD5 5dd5f06fb3451469c714620a6d2d9f7d
BLAKE2b-256 008cbf9069a7ddf4f5af0a4e274aa041c7bab931ac6fd25d9bcdfffb11a3dc69

See more details on using hashes here.

Release history Release notifications | RSS feed

0.17.1

6 files

0.17.0

6 files

This release

0.16.0 This release

6 files

0.13.1

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