LSP7 vs ERC20: Top 6 Differences

Bianca Buzea
LUKSO
Published in
4 min readJan 11, 2024

In the ever-evolving landscape of blockchain standards, LSP7- Digital Asset has emerged as a groundbreaking innovation. For those familiar with the Ethereum ecosystem and the ERC20 token standard, it’s time to explore the intriguing differences between these two standards. Below we will highlight the distinctive features of the new LSP7 token standard, which can be used to create future-ready assets that are more dynamic and secure, powered by LUKSO.

Before we analyze the main differences between the two standards, let’s first have a look at what the two standards are used for. ERC20 is a standard on the Ethereum blockchain for fungible tokens (each token is the same as another token). On the other hand, LUKSO’s LSP7 standard can be used for both fungible and non-fungible tokens (NFTs).

LSP7 vs ERC20 Main Differences

Metadata Flexibility

ERC20 offers limited metadata attachment capabilities, typically scoped to basic elements such as nameand symbol. This makes it difficult to add additional information specific to the asset such as an icon, the asset creator, or the utility of the token. The inclusion of such information is essential for creating a comprehensive and personalized description for each token or NFT.

LSP7 leverages [ERC725Y] to add generic information to the asset even after deployment, enabling additional flexibility. LSP4 — DigitalAssetMetadata defines a set of data keys to describe a Digital Asset using ERC725Y as a backbone. This allows users to attach additional metadata to their assets such as multiple creator addresses, the community supporting the token, the collection it belongs to, and more.

Increased Security

ERC20 traditional token transfers lack notifications, leaving users unaware of incoming tokens. The risk of token loss is another great concern, as the ability of the recipient to handle the asset is not checked before sending the transaction.

LSP7 enhances security by assessing the recipient’s capability to handle the asset before the transfer. To ensure a safe asset transfer, an additional boolean parameter,force, was added to transfer(). This parameter is dependent on the recipient. By default, the value is set to false, and it ensures that the transfer only executes for smart contracts supporting LSP1 — Universal Receiver. Smart contracts not implementing LSP1 and EOAs (Externally Owned Accounts) are able to receive tokens only when the force parameter is set true. This mechanism acts as a guardrail against sending tokens to uncontrolled addresses. Additionally, users are notified about the incoming asset and get the chance to decide how to react accordingly (e.g.: forwarding a certain amount of the token, rejecting the token, etc.). Users now have more control over what is in their wallets! ✋

Managing Multiple Transactions

ERC20 has no native support for batch transfers or function calls.

LSP7 has native support for batch transfers and function calls, enhancing efficiency in managing multiple transactions and unlocking gas savings.

Adaptability to New Standards and Requirements

ERC20 has rigid functionalities at deployment, limiting adaptability to new standards or requirements.

LSP7 assets can support new standardized functions and InterfaceIDs over time using LSP17-ContractExtension. This enables acquiring new functionalities without the need for redeployment. To illustrate how this works in practice, let’s take the example of a token contract that can be extended with a buy() function. The token owner can call this function directly on the token contract, which after an approval from the token owner can move tokens on his behalf based on the specified logic included in the extension.

Transfer Function

ERC20: thetransfer(address, uint256)function can only be called by the holder of ERC20 tokens. Token operators (spenders) need to use transferFrom(address, address, uint256). This means that based on the sender of the transaction, different functions will need to be called, lacking standardization.

LSP7: transfer(address, address, uint256, bool, bytes) can be called by both token holders and operators, ensuring consistency and standardization.

NFT Support

ERC20 can only be used for representing fungible tokens.

LSP7 can be used for both fungible and non-fungible tokens (an NFT when the decimals value is set to 0). This is useful for creating large quantities of NFTs, where all items are the same (e.g.: digital goods).

Conclusion

While ERC20 has been a cornerstone in the Web3 space, LSP7 emerges as a comprehensive standard, addressing limitations and introducing innovative capabilities. From flexible metadata attachment, to secure transfers, and future-proofing functionalities, LSP7 elevates the features of digital assets on the LUKSO blockchain.

The journey from ERC20 to LSP7 signifies a leap towards a more versatile, secure, and user-friendly digital asset ecosystem. As the blockchain landscape continues to evolve, LSP7 stands at the forefront, providing a robust foundation for the next generation of digital assets.

To learn more about LSP7, and how you can integrate it into your dApp, check out the “Create an LSP7 Token” guide from the documentation portal.

Further Resources

--

--