avian_lwma
High-performance LWMA (Zawy v3) target calculator for dual-algo Avian forks (X16RT + MinotaurX).
- No Boost/OpenSSL: ships a tiny 256-bit integer core (GCC/Clang required for __uint128_t).
- pybind11: import from Python and call at header-sync/checkpoint time.
- Per-algo windows: pass the last N headers of a given algo.
- Optional WASM FFI: compile the same core to .wasm if you want a web/Node verifier (not included in this zip).
Quick start (build wheel)
pip install -U pip build
pip install pybind11 scikit-build-core
pip install .
Windows: build with MSYS2/MinGW or Clang, or use WSL. (MSVC lacks __uint128_t; a MSVC-safe Big256 can be added.)
CMake build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
Python usage
from avian_lwma import HeaderLite, next_bits_window, filter_last_n_for_algo
N = 45 # LWMA window
T = 30 # target spacing (seconds)
POW_LIMITS = {
0: "00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", # X16RT
1: "000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", # MinotaurX
}
def algo_from_version(ver: int) -> int:
return 1 if (ver & (1<<28)) else 0 # example mapping
# chain: list[HeaderLite] oldest->newest (fill from your header DB)
window = filter_last_n_for_algo(chain, N, algo_from_version, algo_id=1)
expected_bits = next_bits_window(window, T, len(window), POW_LIMITS[1])
API
- HeaderLite(time: uint32, version: uint32, bits: uint32)
- next_bits_window(window, target_spacing_s, N, pow_limit_hex) -> int (compact bits)
- filter_last_n_for_algo(chain, N, algo_from_version, algo_id) -> list[HeaderLite]
Notes
- Targets are full 256-bit integers decoded from compact bits. The result is clamped to pow_limit before re-encoding.
- The Big256 here uses __uint128_t for intermediate math. For MSVC, swap in a different Big256 (PRs welcome).
Metadata
Release files for avian-lwma 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| avian_lwma-0.1.0.tar.gz | 7.0 kB | Without provenance | Details for avian_lwma-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| avian_lwma-0.1.0-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details for avian_lwma-0.1.0-cp312-cp312-win_amd64.whl |
| avian_lwma-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details for avian_lwma-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
| avian_lwma-0.1.0-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details for avian_lwma-0.1.0-cp312-cp312-macosx_11_0_arm64.whl |
| avian_lwma-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl | CPython 3.12 | CPython 3.12 | macOS 10.13+ x86-64 | Details for avian_lwma-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl |
Total release size: 338.6 kB
Release files / avian_lwma-0.1.0.tar.gz
| Download URL | avian_lwma-0.1.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09347984b09e374016332173910a4effe0387f3664425a7790a6b6bcce673e74
|
|
BLAKE2b-256 checksum How to use checksums |
71e851737d96d0c1f13dd280c9d7bf6c0f528c0ffc3913e8aaf4c8743e8ec719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / avian_lwma-0.1.0-cp312-cp312-win_amd64.whl
| Download URL | avian_lwma-0.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 85.1 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1b0c2e6414c787ae92688144fa63ff05b9f6888906f6d557017a2434f049e1be
|
|
BLAKE2b-256 checksum How to use checksums |
9d887fedd8bbf0bb593a5556504e8499e73542fb5eb71adec731de0a248e23b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / avian_lwma-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | avian_lwma-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 90.3 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
32937c0b6f34ff77cd9987dffa3ce491c4e3012a933463f2b496ff6c96edc4cf
|
|
BLAKE2b-256 checksum How to use checksums |
7af68ccaa236c93884a50ddcf6d363e8b6924dfa2c6a2a48228b94391b34df6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / avian_lwma-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | avian_lwma-0.1.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 75.8 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f48f1f6e88c8d3f23b49cba542ef1063f5a480a955b74587cb5307a0ea13b030
|
|
BLAKE2b-256 checksum How to use checksums |
21030611ecc5ede80c5cfcf5865275f272831118af703b5ad6330c8c3c523716
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / avian_lwma-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | avian_lwma-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 80.4 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
e6250057908dcbee66f5c1f37961a0a1ff0951939236840890ecbc211e20cc93
|
|
BLAKE2b-256 checksum How to use checksums |
e51c8b55b15bce5c227ed488bd42441a0bd769cbc5eb2502e63233f8c4cb81d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for avian-lwma 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.