A

nodejs-keccak256

by affaan-m

The nodejs-keccak256 skill helps you avoid a common Ethereum bug in JavaScript and TypeScript: using Node's sha3-256 when you need Keccak-256. It is useful for backend development, selectors, event topics, signatures, storage slots, and address derivation, with practical nodejs-keccak256 usage guidance.

Stars156.2k
Favorites0
Comments0
AddedApr 15, 2026
CategoryBackend Development
Install Command
npx skills add affaan-m/everything-claude-code --skill nodejs-keccak256
Curation Score

This skill scores 81/100, which means it is a solid listing candidate for directory users who need help avoiding Ethereum Keccak-256 vs NIST SHA3 hashing bugs in Node.js/TypeScript. The repository gives enough workflow specificity to decide on install and to trigger the skill correctly, though it still lacks some adoption aids like install commands and support files.

81/100
Strengths
  • Clear problem framing: it explicitly warns that Node's sha3-256 is NIST SHA3 and can silently break Ethereum selectors, signatures, storage slots, and address derivation.
  • Practical workflow examples: it shows concrete usage across ethers v6, viem, and web3.js with code fences, making execution less guessy for agents.
  • Good operational scope: the skill states when to use it, including Ethereum hashing, EIP-712, Merkle, and storage-slot helpers in JS/TS.
Cautions
  • No install command or support files are present, so users may need to infer setup from the examples alone.
  • Coverage is focused on a single hashing pitfall; it is useful but not a broad Ethereum development skill.
Overview

Overview of nodejs-keccak256 skill

What nodejs-keccak256 does

The nodejs-keccak256 skill helps you avoid a common Ethereum bug in JavaScript and TypeScript: using Node’s crypto.createHash('sha3-256') when you actually need Keccak-256. That mismatch can silently break selectors, event topics, signatures, storage-slot calculations, and address derivation.

Who this is for

Use the nodejs-keccak256 skill if you work on backend services, bots, indexers, wallet tooling, smart-contract helpers, or any Node-based code that hashes Ethereum data. It is especially useful for reviewers and maintainers who need to spot incorrect hashing before it ships.

Why it matters

This is not a generic hashing guide. The main value of the nodejs-keccak256 skill is decision quality: it tells you when the code is unsafe, what to replace it with, and how to confirm the output matches Ethereum tooling. That makes it practical for nodejs-keccak256 for Backend Development, where correctness matters more than convenience.

How to Use nodejs-keccak256 skill

Install and open the skill

Install the nodejs-keccak256 skill with:
npx skills add affaan-m/everything-claude-code --skill nodejs-keccak256

Then open SKILL.md first. In this repository, that is the only support file, so the fastest path is to read the skill body closely and use it as the working reference for nodejs-keccak256 usage.

Turn a rough task into a good prompt

The skill works best when you give it the exact hashing job, the runtime, and the expected Ethereum artifact. Strong inputs include:

  • the hash target: function selector, EIP-712 domain, event topic, storage slot, or packed encoding
  • the stack: Node.js, ethers v6, viem, web3.js, or plain crypto
  • the input shape: string, bytes, ABI-encoded tuple, address, or bigint
  • the desired output format: hex with or without 0x, bytes, topic hash, or selector

Example prompt shape:
Review this Node.js code that computes an ERC-20 Transfer topic. Replace sha3-256 with a correct Keccak-256 approach and show the safest ethers v6 version.

Use the right workflow

Start by identifying whether the code is doing Ethereum hashing or generic NIST SHA3. If it is Ethereum-related, swap out Node’s SHA3 implementation for a library function such as ethers or viem that explicitly provides Keccak-256. Then verify the result against a known selector or topic rather than trusting a visual match.

What to read first

For this nodejs-keccak256 guide, read SKILL.md and focus on:

  • When to Use
  • How It Works
  • Examples
  • ethers v6

Those sections tell you the intended boundary, the failure mode, and the preferred replacement patterns.

nodejs-keccak256 skill FAQ

Is nodejs-keccak256 only for Ethereum work?

Yes, that is the main fit. The skill is about Ethereum-compatible Keccak-256, not general cryptography. If you need standard SHA3-256 for non-Ethereum use, this skill is the wrong tool.

Why not just use Node crypto directly?

Because crypto.createHash('sha3-256') is not Keccak-256. Node does not warn you, and the bug can look “correct” until it breaks a selector, topic, or signature in production. The nodejs-keccak256 skill exists to prevent that silent mismatch.

Is it beginner-friendly?

Yes, if you can describe the hashing goal in plain language. You do not need deep cryptography knowledge to benefit from nodejs-keccak256 install and usage guidance, but you do need to know what Ethereum artifact you are building.

Does it work with ethers and viem?

Yes. The repository examples show ethers v6 and viem patterns, which is what makes this skill useful in real backend codebases. It is a better fit than an ordinary prompt when you need library-specific, correct-by-construction replacements.

How to Improve nodejs-keccak256 skill

Give the skill the exact artifact

The best results come when you specify the Ethereum object being hashed. For example, say “ERC-721 Transfer(address,address,uint256) topic,” not just “hash this string.” That lets the nodejs-keccak256 skill choose the right encoding and output shape.

Include the source and expected output

If you already have failing code, paste the snippet and the expected value or a known-good reference. That helps the skill detect whether the problem is encoding, algorithm choice, or formatting. For backend work, also mention whether the output must stay compatible with ethers v6, viem, or legacy web3.js.

Watch for the common failure modes

Most mistakes are not in Keccak itself; they are in input preparation. String-vs-bytes confusion, missing ABI packing, and forgetting 0x normalization cause many false fixes. If the first answer looks right but does not match a known selector or topic, ask for a verification step and a library-specific rewrite.

Iterate by checking against a known value

After the first pass, compare the result with a known selector, topic, or hash from a trusted Ethereum source. If it differs, feed back the exact mismatch and ask for a narrower correction. That is the fastest way to improve nodejs-keccak256 usage without guessing.

Ratings & Reviews

No ratings yet
Share your review
Sign in to leave a rating and comment for this skill.
G
0/10000
Latest reviews
Saving...