ERC-20, ERC-721, ERC-1155, ERC-4626 and composability
Last updated
Last updated
ERC-20, ERC-721, ERC-1155, ERC-4626, ERC-, etc. I don't know what the various Ethereum dai currency standards are? Why are these standards important? Interested in learning which dai coin standards serve what purpose? Want to see the big picture? This long tweet has the answer for you!
Ethereum is a world computer. It is a shared resource maintained by a network of anonymous and untrusted nodes; consensus is reached through consensus and the network is economically secure.
The Ethereum network provides trusted neutrality on which anyone can build independently and collaboratively.
An application programming interface (API) is a mechanism for different programs to communicate and developers to coordinate. Developers try to hide the inner workings of their programs as much as possible. Communication is simplified and improved to the greatest extent possible.
From the perspective of abstraction, API is the most common way of abstraction in the real world. An API is a defined set of rules explaining how programs/applications communicate with each other.
As an example, let's imagine that an e-commerce website has a price bot; the user gives the price bot the characteristics of a fruit, and the bot returns a price.
In order to integrate information with a price bot, you need to give it an object (fruit) information, and receive a price. Therefore, first you need to pack all the object information: fruit_a = [apple, red, 200g, harvested 3 days ago]
Now, we need to feed this information to the price bot. First, we call (price_bot) and then give us a price by asking price_bot to calculate fruit_a using the calculate_price function, i.e. price_bot calculate_price(fruit_a).
price_bot will do what it can to calculate the price. As users, we don't know or care about the calculations happening behind the screen, we only know that in the end price_bot will give us a price, i.e. price_bot.calculate_price(fruit_a) = price_fruit_a.
This is the price bot API: a list of the functions supported by the price bot and instructions on how to use them. This is a schematic so that developers can integrate the application without having to master it. Assuming this example is real, the documentation for this API should look like this:
On the surface, API development work may not feel like programming; API development and documentation is more like writing than writing code. But don't be fooled, API development is actually as important as writing code.... Honestly, probably even more important than writing code.
In the world computer, we use APIs everywhere:
Integration Agreement
Transfer assets
Build Portable Investments
Borrowing, Lending and Mortgage Assets
Basically, everything that happens on-chain is either an API or is directly integrated by an API.
In fact, you can think of different types of dai coin standards as a piece of code that conforms to an API template. If a smart contract follows a specific template, then it is that dai coin.
This is the dai coin template for ERC-20. In order to generate an ERC-20 smart contract, the developer needs to create code that executes all the methods and events below.
All ERC-20 contracts support these functions; a (different) developer can rely on the following to use any ERC-20 contract.
ERC-20 is the most basic dai currency standard, representing most of the current valid dai coins. It includes governance dai coins, ve-toke (voting custody dai coins), stable coins, etc. (ETH is not an ERC-20 dai coin.)
The ERC-1155 dai coin standard combines the features of the ERC-20 and ERC-721 dai coin standards, providing a single interface to manage any combination of these dai coin types. This can be used as a more modern ERC-20 and ERC-721 alternative and has unique features for games.
ERC-777 is a highly configurable but rarely used dai coin standard. It provides an upgrade to ERC-20, allowing developers to attach code that runs when sending and/or accepting dai.
Although it is included at https://ethereum.org, we rarely see ERC-777 in practice.A quick recap of history:
This is where the story begins.
Ethereum is just infrastructure, and now we have to build on it. The richer the standards we set on this basis, the further we can go.
Arguably, computer science is magic, developers are magicians, and abstraction is the mantra. Composability is the goal.
The concept of abstraction underpins the world's computer to demonstrate its most important capabilities.
Native ETH ..... ERC-20, 721, 777, 1155, 4626... We are getting more advanced with each ERC addition. Each dai coin type can have more functions, and each money Lego will bring more value.
Each addition to the ERC standard will bring us closer to programmable money.
Programmable money is an entirely new concept. If currency is concrete, programmable, like Lego.
Each agreement absorbs plastic (i.e. value) and produces Lego bricks (usually money). These blocks can be combined with other blocks to create something bespoke and completely new.
Programmable money is an entirely new concept. If currency is concrete, programmable, like Lego.
Each agreement absorbs plastic (i.e. value) and produces Lego bricks (usually money). These blocks can be combined with other blocks to create something bespoke and completely new.
The dai coin standard refers to how composability manifests on Ethereum.
ERC-721 dai coins are generally referred to as (non-fungible dai coins). These dai coins (usually) represent unique or identifiable items within the collection, including PFPs, art collections, property, etc.
ERC-4626 is the latest dai coin standard that describes yielding vaults. This standard provides a common interface for ERC-20 dai coins deposited into (or redeemed from) vaults for yield. This can include liquidity and aggregation, but there are many more areas.
First, the pre-internet era, then... Alan Turing → Mechanical Computing → Computers → Networked Computers → Arpanet → World Wide Web (www) → Internet → → Ethereum circa 2014, when @VitalikButerin Introduce us to ETH.
is a better way - Composability: The ability to make the combination of two separate things more than the sum of their parts.