nodejs-keccak256

Replace Node's sha3-256 with Keccak-256 helpers from ethers, viem, or web3.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill nodejs-keccak256-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodejs-keccak256
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/nodejs-keccak256
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill nodejs-keccak256-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ethereum uses Keccak-256, not the standardized SHA3 variant exposed by Node's crypto.createHash('sha3-256'). This mismatch silently breaks selectors, signatures, storage slots, and address derivation.

Core Features & Use Cases

  • Provides guidance on using Ethereum-compatible Keccak-256 helpers from libraries like ethers, viem, or web3.
  • Covers common hashing tasks such as computing function selectors, EIP-712 signatures, and storage slot calculations in Node/TS projects.
  • Includes practical examples and best practices to avoid mixing SHA3 variants in Ethereum workflows.

Quick Start

Start by replacing Node's sha3-256 hashing with a Keccak-256 helper from ethers, viem, or web3 to ensure Ethereum compatibility.

Frequently Asked Questions about nodejs-keccak256

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does Node.js crypto sha3-256 produce wrong Ethereum hashes?

Node.js crypto sha3-256 uses the standardized SHA-3 variant, not Ethereum's Keccak-256. This mismatch silently breaks selectors, signatures, storage slots, and address derivation in Ethereum workflows.

How do I compute Keccak-256 hashes in a Node.js TypeScript project?

To compute Keccak-256 hashes in Node.js, use explicit Ethereum-compatible helpers from libraries like ethers, viem, or web3 instead of Node's native crypto module to ensure correct outputs.

Can I use viem or ethers to generate Ethereum function selectors in JavaScript?

Yes, viem and ethers provide Keccak-256 helpers specifically for Ethereum contexts. You can use these libraries to accurately compute function selectors, EIP-712 signatures, and storage slots.

What is the difference between SHA3-256 and Keccak-256 for Ethereum signature generation?

Ethereum uses Keccak-256 for signature generation, which differs from the standardized SHA3-256. Using the wrong variant causes silent hashing mismatches that invalidate signatures and derived addresses.

When do I need to replace Node sha3-256 with an explicit Keccak-256 implementation?

You must replace Node sha3-256 with an explicit Keccak-256 implementation whenever computing Ethereum selectors, EIP-712 signatures, or storage slots to prevent silent hash mismatches in JavaScript projects.