nodejs-keccak256

Audit JavaScript and TypeScript codebases for incorrect SHA3-256 usage and provide Keccak-256 implementation guidance.

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/himanshu231204/AI_Research_agent --skill nodejs-keccak256-himanshu231204
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodejs-keccak256
Source: https://github.com/himanshu231204/AI_Research_agent/tree/main/.opencode/skills/nodejs-keccak256
Command: npx skills add https://github.com/himanshu231204/AI_Research_agent --skill nodejs-keccak256-himanshu231204

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Node.js's default crypto.createHash('sha3-256') uses the NIST-standardized SHA3 variant, not Ethereum's Keccak-256 algorithm, causing silent, hard-to-debug bugs in Ethereum-related operations like function selector generation, signature verification, storage slot calculation, and address derivation.

Core Features & Use Cases

  • Correct Keccak-256 Guidance: Provides clear rules and examples to ensure Ethereum hashing uses the proper algorithm in JavaScript and TypeScript projects.
  • Cross-Library Examples: Includes working code snippets for popular Web3 libraries including ethers, viem, and web3.js.
  • Codebase Audit Support: Offers grep commands to quickly locate incorrect sha3-256 usage in existing codebases.
  • Use Case: A developer building a decentralized application (dApp) that interacts with Ethereum smart contracts can use this skill to avoid failed transactions and incorrect signature validation caused by hashing algorithm mismatches.

Quick Start

Use the nodejs-keccak256 skill to audit your JavaScript or TypeScript codebase for incorrect NIST SHA3-256 usage and replace it with the proper Ethereum Keccak-256 implementation for all blockchain-related hashing operations.

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.createHash('sha3-256') fail for Ethereum smart contracts?

Node.js crypto.createHash('sha3-256') fails because it uses the NIST-standardized SHA3 variant, not Ethereum's Keccak-256 algorithm, causing silent hashing mismatches in operations like function selector generation and signature verification.

How do I compute the correct Keccak-256 hash in JavaScript for EIP-712 signatures?

To compute the correct Keccak-256 hash for EIP-712 signatures in JavaScript, use the built-in hashing functions provided by Web3 libraries like ethers, viem, or web3.js rather than the native Node.js crypto module.

What is the best way to audit my TypeScript codebase for incorrect SHA3-256 hashing?

The best way to audit a TypeScript codebase for incorrect SHA3-256 hashing is to use grep commands to locate crypto.createHash('sha3-256') usage and replace it with the proper Ethereum Keccak-256 implementation for all blockchain operations.

Does this Keccak-256 guidance apply to Merkle tree construction and storage slot derivation?

Yes, this Keccak-256 guidance applies to Merkle tree construction, storage slot derivation, event topic generation, and public key to address conversion, ensuring all Ethereum-related hashing operations use the correct algorithm.

Can I use ethers, viem, and web3.js to avoid Ethereum hashing algorithm mismatches?

You can use ethers, viem, and web3.js to avoid Ethereum hashing algorithm mismatches because these Web3 libraries include cross-library examples that implement the correct Keccak-256 algorithm by default.