Blockchain: The reasons why ERC20 and ERC721 appeared and what problems they solved

1.Ethereum improvement suggestions

Platform Token (ERCToken): Created based on ETH, it does not have its own chain, but an ERCToken running on ETH;
Platform Token: Created based on the Ethereum network Token does not have its own independent blockchain, but uses the smart contract function of Ethereum to realize the issuance and management of Token
ERC20 and ERC721 are commonly used Tokens in blockchain game development. Standard

2. ERC20
2.1 Reasons for ERC20

The ERC20 standard emerged to solve the problems of Token interoperability and convenience on the Ethereum network.
When Ethereum first began to develop, developers began to create and establish various Token contracts, but there was a lack of consistency and interoperability between these Tokens.

  1. Lack of liquidity: There is no standard Token interface and transaction specification, and services such as exchanges and wallets need to implement specialized logic restrictions for each different Token. This increases the complexity of development and maintenance, the currency and usability of Tokens.
  2. Lack of flexibility: The lack of a unified programming interface between Token consistency limits developers’ innovation in Token operations and applications. Without a standardized Token interface, developers need to reimplement various functions, such as transfers, balance inquiries, and authorization.
  • The ERC20 standard promotes the widespread application and trading of Tokens and builds the foundation for most token economies on the market
    Provides infrastructure for the development and innovation of the Ethereum ecosystem ; Provides developers with a way to create and manage Tokens; Provides users with a more convenient and accessible Token operation experience
2.2 ERC20 Smart contract interface specification on Ethereum

ERC is a proposed standard,以太坊上的智能合约接口规范, and Tokens are mutually compatible and interoperable in the Ethereum ecosystem

  1. The ERC20 standard does not differentiate the value of Tokens, and different ERC20Tokens are interchangeable
    This means that different Tokens under the same standard can be traded and transferred in the same way
  2. The ERC20 standard stipulates basic Token attributes: Token’s name, symbol, total supply, transfer, remittance and other functions
    Ensure that different ERC20Tokens have similar basic functions and characteristics a>
  3. The ERC20 standard simplifies the Token issuance process
    Developers can create Token contracts based on the ERC20 standard and use standard interfaces to implement Token functions
    Reduce issuance The technical threshold enables people to easily issue their own Token
  4. ERC20Token can be divided again
    ERC20Token can be subdivided into smaller units to meet different needs and transaction scenarios.

The ERC20Token standard is a set of specifications designed for DApp developers to ensure that the Tokens they create in their projects are compatible with the ERC20 protocol. The standard stipulates specific requirements such as Token name, total supply, and implemented transaction functions. Only tokens that comply with the ERC20 protocol can be compatible with Ethereum wallets, exchanges and smart contract platforms.

2.3 ERC20 common functions:
totalSupply():              返回Token的总供应量。
balanceOf(address _owner):  返回指定地址的Token余额。
transfer(address _to, uint256 _value):     将指定数量的Token从调用者的地址转移到目标地址
approve(address _spender, uint256 _value): 授权指定地址可以从调用者的地址转移一定数量的Token
allowance(address _owner, address _spender): 返回授权的Token数量
transferFrom(address _from, address _to, uint256 _value): 从一个地址向另一个地址转移一定数量的Token,前提是该地址已被授权
III,ERC721Non-homogenized Token

The value and function of each ERC20 Token are the same, and some assets that require non-fungible assets are no longer applicable
非同质化资产 means that each individual entity has unique attributes and value, such as digital art, games, virtual reality, etc.; assets cannot be exchanged at equivalent prices because they have unique and personalized value

ERC721 standard

  • ERC721 cannot be split
  • Each Token has a unique Token ID, and each Token is unique;
    Similar to: Now your 100 oceans and my 100 oceans seem to be the same , but the numbers don’t work
  • The ERC721 protocol makes digital assets more collectible, especially in determining the property rights of virtual assets and online games, which have huge potential;
  • At the same time, you can track, trade and manage real assets such as houses and cars.

おすすめ

転載: blog.csdn.net/a6864657/article/details/131393887