skip to content
==> README.md <==
1# @ajax/mesh-prog-sha256d
2
3Bitcoin-style double SHA-256 nonce grinding as a fleet job program: each chunk of 2^param nonces is a
4job item (OP_JOB) ground by a 16-warp node, 2 hashes a thread an iteration on the header's midstate,
5the node's best hash by block reductions, and every share recorded by a rescan when any thread saw a
6candidate. Configuration under a spin lock and a seqlock; a request window for headers, targets and
7status. View layout: `include/mesh/prog/sha256d.h`.
8
9- **Ported from:** alpha-rust-mesh `programs/sha256d/src/lib.rs`.
10- **Tests:** on the simulator against @ajax/mesh-ref-sha256d: the genesis header and its midstate, four
11  chunks at 8 zero bits (time rolled for one) with every share and the best hash equal to hashing each
12  nonce on the CPU, the genesis block's own nonce found as a share with Bitcoin's genesis hash, the
13  config ops, the request window (status, errors, a raw header), and a param out of range.
14- **Differences:** rotates and byte swaps are plain C (`clang` makes them `shf.r.wrap` and `prmt`);
15  rounds 16..48 stay a 2-trip loop (`#pragma clang loop`) as in the Rust.