Send Cross Private Network Arbitrary Messages
Cross Private Network arbitrary messages give secure message delivery between institutions running Rayls Sovereign. Institutions can send messages, updates and notifications to each other, which keeps their systems in step without moving any asset.
The capability is built for applications that operate across more than one chain. It keeps separate deployments of the same application in step and lets data move between them, whether that data is a notification, a setting change or an update. Without it, applications sit isolated on their own chains; with it, they behave as one system regardless of where each part runs.
This capability supports:
- Broadcasting messages, for the cases where a message needs to reach several or all chains at once;
- Sending multiple messages at once, where one transaction needs to carry several pieces of information to several destination chains;
- Performing at scale, sending up to 60 messages in a row.
How to use
To send messages, interact with the ArbitraryMessage smart contract on Chain A using one of its messaging functions. Each function covers a different case, depending on how many messages you are sending and to whom.
Every one of these calls follows the same path. The contract dispatches through the endpoint in the sending institution's ledger, the Relayer encrypts the payload and submits it to the Private Network Hub, and the receiving institution's Relayer collects it from the Hub and executes it in that institution's ledger. The Hub routes the message without being able to read it.
- Send a Single Message to One Chain
Scenario:
Send one simple message from Chain A to Chain B.
const tx = await arbitraryMessageA.connect(signerA).send1Message(messageA, chainIdB, { gasLimit: 5000000 });
Outcome:
Chain B receives the message. Use this when you need to update or notify a single chain.
- Send Three Messages in One Transaction (to the Same Chain)
Scenario:
Send three distinct messages all at once to the same chain.
const tx = await arbitraryMessageA.connect(signerA).send3Messages(messageB, messageC, messageD, chainIdB, { gasLimit: 5000000 });
Outcome:
Chain B receives all three messages. Use this for grouped updates, such as multiple settings or fields.
- Send Three Different Messages in One Transaction (to Different Chains)
Scenario:
Send one message each to three different chains.
const tx = await arbitraryMessageA.connect(signerA).send3MessagesToDifferentChainIds(messageB, messageC, messageD, chainIdB, chainIdC, chainIdD, { gasLimit: 5000000 });
Outcome:
Each selected chain receives its own message. Use this when different chains each need a different piece of information.
- Send the Same Message to Multiple Chains
Scenario:
Send one message to a chosen set of chains.
const tx = await arbitraryMessageA.connect(signerA).sendToMultipleParticipants(messageForMultiple, chainIds, { gasLimit: 5000000 });
Outcome:
Every selected chain receives the message. Use this for targeted updates, where a defined group needs to know and the rest of the network does not.
- Send the Same Message to All Chains
Scenario:
Broadcast a single message to every connected chain.
const tx = await arbitraryMessageA.connect(signerA).sendToAllParticipants(messageForAll, { gasLimit: 5000000 });
Outcome:
Every participant connected to the Rayls Private Network receives the message. Use this for network-wide announcements.
Updated 18 days ago
