Supported token standards
A Rayls Sovereign chain (Privacy Node in the code) is an EVM (Ethereum Virtual Machine) chain, so any token contract can run on it. To take part in a Rayls Private Network, though, a token must be built on one of the token handlers in the Rayls SDK. The handlers are Solidity contracts in rayls-sovereign-contracts (src/rayls-protocol-sdk/tokens/). Each one implements a standard ERC interface and adds the functions that register the token with the network.
The handlers
| Handler | Standard | Use in a Private Network |
|---|---|---|
| RaylsEnygmaHandler | ERC-20 | Private payments between chains with Enygma, and the payment leg of private DvP (delivery-versus-payment) |
| RaylsErc721DvpHandler | ERC-721 | Assets exchanged against Enygma tokens in private DvP |
| RaylsErc1155DvpHandler | ERC-1155 | Assets exchanged against Enygma tokens in private DvP. Fungible token IDs only. |
| RaylsErc20Handler | ERC-20 | A registered token on a participant's chain. An Enygma transfer can mint or burn it on arrival, as a program step. |
| RaylsStableCoinHandler | ERC-20, with pause, blacklist and capped minters | As RaylsErc20Handler |
| RaylsErc721Handler | ERC-721 | As RaylsErc20Handler |
| RaylsErc1155Handler | ERC-1155 | As RaylsErc20Handler |
The handlers are abstract contracts. The chain's contract factory deploys a standard, concrete version of each one (for example, ProductionErc20Token for RaylsErc20Handler).
How tokens move between chains
Enygma transfers
An Enygma token is an ERC-20 token on each Rayls Sovereign chain. A cross-chain transfer burns the tokens on the sending chain, settles on the Private Network Hub as a zero-knowledge proof with encrypted messages, and mints the tokens on the receiving chain. The other participants can't see the amount or which of them received it. See How Enygma works and Send Enygma transactions.
Private DvP
DvP tokens move between chains by being swapped against Enygma tokens. The holder deposits the token into a vault on the Hub (depositIntoDvp), swaps it (swapWithDvpForEnygma), and the new owner withdraws it to their own chain (withdrawFromDvp). Both legs of a swap settle in one transaction on the Hub, or neither does. See Private DvP with Enygma.
Program steps
The ERC-20, ERC-721 and ERC-1155 handlers have crossMint and crossBurn functions. An Enygma transfer can call them on the receiving chain, as a program step, if the sender is the token's owner on that chain. See Programmable transfers.
RaylsStableCoinHandler
RaylsStableCoinHandler extends RaylsErc20Handler with the compliance controls common in fiat-backed stablecoin contracts:
- a pauser can stop every transfer, mint and burn;
- a blacklister can block an address from sending or receiving;
- a master minter can let other accounts mint, each up to an allowance.
All three default to the token's owner, who can reassign them. There is no reference page for this handler; the source is RaylsStableCoinHandler.sol.
What all the handlers share
- Registration before use. A handler token can't be transferred, even on its own chain, until the chain's operator authorises it in the chain's token registry. To use it across the network, the chain's operator then submits it to the Hub, the issuing chain must be registered as an issuer, and the Private Network operator must approve it. See Registering a token within a Private Network and Approving new tokens.
- Supply is public on the Hub. Each mint and burn by the token's owner is reported to the Hub's token registry with its amount in clear.
- Owner controls. The token's owner (
TOKEN_OWNERon the chain's access manager) can mint, and can burn from any holder's balance without their approval. - Freezing. The Private Network operator can freeze a token for chosen participants, and a chain's operator can freeze a token on its own chain. See Freezing tokens.
Deploying a token
The chain's contract factory (RNContractFactoryV1) has one function per standard template: deployErc20AsUser, deployErc721AsUser, deployErc1155AsUser, deployEnygmaAsUser and deployStableCoinAsUser, plus deployRegisteredAsUser for any other seeded template, such as the DvP tokens. The caller becomes the token's owner. Deploying through the factory is what lets the token's code pass the network's template checks.
For Enygma tokens, a receiving chain always gets the standard template, whatever code the issuer deployed.
Other token contracts
A token that doesn't use a handler can run on a single Rayls Sovereign chain like on any EVM chain, but it can't be registered on the Hub. The Hub rejects registrations that don't declare one of the supported standards.
Updated about 2 hours ago
