What is Wei?
Wei is the smallest denomination of Ether (ETH), where 1 ETH = 10^18 wei — used in smart contract programming and RPC calls where values must be expressed as integers without decimal points.
WHY IT MATTERS
Blockchains don't use floating-point numbers — they use integers for precision. Wei is ETH's base unit: 1 ETH = 1,000,000,000,000,000,000 wei. All on-chain values, RPC calls, and smart contract interactions use wei.
Named after Wei Dai (cryptographer and cypherpunk), wei enables precise calculations without rounding errors that floating-point math would introduce. This precision is critical when handling financial values.
Developers must constantly convert between human-readable ETH values and wei for contract interactions. Libraries like ethers.js provide parseEther/formatEther utilities for this conversion.