Skip to main content

Crate zeldhash_miner_gpu

Crate zeldhash_miner_gpu 

Source
Expand description

WebGPU mining runner.

The implementation wires a compute shader that performs the full double-SHA256 over tx_prefix || nonce || tx_suffix. The shader mirrors the CPU implementation in zeldhash-miner-core and returns txids in the same byte order (big-endian hash bytes, which callers treat as txid by reversing when counting leading zeros). Storage buffer layouts match the TODO design so the JavaScript bindings and future optimizations can reuse them unchanged.

Structs§

AdapterSummary
Minimal adapter info exposed to callers (e.g., WASM bindings).
GpuContext
GPU context holding the device/queue.
MineResult
Result returned when a matching nonce is found.
MiningBatch
Mining parameters for a single batch.

Enums§

GpuError
GPU initialization and dispatch errors.

Functions§

calibrate_batch_size
Calibrate an approximate batch size for the current adapter.
dispatch_mining_batch
Dispatch a mining batch on the GPU and return all matching nonces found.