Step 1
The client implements a smart contract using an abstract class from Asterizm and deploys it to the required networks.
The _initAsterizmTransferEvent() method is used to initiate a cross-chain transaction on the contract. The data and parameters of the cross-chain transaction are transmitted to it.
The transaction can contain arbitrary information and one or multiple actions (instructions) to be performed on the destination networks.
Step 2
The client smart contract sends the received data and hash based on the payload generated at that moment xID, source chain id, destination chain id, client smart contract address in the source and destination chains.
Note: At this step, the key parameters are formed, which will further ensure the security of the cross-chain transaction, namely to confirm its validity and integrity in the destination chain.
Step 3
The Client off-chain module encrypts the cross-chain transaction contents and sends it back to the client’s smart contract in the source initializer network, calling the cross-chain transfer initialization method initAsterizmTransfer().
Step 4
Before sending the encrypted data received from the client off-chain module to the Initializer smart contract, the Client smart contract checks the received data using hash matching, thus preventing spam and spoofed transactions.
Note: This step verifies that this exact transaction was initiated on the client's smart contract, which eliminates the possibility of spam from the client's off-chain module.
Step 5
The Initializer smart contract checks the transaction nonce to preserve the cross-chain transaction execution sequence and transmits the encrypted data with the unique parameters to the Transmitter smart contract.
Note: When a data packet is received on the Initializer smart contract, the client is identified based on the destination chain id, the Client smart contract address in the destination chain, and the client smart contract address in the source chain. After the client (sender) of the cross-chain transaction is determined, the nonce value is incremented for it.
Step 6
Asterizm Relayer servers pull the encrypted data with the parameters from the Translator contract and send it to the Translator smart contract in the destination network for further processing.
Step 7
The Translator smart contract on the destination network accepts the encrypted data with the parameters from the Relayers and passes it to the Initializer smart contract for validation.
Step 8
After receiving the encrypted data and the parameters, the Initializer smart contract checks the nonce to comply with the transaction sequence, stores the transaction xID to validate the transaction at step 10, and transmits the data to the client’s smart contract.
Step 9
The client’s smart contract in the destination network receives the encrypted data with the parameters, creates an event, and transmits the data to the client’s off-chain module for verification and decryption.
Note: This is where the first step of cross-chain transaction validation is performed by matching the hash from the decrypted data, original data and xID generated in the source network at the transaction initialization, and by checking the source network and address. The client’s server verifies that the data is complete and consistent, thus eliminating the risk of compromise at the Relayer server level.
Step 10
After data verification and decryption, the client’s server initiates the transaction on the client smart contract by calling the asterizmClReceive() method in the destination network, sending the decrypted data and xID to the contract, and validating the transaction on the Initializer smart contract by checking the hash.
Note: At this step, the integrity of the data and the trusted addresses is checked before the transaction is executed. This check eliminates the risk of hacking the client’s server.
Deep tech: The verification is performed by checking the hash from the decrypted data and the xID that was previously stored on the Initializer contract. If the verification succeeds, it means that the client’s contract executes exactly the transaction it sent, and does so for the first time. This algorithm eliminates the possibility of spamming transactions and spoofing data on the client’s server (if, for example, the server is compromised).
Step 11
After receiving the confirmation of the validity and integrity of the cross-chain transaction, the client’s smart contract executes the instructions or data sent in the cross-chain transaction, calling methods of other contracts or performing calculations on the client’s contract. The logic of this step depends solely on the client’s business logic implemented in the cross-chain transaction.