Rayls Docs

Rayls-supported ERC token standards

Overview

ERC token standards define the rules and guidelines for creating and managing tokens on an EVM-compatible blockchain.

👍

The latest version of Rayls supports 3 ERC token standards: ERC20, ERC721, and ERC1155.

Understanding these standards is essential for developers and users who want to tokenise currencies, assets, or build decentralised applications (DApps) within the Rayls ecosystem.

The Rayls product is fully compatible with the Ethereum Virtual Machine (EVM), meaning it is not strictly bound by these specific standards. Any EVM-compatible token standard can be seamlessly integrated into the Rayls ecosystem, making it a flexible and versatile platform for various blockchain use cases.

This page provides a conceptual overview of these key token standards, serving as a refresher and offering links to more detailed information.


ERC20: The Fungible Token Standard

What is ERC20?

ERC20 is a widely used token standard for creating fungible tokens on Ethereum-compatible blockchains, including Rayls. Fungible tokens are identical and interchangeable, meaning each token has the same value and characteristics as any other token of the same type. This makes ERC20 tokens ideal for use cases like cryptocurrencies, voting tokens, and utility tokens.

Key Features of ERC20

  • Uniformity: All ERC20 tokens follow the same rules, ensuring compatibility with various wallets, exchanges, and DApps.
  • Fungibility: Each ERC20 token is identical in value and function to another token of the same type.
  • Basic Functions: ERC20 defines a set of basic functions for transferring tokens, checking balances, and approving tokens for spending by other parties.

Example Use Cases

  • Currencies: CBDCs, Tokenised Deposits, Stablecoins and many popular cryptocurrencies are built using the ERC20 standard.
  • Voting Systems: ERC20 tokens can be used to represent votes in decentralized governance systems.
  • Utility Tokens: Used within DApps to represent access rights, services, or goods.

Key Methods in ERC20

  • totalSupply: Returns the total supply of tokens.
  • balanceOf: Returns the balance of tokens for a specific address.
  • transfer: Transfers tokens from one address to another.
  • approve: Approves another address to spend a specified amount of tokens on behalf of the token holder.
  • transferFrom: Transfers tokens from one address to another, based on prior approval.

Note that for inter-Privacy Ledger transactions across a Subnet, a different set of Rayls methods should be used to transact tokens via the Rayls Protocol.

For a deeper understanding of the ERC20 standard, refer to the official ERC20 documentation.


ERC721: The Non-Fungible Token (NFT) Standard

What is ERC721?

ERC721 is the token standard for creating non-fungible tokens (NFTs), which are unique digital assets on the blockchain. Unlike ERC20 tokens, each ERC721 token is distinct and has its own value, making this standard ideal for representing ownership of unique items like financial assets, tokenised credit instruments or tokenised representations of real world assets (RWAs).

Key Features of ERC721

  • Uniqueness: Each ERC721 token is unique, with a different value and set of characteristics.
  • Ownership Tracking: ERC721 tokens can track ownership of individual items, ensuring clear and provable ownership rights.
  • Interoperability: Like ERC20, ERC721 tokens are compatible with various wallets, marketplaces, and DApps, but tailored for unique assets.

Example Use Cases

  • Financial Assets: Financial institutions can create a natively digital asset, where the token and its metadata represent the legitimate financial instrument, on-chain.
  • Tokenised Credit Receivables: Promissory notes or assets that represent future cash flows can be tokenised on-chain and traded between regulated institutions.
  • Real Estate: Physical or virtual real estate can be tokenised, with each property represented by a unique ERC721 token.

Key Methods in ERC721

  • ownerOf: Returns the owner of a specific token.
  • approve: Approves another address to transfer a specific token on behalf of the owner.
  • transferFrom: Transfers ownership of a specific token from one address to another.
  • safeTransferFrom: Similar to transferFrom, but with added checks to prevent tokens from being sent to incompatible contracts.

Note that for inter-Privacy Ledger transactions across a Subnet, a different set of Rayls methods should be used to transact tokens via the Rayls Protocol.

For more details on the ERC721 standard, refer to the official ERC721 documentation.


ERC1155: The Multi-Token Standard

What is ERC1155?

ERC1155 is a flexible token standard that allows for the creation of both fungible and non-fungible tokens within a single contract. This standard is designed for use cases where multiple types of tokens need to be managed efficiently, such as in managing a fund or portfolio of multiple assets and currencies.

Key Features of ERC1155

  • Efficiency: Allows for the management of multiple token types (both fungible and non-fungible) within a single contract, reducing the cost of transactions and deployment.
  • Batch Operations: Supports batch transfers and operations, enabling multiple tokens to be sent or managed in a single transaction.
  • Versatility: Ideal for complex DApps where different types of tokens (e.g., currency, items, collectibles) need to coexist and interact.

Example Use Cases

  • Funds and Portfolio Management: managing a dynamic basket of assets and currencies, where individual assets are often bought, sold or transferred.
  • Digital Marketplaces: Platforms that deal with various digital assets can use ERC1155 to handle multiple asset types efficiently.
  • Tokenized Assets: Use cases that require both fungible and non-fungible tokens (e.g., a combination of equities, bonds and currencies) can benefit from the flexibility of ERC1155.

Key Methods in ERC1155

  • balanceOf: Returns the balance of a specific token type for an address.
  • balanceOfBatch: Returns the balances of multiple token types for multiple addresses in a single call.
  • safeTransferFrom: Transfers a specific token type from one address to another.
  • safeBatchTransferFrom: Transfers multiple token types from one address to another in a single transaction.

Note that for inter-Privacy Ledger transactions across a Subnet, a different set of Rayls methods should be used to transact tokens via the Rayls Protocol.

For more details on the ERC1155 standard, refer to the official ERC1155 documentation.


Choosing the Right Token Standard

When to Use ERC20

If you need to create a fungible token where each unit is identical to another, such as a currency or stablecoin.

When to Use ERC721

If you need to represent unique assets or items where each token has distinct characteristics and ownership, such as digital financial assets, tokenised credit instruments or tokenised representations of real world assets.

When to Use ERC1155

ERC1155 can be an efficient and useful option if your use case requires a mix of fungible and non-fungible tokens, or if you need to manage multiple token types efficiently within a single contract, such as in fund management, portfolio management or across complex digital asset workflows.


Conclusion

Understanding the different token standards available within the Rayls ecosystem is crucial for developers and users who wish to leverage blockchain technology effectively.

While the Rayls product is fully compatible with EVM and supports a wide range of token standards, ERC20, ERC721, and ERC1155 are among the most commonly used. These standards offer flexibility and functionality to meet various project needs.