This is an automated archive made by the Lemmit Bot.
The original was posted on /r/nanocurrency by /u/ornerybeef on 2025-06-17 20:48:48+00:00.
It’s been almost 3 months since NanoPow v4? Yowza! Time for an update!
Prologue: NanoPow is a tool that generates and validates proof-of-work (PoW) required for Nano transactions. It works in a normal browser locally and offline so you don’t have to rely on third-party PoW services. Primarily, it’s intended to be integrated by wallets and other services that have to generate PoW for their users and transactions. However, it also offers a standalone NodeJS work server and command-line tool that you can have up-and-running in as much time as it takes to install from npm.
Links at the bottom! Without further ado…
Changelog
- New! API option
- The
options
parameter now accepts anapi
property which can be “webgpu”, “webgl”, “wasm”, or “cpu”. - If not specified, NanoPow will select the best API automatically based on your browser’s features.
- The old API-specific classes (
NanoPowGpu
andNanoPowGl
) have been replaced by this new option and deprecated as part of this release, making this a potentially breaking change.
- The
- New! WASM and CPU implementations
- WebGPU is the fastest API available in NanoPow, and WebGL is a close second, but both of them are way faster than any CPU-based API.
- However, they also suffer from varying levels of browser support and can be difficult to recover if there is a device error.
- NanoPow now includes a WASM module written from scratch in AssemblyScript and a CPU module written in plain TypeScript to provide as much fallback coverage as possible.
- The WASM module has been optimized as much as possible, and benchmarks show that it compares favorably to native CPU hash speeds.
- The CPU module is now used for all
work_validate
calls for ease of maintenance. It can also generate work but should only be used for testing work generation at very low difficulties.
- New! Start server on login
- The
docs/
directory now includes a samplesystemd
service unit file that can be used run the NanoPow work server in the background at login. - Instructions on usage are included in the sample file’s header.
- The
- Improved! Multi-buffering to fully utilize the GPU pipeline
- WebGPU now uses double-buffering to optimize for dispatch latency.
- WebGL similiarly uses quadruple buffering to optimize for frame latency primarily caused by its dependence on display refresh rates.
- Improved! Error handling
- Browsers sometimes experience GPU failures. NanoPow now has improved error handling and tries to recover from errors.
- Timeouts are now implemented to ensure long-running requests do not hog system resources.
- Added
Logger
andQueue
classes to improve logging and request handling. - Fixed bug in IPC implementation which communicates between CLI and server.
- Server requests that throw an error during work calls will now return an error object to the user. (Errors with the server itself will continue to throw exceptions as before.)
- Fixed issue with puppeteer launching NanoPow before GPU was ready.
- Shaders are now generated with scripts for more robust algorithm implementations.
- Improved configuration checks with NanoPowConfig class.
- Loading of APIs is now deferred until requested.
- Improved type checking and removed unnecessary type exports.
Links
Install from npm: https://www.npmjs.com/package/nano-pow
Include directly on your webpage from CDN: https://unpkg.com/nano-pow
Clone the repo: https://zoso.dev/nano-pow.git
If you have any questions, critiques, or feedback, please let me know! Thanks everyone!