How to bridge from child chain to parent chain
This guide explains how to programmatically send messages and withdraw assets from an Arbitrum child chain to a parent chain (such as Ethereum). For conceptual information about the messaging protocol, see Child-to-parent chain messaging.
Prerequisites
- A child chain wallet with funds
- Access to parent chain infrastructure (for executing the final step)
- Awareness that child-to-parent messages require 6.4 days to finalize
Overview of the process
Child-to-parent chain messaging follows these steps:
- Send message on child chain: Call
ArbSys.sendTxToL1to initiate the message - Wait for finalization: The message enters a 6.4-day Challenge Period
- Execute on parent chain: After finalization, call
Outbox.executeTransactionto complete the transfer
Sending a message from the child to the parent chain
To send a message from the child chain to the parent chain, use the ArbSys precompile's sendTxToL1 method:
function sendTxToL1(
address destination,
bytes calldata data
) external payable returns (uint256)
Parameters
destination: The parent chain address that will receive the messagedata: Calldata to send to the destination address on the parent chain
Return value
Returns a unique identifier for the message, used to track its status and construct the outbox proof for execution.
The ArbSys precompile is located at address 0x0000000000000000000000000000000000000064.
Example: Sending a simple message
const arbSys = new ethers.Contract('0x0000000000000000000000000000000000000064', arbSysABI, childChainSigner);
const tx = await arbSys.sendTxToL1(parentChainDestination, ethers.utils.toUtf8Bytes('Hello from L2!'));
const receipt = await tx.wait();
Executing the message on the parent chain
After the 6.4-day challenge period, you can execute the message on the parent chain.