{"_id":"@akshatmittal/saltshaker","_rev":"3-00b3ae4d4ce027a86e07a5258b91b0b0","name":"@akshatmittal/saltshaker","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0":{"name":"@akshatmittal/saltshaker","version":"0.0.0","_id":"@akshatmittal/saltshaker@0.0.0","maintainers":[{"name":"akshatmittal","email":"hi@akshatmittal.com"}],"homepage":"https://github.com/akshatmittal/saltshaker#readme","bugs":{"url":"https://github.com/akshatmittal/saltshaker/issues"},"dist":{"shasum":"9041ca39152ae573af26ad2c4867aa6f23c8aa1f","tarball":"https://registry.npmjs.org/@akshatmittal/saltshaker/-/saltshaker-0.0.0.tgz","fileCount":3,"integrity":"sha512-pyPYFr7Hi5FhXC5O5MN/rcCDUA3MWQ/KM0XusgDB2dscMVqL6WeQRDWXKPESKZqO/TAP9tLToxJ0OQQ6cCIEGQ==","signatures":[{"sig":"MEUCIQCvnoSJ/e6DIj79Lf2I2IjDMV0lv87a0oIXy0oYbTqCWAIgNH8MZYe4gGOBiKYiAz0aWb0xYuiJ2RVFxJPGxclXtcE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41333},"main":"./dist/index.mjs","type":"module","_from":"file:akshatmittal-saltshaker-0.0.0.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"}},"scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","clean":"rm -rf .turbo dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"akshatmittal","email":"hi@akshatmittal.com"},"_resolved":"/tmp/31212112499aeb2d22e2a4444bbc4649/akshatmittal-saltshaker-0.0.0.tgz","_integrity":"sha512-pyPYFr7Hi5FhXC5O5MN/rcCDUA3MWQ/KM0XusgDB2dscMVqL6WeQRDWXKPESKZqO/TAP9tLToxJ0OQQ6cCIEGQ==","repository":{"url":"git+https://github.com/akshatmittal/saltshaker.git","type":"git","directory":"packages/saltshaker-core"},"_npmVersion":"11.11.0","description":"WebGPU vanity miner for deterministic Ethereum deployments","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.47.10","tsdown":"^0.21.7","vitest":"^4.1.2","typescript":"^6.0.2","@webgpu/types":"^0.1.69"},"peerDependencies":{"viem":"^2.47.10"},"_npmOperationalInternal":{"tmp":"tmp/saltshaker_0.0.0_1775371216266_0.47497579767719045","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@akshatmittal/saltshaker","version":"1.0.0","_id":"@akshatmittal/saltshaker@1.0.0","maintainers":[{"name":"akshatmittal","email":"hi@akshatmittal.com"}],"homepage":"https://github.com/akshatmittal/saltshaker#readme","bugs":{"url":"https://github.com/akshatmittal/saltshaker/issues"},"dist":{"shasum":"9d6187560b4daf6105f06fcb4e88dd787fb7a4df","tarball":"https://registry.npmjs.org/@akshatmittal/saltshaker/-/saltshaker-1.0.0.tgz","fileCount":4,"integrity":"sha512-bQwQQX1dsRXbIyHEF9/RHDu5+2cyFqNwX6x4ByN0P7BsIZHjVGqg8dBACEgBmQk42UrHRM4RB+uThObG+V6p7g==","signatures":[{"sig":"MEYCIQCVdOq4Xw7SZMxKN3UlFPt38rqr1nArucBsbxV7m/wvrQIhAIbx9gN+IsHXABxbstw9u2jtTciJrkOBMD5QOzdfm8X9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@akshatmittal%2fsaltshaker@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":48376},"main":"./dist/index.mjs","type":"module","_from":"file:akshatmittal-saltshaker-1.0.0.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"}},"scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","clean":"rm -rf .turbo dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b7eb498d-6aad-4cf6-baea-74dbd8633bc5"}},"_resolved":"/tmp/864de5e4df4d5cd444a3b921a7fd1bc5/akshatmittal-saltshaker-1.0.0.tgz","_integrity":"sha512-bQwQQX1dsRXbIyHEF9/RHDu5+2cyFqNwX6x4ByN0P7BsIZHjVGqg8dBACEgBmQk42UrHRM4RB+uThObG+V6p7g==","repository":{"url":"git+https://github.com/akshatmittal/saltshaker.git","type":"git","directory":"packages/saltshaker-core"},"_npmVersion":"11.11.0","description":"WebGPU vanity miner for deterministic Ethereum deployments","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.47.10","tsdown":"^0.21.7","vitest":"^4.1.2","typescript":"^6.0.2","@webgpu/types":"^0.1.69","@workspace/typescript-config":"0.0.0"},"peerDependencies":{"viem":"^2.47.10"},"_npmOperationalInternal":{"tmp":"tmp/saltshaker_1.0.0_1775372507105_0.9352191949556623","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"_id":"@akshatmittal/saltshaker@1.1.0","bugs":{"url":"https://github.com/akshatmittal/saltshaker/issues"},"dist":{"shasum":"375c0b8eaf148cb78aa72b4cc92cf7bb6cb8dd84","tarball":"https://registry.npmjs.org/@akshatmittal/saltshaker/-/saltshaker-1.1.0.tgz","fileCount":4,"integrity":"sha512-eelo9AssDd8YOok4eLIfKLAZN1Bw2PmAH2tkAfE4gQr3LT3y/fu861Dq7+hMGr532mHQd4y8OGIiGCfoq/p35Q==","signatures":[{"sig":"MEUCIESRvk7mLutFum4RkZ2HDUvJHtQtMbVwOBmNhT8yzm6MAiEAgeGWeKJq6TZIRpN+AbJ8QAPVBqUW5qxDyy5r9Z5JI7g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEn1hJg96fpiLY9pQJT1dl4EE9gadMpfT3EyaenU/h56AiABu8hkCKEgEMlE8oCHuiN++MAv3b2kft5weZzSESgajg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@akshatmittal%2fsaltshaker@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49646},"main":"./dist/index.mjs","name":"@akshatmittal/saltshaker","type":"module","_from":"file:akshatmittal-saltshaker-1.1.0.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"}},"scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","clean":"rm -rf .turbo dist","typecheck":"tsc --noEmit"},"version":"1.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"b7eb498d-6aad-4cf6-baea-74dbd8633bc5"}},"homepage":"https://github.com/akshatmittal/saltshaker#readme","_resolved":"/tmp/f59f1cc770c6e3fcf855489dee5b589e/akshatmittal-saltshaker-1.1.0.tgz","_integrity":"sha512-eelo9AssDd8YOok4eLIfKLAZN1Bw2PmAH2tkAfE4gQr3LT3y/fu861Dq7+hMGr532mHQd4y8OGIiGCfoq/p35Q==","repository":{"url":"git+https://github.com/akshatmittal/saltshaker.git","type":"git","directory":"packages/saltshaker-core"},"_npmVersion":"11.19.0","description":"WebGPU vanity miner for deterministic Ethereum deployments","directories":{},"maintainers":[{"name":"akshatmittal","email":"hi@akshatmittal.com"}],"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.47.10","tsdown":"^0.21.7","vitest":"^4.1.2","typescript":"^6.0.2","@webgpu/types":"^0.1.69","@workspace/typescript-config":"0.0.0"},"peerDependencies":{"viem":"^2.47.10"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/saltshaker_1.1.0_1790694955563_0.14625468809906206"}}},"time":{"created":"2026-04-05T06:40:16.166Z","modified":"2026-09-29T15:15:56.092Z","0.0.0":"2026-04-05T06:40:16.403Z","1.0.0":"2026-04-05T07:01:47.227Z","1.1.0":"2026-09-29T15:15:55.654Z"},"bugs":{"url":"https://github.com/akshatmittal/saltshaker/issues"},"homepage":"https://github.com/akshatmittal/saltshaker#readme","repository":{"url":"git+https://github.com/akshatmittal/saltshaker.git","type":"git","directory":"packages/saltshaker-core"},"description":"WebGPU vanity miner for deterministic Ethereum deployments","maintainers":[{"name":"akshatmittal","email":"hi@akshatmittal.com"}],"readme":"# Saltshaker\n\nSaltshaker is a WebGPU powered in-browser vanity salt miner for deterministic Ethereum deployments.\n\n- Performance: push the search loop onto the GPU, stream live hashrate, and benchmark hardware with a standardized preset.\n- Capability: Mine addresses for `CREATE2`, `CreateX` (`CREATE2` and `CREATE3`), and `Safe` deployments with multiple matcher strategies.\n- Ease of use: Start from a tiny TypeScript API or the included browser workbench.\n\n## Why Saltshaker\n\n- GPU-first search. The miner dispatches work through WebGPU and, by default, searches `65,535 x 16 x 64 = 67,107,840` candidates per dispatch.\n- Browser-native workflow. No backend, no RPC requirement, and no wallet connection just to search deterministic addresses.\n- Correctness guardrails. GPU hits are re-scored on the CPU before they are accepted into the result set.\n- Live telemetry. Sessions report status, elapsed time, hashrate, and ranked results as they run.\n- Built-in benchmark mode. The starter app includes a repeatable benchmark route so you can compare GPUs with the same preset.\n\n## Benchmark\n\n| Device          | Hashrate  |\n| --------------- | --------- |\n| Nvidia RTX 3070 | 1140 MH/s |\n\n(Consider adding your device to this list!)\n\n## What It Supports\n\n### Protocols\n\n| Protocol  | Notes                                                                                       |\n| --------- | ------------------------------------------------------------------------------------------- |\n| `create2` | Deterministic contract address mining from deployer + salt + init code hash                 |\n| `createx` | Supports `CREATE2` and `CREATE3`, including caller-protected and crosschain-protected salts |\n| `safe`    | Mines proxy addresses derived from Safe initializer data and nonce                          |\n\n### Matchers\n\n| Matcher        | Notes                                                              |\n| -------------- | ------------------------------------------------------------------ |\n| `leadingZeros` | Search for addresses with a minimum number of leading zero nibbles |\n| `prefix`       | Nibble-precision prefix matching                                   |\n| `suffix`       | Nibble-precision suffix matching                                   |\n| `contains`     | Nibble-precision substring matching                                |\n\nIf you do not provide a matcher, Saltshaker defaults to `leadingZeros: 8`.\n\nYou can also create custom matcher configurations to target very specific address patterns, such as the Uniswap V4 address mining competition!\n\n## Technical Overview\n\nSaltshaker runs the mining loop as a WebGPU compute workload.\n\n### WebGPU Mining Flow\n\n1. The CPU prepares protocol-specific constants such as deployers, factories, salt prefixes, code hashes, Safe initializer hashes, and matcher data.\n2. Saltshaker packs those constants into a GPU storage buffer, writes the current nonce base into a small uniform buffer, and allocates a compact result buffer for the best hit in the current dispatch.\n3. The shader is assembled from shared Keccak primitives, a matcher module, a protocol module, and one shared compute kernel.\n4. The GPU dispatches workgroups across the nonce space and each invocation derives one candidate address for one nonce.\n5. Each invocation scores its candidate on the GPU and only higher-scoring hits try to update the shared best-result buffer through atomics.\n6. After the dispatch completes, Saltshaker copies the result buffer back to the CPU, derives the final salt and address, re-scores the hit on the CPU, and merges valid results into the ranked result list.\n\nBy default, each dispatch covers `65,535 x 16` workgroups at a workgroup size of `64`, which means `67,107,840` nonce candidates per dispatch.\n\n### Keccak Kernel\n\nThe compute path is centered on a shared WGSL Keccak implementation.\n\n- The shared core shader implements the Keccak-f permutation directly in WGSL, including the `theta`, `rho/pi`, `chi`, and `iota` rounds.\n- Protocol shaders only define how to build the correct preimage for a nonce. `CREATE2` hashes `0xff ++ deployer ++ salt ++ initCodeHash`, `Safe` derives its salt from `keccak256(initializerHash ++ nonce)`, and `CreateX` applies its guarded-salt rules before address derivation.\n- The kernel exposes fixed-size helpers such as `keccak256_32`, `keccak256_64`, `keccak256_96`, `keccak256_85_address`, and `keccak256_23_address` so each protocol can hash the exact layout it needs.\n- All protocol and matcher combinations reuse the same `@compute @workgroup_size(64)` entrypoint, so Saltshaker swaps protocol and matcher logic without changing the overall execution model.\n- The GPU only returns the best hit from a dispatch, which keeps readback small and lets the CPU stay focused on verification, ranking, and session telemetry.\n\n## Quick Start\n\n### Run the starter app\n\n```bash\npnpm install\npnpm dev\n```\n\nThen open the local URL printed by Vite.\n\nThe starter app includes:\n\n- a mining workbench for `CREATE2`, `CreateX`, and `Safe`\n- live telemetry and ranked results\n- a `/benchmark` route for repeatable WebGPU throughput tests\n\n### Use the library\n\nThe core package lives in `packages/saltshaker-core` and exports a very small API:\n\n- `checkWebGpuSupport()`\n- `createMiningSession()`\n\nExample:\n\n```ts\nimport { checkWebGpuSupport, createMiningSession } from \"@akshatmittal/saltshaker\";\n\nconst support = await checkWebGpuSupport();\nif (!support.supported) {\n  throw new Error(support.message);\n}\n\nconst session = createMiningSession({\n  job: {\n    protocol: \"create2\",\n    deployer: \"0x4e59b44847b379578588920cA78FbF26c0B4956C\",\n    fixedSaltPrefix: \"0x000000000000000000000000000000000000000000000000\",\n    initCodeHash: \"0x6e1cce4955d4b57d9569397925551f2fb36c34f1cfe0f2e8c0c727c44bd08b90\",\n  },\n  matcher: { type: \"prefix\", value: \"0xdead\" },\n  maxResults: 10,\n});\n\nconst unsubscribe = session.subscribe((state) => {\n  console.log(state.status, state.hashrate, state.results);\n\n  if (state.results.length > 0) {\n    session.stop();\n  }\n});\n\nawait session.start();\nunsubscribe();\n```\n\n## API Shape\n\n`createMiningSession()` accepts:\n\n- a `job` for `create2`, `createx`, or `safe`\n- an optional `matcher`\n- optional `dispatch` sizing\n- optional `maxResults`\n- optional WebGPU `powerPreference`\n\nEach session exposes:\n\n- `start()` to begin mining\n- `stop()` to stop the active run\n- `subscribe(listener)` to receive state updates\n\nSession state includes:\n\n- `status` and `statusDetail`\n- `hashrate`\n- `elapsedMs`\n- `results`\n- `error`\n\n## Development\n\n### Repo layout\n\n- `packages/saltshaker-core`: Typed WebGPU mining library\n- `apps/web-start`: Browser workbench and benchmark UI (Tanstack Start)\n- `tooling/typescript-config`: Shared TypeScript config\n\n### Commands\n\n```bash\npnpm dev\npnpm build\npnpm typecheck\npnpm lint\n```\n\n## Requirements\n\n- Node.js `>=24`\n- `pnpm@10`\n- A browser with WebGPU support for actual mining\n- `viem` as a peer dependency of the `@akshatmittal/saltshaker` package\n\n### Deploying a mined Safe\n\nSelect a canonical Safe v1.3.0, v1.4.1, or v1.5.0 preset, then enter owners and threshold.\nThe v1.4.1 and v1.5.0 presets can enable **Multi-chain (SafeToL2Setup)** to switch to\nSafeL2 during setup on non-mainnet chains. Advanced fields allow custom setup targets\nand data. Confirm the selected contracts are deployed on each intended chain.\n\nResults show both the derived salt and the decimal **saltNonce**. Use saltNonce with\n`createProxyWithNonce`, or choose **Copy calldata** and send it to the factory shown\nwith the result. Calldata stays tied to the original mining configuration when the form\nis edited. The app does not send transactions.\n\nThe proxy creation code hash includes the singleton constructor argument:\n`keccak256(proxyCreationCode() ++ abi.encode(singleton))`. Editing the singleton clears\nthe hash so a matching custom hash must be supplied. Canonical preset addresses come\nfrom [Safe deployments](https://github.com/safe-global/safe-deployments/tree/main/src/assets);\nhashes were checked against mainnet factories. The v1.3.0 preset uses the canonical L1\nsingleton and its corresponding hash, correcting the previous UI default.\n","readmeFilename":"README.md"}