Before 2015, if a project wanted to create its own digital asset on a blockchain, it was a monumental task. They would often have to copy Bitcoin's code, modify it, and try to launch their own separate blockchain—a process that was difficult, expensive, and insecure.
Ethereum changed everything. It allowed people to create a new token on top of the existing, secure Ethereum network, simply by deploying a single smart contract.
However, a problem quickly emerged. Everyone was creating their own tokens, but they all wrote their smart contracts differently.
Alice's "AliceCoin" contract had a function called send_coins().
Bob's "BobToken" contract had a function called transfer_tokens().
Carol's "CarolCash" contract had a function called move_asset().
This was chaos. For a wallet or an exchange to support all three tokens, they would have to write custom code for each one. It was not scalable.
1. The Solution: A Standardized Blueprint (ERC-20)
In late 2015, a proposal was made by Fabian Vogelsteller called ERC-20. (ERC stands for "Ethereum Request for Comments"). It was a simple but brilliant idea: let's create a standard interface—a mandatory blueprint—that every "token" contract must follow.
This standard defined a set of common functions and events that every fungible token contract must include.
What does "Fungible" mean? Fungible means interchangeable. One unit is exactly the same as another. My one-dollar bill is just as good as your one-dollar bill. My 1 ETH is just as good as your 1 ETH. This is in contrast to non-fungible items, like a specific house or a unique painting, which are not interchangeable.
2. The Anatomy of an ERC-20 Token Contract
The ERC-20 standard requires every compliant contract to implement a specific set of functions. Here are the most important ones:
Core Functions (The "Must-Haves"):
totalSupply(): Returns the total number of tokens that will ever exist.
balanceOf(address _owner): Returns the token balance of a specific address.
transfer(address _to, uint256 _value): This is the most common function. It allows a user to send their own tokens to another address. It automatically subtracts from the caller's balance and adds to the recipient's.
The "Allowance" Mechanism (For Programmatic Spending):
This is a slightly more complex but critical part of the standard. What if you want to allow another smart contract (like a Uniswap decentralized exchange) to spend tokens on your behalf? You can't just give the Uniswap contract your private key.
The solution is a two-step "allowance" process:
approve(address _spender, uint256 _value): You call this function on the token contract. It says, "I, the token owner, hereby approve the _spender address (e.g., the Uniswap contract) to withdraw up to _value tokens from my balance."
transferFrom(address _from, address _to, uint256 _value): The _spender contract (Uniswap) can now call this function. It says, "I am withdrawing _value tokens from the _from address (your address) and sending them to the _to address (the other party in the trade)." This call will only succeed if you have previously approved it.
- allowance(address _owner, address _spender): Checks how much a _spender is still allowed to withdraw from an _owner's account.
3. Pseudocode: A Simplified ERC-20 Contract
Let's see what the code for a simple token called "MyToken" (MTK) might look like.

4. The Impact of Standardization
The ERC-20 standard was revolutionary because it created a plug-and-play ecosystem.
Wallets: A wallet like MetaMask only needs to implement the ERC-20 functions once. It can then automatically display and transfer any of the thousands of ERC-20 tokens.
Exchanges: A decentralized exchange like Uniswap only needs to code to the ERC-20 transferFrom and approve standard once. It can then create a trading pool for any ERC-20 token.
Innovation: This dramatically lowered the barrier to entry. Developers could focus on their project's unique logic, knowing that the "money" part of their system would be instantly compatible with the entire DeFi ecosystem.
This is the standard that powers almost all the tokens used in the DeFi applications we discussed earlier (like Aave, Compound, and Uniswap).