In Ethereum, "wei" is the smallest denomination of Ether (ETH), the cryptocurrency used within the Ethereum network.
Wei is the smallest unit of Ether, similar to how cents are the smallest unit of a dollar. However, unlike dollars, where 100 cents equal one dollar, one Ether is equal to 1,000,000,000,000,000,000 (10^18) wei.
Using wei allows for extremely fine granularity in financial calculations, which is essential for smart contracts and micro-transactions. This precision is critical because Ethereum transactions often involve very small amounts of Ether.
The use of wei as a unit name follows the tradition of naming Ethereum units after prominent figures in cryptography and computer science. Wei is named after Wei Dai, a computer scientist known for his contributions to the development of cryptographic currencies.
Ethereum's denominations and their equivalent values in wei:
When dealing with Ethereum transactions or smart contracts, amounts are often specified in wei to avoid rounding errors that can occur with floating-point arithmetic. For example, gas prices, which are fees paid to execute transactions, are typically denominated in Gwei (gigawei).