What does this skill do?

The Keccak-256 for Ethereum Skill solves the problem of incorrect hashes in Ethereum applications developed in JavaScript or TypeScript. Ethereum uses Keccak-256, not the NIST-standardized SHA3 variant exposed by Node.js via `crypto.createHash('sha3-256')`. This skill guides you in replacing it with compatible libraries such as ethers, viem, or web3.js and audits the code to prevent errors in production.

Function and Topic Selectors
Calculate Ethereum function selectors and event topics using the correct Keccak-256 hash.
EIP-712 and Merkle Signatures
Build helpers for EIP-712 signatures, Merkle trees, and storage slots without hash errors.
Code Audit
Audit your codebase for insecure uses of SHA-3 that could cause silent failures in production.
Address Redirection
Derives Ethereum addresses from public keys by correctly applying Keccak-256.

Usage examples

🔍 Audit code
Review my TypeScript project and look for all instances of `crypto.createHash('sha3-256')` that should be `Keccak-256` for Ethereum.
🎯 Calculate selector
Calculate the selector for the `transfer(address, uint256)` function using Keccak-256 with Ethers v6.
✍️ EIP-712 Signature
Help me build an EIP-712 signature helper using solidityPackedKeccak256 to verify permissions on-chain.
📍 Get Directions
I have a public key in bytes; derive the corresponding Ethereum address using Keccak-256.

Features

Detection of an Incorrect SHA3-256 Identify instances of `crypto.createHash('sha3-256')` intended for Ethereum and suggest the correct replacement.
Multi-library compatibility Supports Ethers v6, Viem, and Web3.js, with ready-to-use code examples for each.
EVM Hash Verification Verify that the resulting hash is 32 bytes (64 hex characters) long and matches what the EVM expects.
Address Redirection It includes utilities for deriving Ethereum addresses from public keys using Keccak-256.
Code Base Audit Scan the entire project for insecure uses of SHA-3 to prevent errors in production.

Frequently asked questions

Ethereum uses Keccak-256, the original algorithm prior to NIST standardization. Node.js's SHA3-256 uses different padding and produces completely different hashes for the same input.
ethers v6, viem, and web3.js. All of them natively implement Keccak-256 and are EVM-compatible.
No. The skill works with Claude Code and Cowork without any additional configuration. You just need to have the library of your choice (ethers, viem, or web3.js) installed in your project.
Both. The examples are in TypeScript, but the logic applies equally to JavaScript with web3.js or ethers.
Keccak-256 for Ethereum — Correct Hashes with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.