Safenet Transaction
This page describes the flow of a Safenet transaction. The Core Components section provides further details on the components and roles involved in a Safenet transaction.
A Safenet transaction consists of three main phases:
1. Simulation
In the first phase, security checks are performed off-chain to ensure the transaction is valid.
- The processor previews security checks.
- The End User signs the transactions. This involves signing a Safe transaction with enough Safe owners.
- The transaction is published to Safenet Transaction pool.
2. Fulfillment
This is the main part of the transaction that the user is interested in. This part enables the users to send a transaction on the spend chain as if they possess the required funds on the spend chain.
- A resource lock is issued on the Safe Smart Account on the debit chain. This prevents the user from withdrawing funds from the Safe Smart Account on the debit chain before the liquidity provider is reimbursed.
- The liquidity provider sends funds to the user's Safe Smart Account on the spend chain (pre-funding).
- The user's Smart Account executes the intended transaction on the spend chain with the funds.
3. The settlement
In the last phase, the settlement is executed on the debit chain. This phase ensures the liquidity provider gets reimbursed for the pre-funding plus a fee.
- The processor requests a settlement on the debit chain.
- The settlement request has a challenge delay, in which any validator can challenge the settlement request.
- When the settlement is not challenged, the settlement is executed. The liquidity provider receives funds from the Safe Smart Account on the debit chain, and the Safe Smart Account is unlocked.
When the settlement is challenged, the processors must prove the validity of the transaction.
Flow Diagram
This flow diagram illustrates the first two phases of a Safenet transaction: