From: Chris Duncan Date: Sun, 12 Jan 2025 07:54:00 +0000 (-0800) Subject: Update README describing new validate function. X-Git-Tag: v1.1.0~2 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=8c232fb546c3e9bbaa1249b373b1cdd588cb34e7;p=nano-pow.git Update README describing new validate function. --- diff --git a/README.md b/README.md index 64c1591..bf6e8c0 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,16 @@ import { NanoPowGpu, NanoPowGl } from 'nano-pow' // `hash` is a 64-char hex string // `threshold` is optional and defaults to "0xFFFFFFF8" const workGpu = await NanoPowGpu.search(hash, threshold) +// or if WebGPU is unsupported const workGl = await NanoPowGl.search(hash, threshold) ``` You may also embed it in the global namespace by targeting `dist/global.min.js` +## Validation +NanoPow can also validate previously-generated work values against a block hash. +Currently this is only implemented in the WebGPU tool and not WebGL. + ## Notes The `work` field in a Nano transaction block contains an 8-byte nonce that satisfies the following equation: @@ -59,12 +64,6 @@ due to the very narrow use case to which it is applied. The compute shader is consequently immense, but the goal is to squeeze every last bit of speed and performance out of it. -## Validating work -Although the nonces generated by this package have been tested extensively, a -validation function is not currently implemented. There are other tools -available to perform this trivial task, but if there is demand for it, then it -can be delivered in a future update. - ## Tests `test.html` in the source repository contains some basic tests to compare the speed of this tool. Feel free to check out how your system fares.