Rayls DocsRayls Custody API
Rayls Docs

Rayls Relayer

The primary purpose of the Rayls Relayer is to facilitate secure and efficient communication between a Rayls Privacy Node and a Rayls Subnet Hub, ensuring that these transactions are properly validated and executed. By doing so, the Relayer helps maintain the privacy and security of transactions while enabling seamless interaction between different components of the Rayls ecosystem.

Each time a Rayls Privacy Node connects to a new Subnet Hub, a dedicated Relayer is installed to orchestrate private cross-chain communication.


Key Objectives

Transaction Propagation: Securely and efficiently relay transactions between a Rayls Privacy Node and a Subnet Hub.

Privacy Preservation: Ensure that all sensitive transaction details remain confidential during the relay process.

Consistency and Integrity: Maintain the consistency and integrity of transactions across all layers of the network.


Core Functions

1. Transaction Relay

The Rayls Relayer is responsible for relaying transactions between a Rayls Privacy Node and a Subnet Hub. This involves retrieving transactions that have been finalised on a Rayls Privacy Node, validating the transaction and broadcasting these encrypted transactions to the Subnet Hub.

Before relaying, the Relayer performs a series of validation checks to ensure the transaction meets all necessary criteria. One aspect of validation involves checking of cryptographic proofs to prevent fraud or double spend. Other validation checks include checking the transaction against governance rules that may have been imposed by the Subnet Governor, such as if the token to be sent has been frozen, or if the sending PL is indeed a member of the Subnet.

2. Privacy and Security

To protect the privacy of transactions, the Rayls Relayer ensures that private data is securely handled during the relay process. It uses encryption and other security measures to ensure that each transaction retains end-to-end privacy (all transaction data is encrypted) and anonymity (the sender and receiver details are hidden).

Note that both sending and receiving Rayls Privacy Nodes can decrypt the transaction using their Diffie-Hellman (DH) keys. Optionally, a copy of these DH keys may also be given to an Auditor of the network, so they can peek into encrypted transactions on the Subnet Hub. Full privacy and anonymity is preserved for all other members of the Private Subnet.

3. Error Handling and Recovery

Using the Rayls Protocol, all transactions within a Private Subnet are atomic, such that they either complete entirely or are reverted to their previous state.

In cases where a transaction relay fails or encounters an error, the Rayls Relayer includes robust error detection, handling and recovery mechanisms to ensure that the transaction is either retried or rolled back appropriately.


Architecture and Integration

1. Integration with Rayls Privacy Node Ledgers

A Rayls node Relayer is tightly integrated with a Rayls Privacy Node Ledger, acting as a dedicated two-way bridge between a Rayls Privacy Node and the Subent hub.

  • API Integration: The Relayer uses API endpoints to interact with the Rayls Privacy Node Ledger, ensuring seamless communication and transaction retrieval.
  • Event Monitoring: The Relayer continuously monitors events on the Rayls Privacy Node Ledger to detect when transactions are finalised and ready to be relayed.

2. Interaction with the Subnet Hub

The Relayer interacts with the Rayls Subnet Hub to broadcast encrypted transactions to the Subnet Hub ledger and uses cryptographic proofs to validate that cross-chain transactions can be marked as final.

  • Transaction Broadcasting: The Relayer uses secure communication channels to broadcast encrypted transactions to the Subnet Hub.
  • Commitment and Proof: The Relayer ensures that all transactions relayed to the Subnet Hub are accompanied by the necessary proofs and commitments, ensuring they meet the chain’s validation requirements.

3. Scalability and Performance

The Rayls Relayer is designed to handle high transaction volumes, ensuring that it can scale as the network grows. Its architecture supports parallel processing and efficient resource utilisation to maintain performance even under heavy loads.

  • Parallel Processing: The Relayer can process multiple transactions simultaneously, reducing latency and increasing throughput.
  • Resource Management: The Relayer efficiently manages system resources to maintain high performance and scalability.

Security and Compliance

1. Secure Relay Protocols

The Rayls Relayer uses advanced security protocols to ensure that all relayed transactions are protected from tampering or unauthorised access.

  • Encryption: All communication between the Relayer, Rayls Privacy Nodes, and the Subnet Hub is fully encrypted, end-to-end.
  • Authentication: The Relayer authenticates all parties involved in the transaction relay process to prevent unauthorised access.

2. Compliance with Governance Policies

The Rayls Relayer complies with the governance policies established within the Rayls ecosystem in general and specific governance rules enforced by the Governor of the Private Subnet. It ensures that all relayed transactions adhere to these policies, before they are executed, providing transparency and accountability.

  • Policy Enforcement: The Relayer enforces governance policies, ensuring that all transactions meet the required standards.
  • Audit Logs: The Relayer maintains detailed logs of all relayed transactions, which can be audited to ensure compliance with regulatory and governance requirements.

Conclusion

The Rayls Relayer is a powerful and essential component within a Rayls Private Subnet, enabling secure, scalable, and privacy-preserving transaction management between Rayls Privacy Nodes and the Subnet Hub.

By ensuring that all transactions are relayed, validated, and recorded with full integrity, the Relayer plays a critical role in maintaining the trust and reliability of the Rayls network.