Technical definition
Wei is the base unit of ether in Ethereum’s native cryptocurrency system, defined as 1 wei = 10^-18 ETH. All gas prices, transaction costs, and smart contract computations are denominated in wei to ensure precision in micro-transactions. The unit is named after Wei Dai, a cryptographer who contributed to early ideas in digital money and privacy-preserving protocols.
An analogy
Imagine a dollar is split into 100 pennies. A penny is the smallest unit of a dollar, just as a wei is the smallest unit of ether. While you rarely deal with pennies in everyday transactions, they are essential for calculating exact change or prices in a store.
Why it matters
Wei enables Ethereum to handle extremely small fractional payments and gas fees with precision, preventing rounding errors in computational costs. Without such a small unit, micro-transactions or fine-grained gas pricing would be impractical.
Where it came from
The term 'wei' was introduced in Ethereum’s early development, inspired by Wei Dai’s work on cryptographic money systems like b-money. It has been part of Ethereum’s design since its genesis in 2015.
Example in practice
A gas price of 20 gwei (gigawei) means 20 × 10^9 wei per unit of gas. If a transaction uses 21,000 gas units, the total cost is 20 gwei × 21,000 = 420,000 gwei (or 0.00042 ETH).
Common misconceptions
- Wei is a separate cryptocurrency → Correction: Wei is a subunit of ether, not a standalone token.
- Wei is only used for gas fees → Correction: Wei is used for all ether-denominated values, including gas fees, transaction amounts, and smart contract interactions.
Risks & limitations
- Precision errors in wallets or exchanges: If software incorrectly handles wei conversions, users may lose funds due to miscalculated transactions.
- Overhead in user interfaces: Displaying wei values directly can confuse users, leading to errors in manual input (e.g., copying a wei value instead of ETH).