Rayls DocsRayls Custody API
Rayls Docs

In Rayls, a "Resource" signifies a contract whose bytecode is registered on the Subnet Hub, making it accessible for deployment across all Rayls Privacy Nodes. This mechanism eliminates the need for manual contract deployment on each ledger and negates the necessity to track contract addresses on every destination.

The Essence of Resource

A Resource represents a smart contract, crucial for facilitating cross-chain communication within the Rayls ecosystem. By registering a contract's bytecode on the Subnet Hub, Rayls ensures that every Rayls Privacy Node Ledger can deploy this contract by itself, without any manual interaction. It implies that an ERC20 token contract, once registered as a Resource on the Subnet Hub, can be transferred to a Rayls Privacy Node Ledger even if it has not been implemented on the destination ledger. The Relayer and Endpoint autonomously manage the contract's deployment before processing the token receipt, ensuring seamless cross-chain transactions.

The Role of resourceId

resourceId is a unique identifier that abstracts the complexity of dealing with different contract addresses across various blockchains. It acts as a universal reference point for the registered contract, ensuring consistent identification and interaction across the Rayls network.

Key Benefits

  • Simplification: Eradicates the hassle of deploying and managing smart contracts on multiple Rayls Privacy Nodes.
  • Uniformity: Provides a single, consistent identifier for contracts across the ecosystem, enhancing ease of use and interoperability.
  • Efficiency: Facilitates swift and secure cross-chain communication, crucial for seamless operation within the Rayls ecosystem.

Conclusion

Resource and resourceId are central to the Rayls architecture, offering an elegant solution to the challenges of cross-chain contract deployment and interaction. This approach not only simplifies the development process but also ensures a more integrated and efficient blockchain ecosystem.