Rayls Docs

Rayls Relayer

The primary purpose of the Rayls Relayer is to facilitate secure and efficient communication between a Privacy Ledger and a Rayls Commit Chain, 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 Privacy Ledger connects to a new Commit Chain, a dedicated Relayer is installed to orchestrate private cross-chain communication.


Key Objectives

Transaction Propagation: Securely and efficiently relay transactions between a Privacy Ledger and a Commit Chain.

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 Privacy Ledger and a Commit Chain. This involves retrieving transactions that have been finalised on a Privacy Ledger, validating the transaction and broadcasting these encrypted transactions to the Commit Chain.

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 Privacy Ledgers 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 Commit Chain. 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 Privacy Ledgers

A Rayls Relayer is tightly integrated with a Privacy Ledger, acting as a dedicated two-way bridge between a PL and the Commit Chain.

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

2. Interaction with the Commit Chain

The Relayer interacts with the Rayls Commit Chain to broadcast encrypted transactions to the Commit Chain 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 Commit Chain.
  • Commitment and Proof: The Relayer ensures that all transactions relayed to the Commit Chain 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, Privacy Ledgers, and the Commit Chain 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 Privacy Ledgers and the Commit Chain.

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.