Deposit and Withdrawal
Last updated
Last updated
The deposit flow in SOON Mainnet involves several steps to ensure secure and efficient handling of user assets. Here is an illustration of the process:
L1 User Contract: Initiates the deposit transaction.
L1CrossDomainMessenger: Sends the deposit message to the SoonPortal.
SoonPortal: Processes the deposit transaction and generates a TransactionDeposited
event.
L2CrossDomainMessenger: Relays the deposit message to the L2 network.
L2 User Contract: Receives the deposit transaction.
This flow ensures that the asset transfer from L1 to L2 is seamless and secure, leveraging cross-domain messaging protocols to facilitate efficient communication between the layers.
The withdrawal sequence is crucial for securely moving assets from L2 back to L1. The process involves multiple stages, as depicted below:
Stage 1: The user initiates a withdrawal transaction on L2. The transaction is batched and sent to the data availability provider (Celestia). The new output root is polled, and the L2 output root hash is generated.
Stage 2: The L2 output root hash is proposed to the L1 (Ethereum). Withdrawal data and proof are generated, and the L2OutputOracle
verifies the proof.
Stage 3: The withdrawal is finalized on L1, and the assets are transferred to the user’s L1 address.