From 8c232fb546c3e9bbaa1249b373b1cdd588cb34e7 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 11 Jan 2025 23:54:00 -0800 Subject: [PATCH] Update README describing new validate function. --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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. -- 2.34.1