Registering a token with a Subnet
Overview
Before a token can be teleported across Privacy Ledgers within the Rayls ecosystem, it must be registered in the Subnet. This guide details the process for registering a token, ensuring it is approved and ready for teleport transactions.
Pre-requisites
Before initiating the token registration process, ensure that the token is deployed and minted on your Privacy Ledger.
Step-by-Step
1. Request Token Registration
After deploying and minting your token on the Privacy Ledger:
Initiate Registration Request:
As the Privacy Ledger owner, use the Rayls CLI command below to request the token's registration in the subnet.
Example:
npx hardhat deployToken --pl <your-PL> --symbol <your-symbol>
This command submits a registration request to the Subnet Operator.
Response
Deploying token on <privacy-ledger-name>...
Token Deployed At Address <token-contract-address>
Token Registration Submitted, wait until relayer retrieves the generated resource
To check if it's registered, please use the following command:
npx hardhat checkTokenResourceId --pl <chain-id> --token-address <token-contract-address>
2. Subnet Operator Approval
Review and Approve:
The Subnet Operator reviews the registration request. The Operator ensures that the token complies with the subnet’s governance rules and meets all required criteria.
Once the review is complete, the Subnet Operator approves the token registration, adds the token (ID, info) to the subnet’s token registry, and marks it as active
. This status enables other Privacy Ledgers (PLs) to validate the token and receive it.
Read more about the token approval process in the Approving Token Registrations page.
3. Token Registered
Confirmation of Registration:
Once registered, the token receives a resourceID
, which is the universal identity of a token within the Private Subnet. After a resourceID
is assigned, the token becomes visible to all Privacy Ledgers within the subnet via the Token Registry in the Commit Chain. The registry holds information such as:
- Token ID (
resourceID
) - Token Status (e.g., active)
- Contract Code
Querying the Registered Token:
Once registered, the token can be queried via the CLI. Use the following Rayls CLI command to check the resourceID
assignment:
Example:
npx hardhat checkTokenResourceId --pl <chain-id> --token-address <token-contract-address>
This command allows the Privacy Ledger owner to check the registration status through the resourceID assignment of its tokens.
Response:
# IF TOKEN APPROVED
Resource id is: <resource-id>
# IF TOKEN APPROVAL PENDING
No resource id generated! Wait until VEN Operator approves the token.
Post-Registration:
Once the token is registered:
- Teleport Transactions: The token can now be used in teleport transactions across Privacy Ledgers within the subnet.
- Only tokens that have been registered and approved in the subnet are eligible for Teleport Transactions between Privacy Ledgers. If an unapproved token is used in a teleport transaction, the cross-chain process will fail at the initiation stage on the sender's Privacy Ledger, returning the following error message:
Token not registered.
Token registration is a critical first step in enabling the secure transfer of digital assets across Privacy Ledgers in the Rayls ecosystem. By following this guide, you ensure that your tokens are properly registered and compliant with subnet governance rules, paving the way for seamless teleport transactions.
Updated about 2 months ago