In the world of Ethereum and other blockchains built using the Ethereum Virtual Machine (EVM), you may come across a term called “wei.” But what exactly is wei, and why is it important? Let’s break it down in simple terms.
What is Wei?
Wei is the smallest unit of ether, which is the native cryptocurrency of the Ethereum blockchain. Just like how a dollar can be broken down into cents, ether can be broken down into smaller units, with wei being the smallest denomination.
Different Units of Ether
In addition to wei, there are several other units used to measure ether, each representing different amounts:
- Wei: This is the smallest unit, equivalent to 1 wei.
- Kwei (or Kilowei): 1 Kwei is equal to 1,000 wei.
- Mwei (or Lovelace, Megawei): 1 Mwei is equal to 1,000,000 wei.
- Gwei (or Shannon, Gigawei): 1 Gwei is equal to 1,000,000,000 wei.
- Microether (or Szabo): 1 Microether is equal to 1,000,000,000,000 wei.
- Milliether (or Finney): 1 Milliether is equal to 1,000,000,000,000,000 wei.
- Ether (or ETH): This is the base unit of ether, equivalent to 1,000,000,000,000,000,000 wei.
Why Wei Matters
Wei may seem like a tiny amount, but it plays a crucial role in Ethereum and other EVM-based or layer two blockchains. It is used to measure the value of transactions, smart contract executions, and gas fees.
Gas Fees and Wei
When you perform a transaction or execute a smart contract on the Ethereum blockchain, you need to pay a fee called “gas.” Gas fees are measured in wei and are used to compensate miners for validating and processing transactions on the network.
Example of Wei in Ethereum
Let’s say you want to send 0.001 ether to a friend. In wei, this would be equal to 1,000,000,000,000 wei (since 1 ether = 1,000,000,000,000,000,000 wei). When you initiate the transaction, you would need to specify the amount in wei to ensure accuracy.
In Summary
Wei is the smallest unit of ether and is used to measure transactions, smart contract executions, and gas fees on the Ethereum blockchain and other EVM-based or layer two blockchains. Understanding wei is essential for anyone interacting with these blockchains, as it forms the basis of value measurement and transactional calculations.