Keccak-256, Ethereum vs Solana addresses, and RPC basics
Notes on Keccak-256, how Ethereum and Solana addresses are generated, JSON-RPC usage, and small code snippets for balances and units.
Keccak-256, Ethereum vs Solana addresses, and RPC basics
Today I learned and summarized the essentials: Keccak-256 hashing, how Ethereum addresses are derived, how Solana keys differ, and how RPC/JSON-RPC calls work when querying balances.
Keccak-256
Keccak-256 is a cryptographic hash function widely used in Ethereum.
- Collision resistance: extremely difficult to find two inputs with the same hash.
- Pre-image resistance: infeasible to invert the hash to recover the original input.
- Output length: 256 bits (32 bytes).
Try it out with an online Keccak-256 tool if you want to experiment.

Ethereum addresses (brief)
Generation process:
- Generate an elliptic-curve keypair (EdDSA/SECP256k1 depending on the stack). The public key is typically 64 bytes (uncompressed) or 32 bytes for some curves.
- Hash the public key with Keccak-256.
- Take the last 20 bytes of the hash.
- Convert to hexadecimal and prefix with
0x— this is the Ethereum address.
Example diagram:

Example (conceptual):
public_key -> keccak256 -> 32 byte hash -> last 20 bytes -> 0x... (address)References: implementations in Ethers.js and Backpack (wallets) follow this process.
Solana public keys
- Solana public keys are 32 bytes and are commonly presented in Base58 (e.g.
5W4oGg...). - Solana addresses are just the public key encoded — no extra Keccak hashing/chopping step is required like Ethereum.
Frontend vs Backend and RPC
- Backend servers: run application logic and may talk to blockchain RPC providers.
- Frontend: issues HTTP requests to backends or directly to RPC endpoints for quick queries.
Example typical flow when checking an on-chain balance:
- Frontend sends a JSON-RPC request to an RPC server (either a public provider or your backend proxy).
- RPC server queries the node(s) and returns the result.
Diagram:

JSON-RPC examples
Solana JSON-RPC example (getAccountInfo):
{
"jsonrpc": "2.0",
"id": 1,
"method": "getAccountInfo",
"params": ["Eg4F6LW8DD3SvFLLigYJBFvRnXSBiLZYYJ3KEePDL95Q"]
}Ethereum JSON-RPC example (getBalance):
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBalance",
"params": ["0x8BCd4591F46e809B15A490F5C6eD031FDDE0bee0", "latest"]
}You can use tools like Postman to send RPC requests to providers such as Alchemy, QuickNode, or a public Solana RPC endpoint.

Units: Wei and Lamports
When working with balances avoid floating-point decimals. Use integer smallest units instead:
- Ethereum: wei (1 ETH = 10^18 wei). Gwei commonly used for gas (1 ETH = 10^9 Gwei).
- Solana: lamports (1 SOL = 10^9 lamports).
Quick example (Node):
const { LAMPORTS_PER_SOL } = require("@solana/web3.js");
console.log(LAMPORTS_PER_SOL); // 1000000000RPC servers and scaling
- An RPC server is an intermediary between clients and blockchain nodes. It does not participate in consensus or staking.
- You can scale RPC capacity by adding more nodes and load-balancing requests. Public providers (Alchemy, QuickNode, Helius) manage this for you.

Notes / To-do:
- Add the images used above into
public/images/blog/:keccak-eth-sol-rpc-cover.pngkeccak-diagram-01.pngeth-address-derivation.pngsolana-key-diagram.svgfrontend-backend-rpc.pngpostman-rpc-example.pngrpc-node-cluster.png
I added the post content and image placeholders — please copy the screenshots you attached into the files listed above (under public/images/blog/) and I'll help wire them in or tweak captions if you want.