Mining Uniswap v4 Hook Addresses at 1.36 GH/s with Single-Block CUDA Keccak-256 (vs Foundry HookMiner)
In Uniswap v4 , hook permissions ( BEFORE_SWAP , AFTER_SWAP , BEFORE_ADD_LIQUIDITY , return-delta flags, etc.) are encoded directly into the lowest 14 bits ( uint160(addr) & 0x3FFF ) of the hook contract's 20-byte address. Finding a valid 14-bit salt alone only takes ~16,384 hashes (~40ms in Foundry's CPU HookMiner ). However, if you also want leading zero bytes ( 0x000000... or 0x0000000000... )…
Uniswap v4 hook permissions are encoded in the lowest 14 bits of the contract's address. Finding a valid 14-bit salt is relatively quick on a CPU, but adding leading zero bytes increases search complexity significantly. A CUDA Keccak-256 kernel was developed to mine hook addresses at 1.36 GH/s on a single NVIDIA L4 GPU, which is about 3,400 times faster than Foundry's CPU.
This approach uses zero elliptic-curve math like CREATE2, making the process significantly faster. The NVIDIA L4 GPU achieves 1.36 GH/s in hashing, capable of finding a 14-bit v4 hook with 4 leading zeros in just over a minute. Similarly, the same GPU can find a 14-bit v4 hook with 7 leading zeros in approximately 54 minutes. The findings are verified using a zero-dependency Python verifier CLI. An online browser verifier tool is also available for testing hook flags directly.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to