RSW is not GPU resistant
I've been working on a new PoW algorithm for Tor called HashWX.
As part of the design process, I evaluated the GPU resistance of the algorithms used by Cap:
| Algorithm | CPU hashrate (WASM/JS) | GPU hashrate (CUDA) | GPU advantage |
|---|---|---|---|
| SHA256 | 41 MH/s | 6150 MH/s | ~150x |
| RSW | 26 H/s | 4400 H/s | ~170x |
| HashWX | 2.8 MH/s | 5.8 MH/s | ~2x |
"CPU hashrate" was measured on AMD Ryzen 3700X using 16 threads. RSW was benchmarked in NodeJS using the exact JS code shipped by Cap.
"GPU hashrate" was measured on NVIDIA RTX 5060 Ti.
Despite the claims in Cap documentation, RSW fails to be GPU resistant. The CPU wins in the latency metric (the time to solve 1 challenge), but the GPU can solve more challenges per second and that is the relevant metric for bot protection.
My recommendations are:
- Deprecate the RSW algorithm in Cap.
- Implement HashWX with 65536 nonces per hash function.
The hashwx.wasm binary is built for WebAssembly 1.0 for maximum compatibility. The JIT-compiled version works in all browsers that support WebAssembly.
Source: tiagozip/cap