> ## Documentation Index
> Fetch the complete documentation index at: https://initialabs-develop.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Transfers

## Token Deposits

The token deposit process begins when a user submits a deposit transaction on the Initia L1 chain. Once the transaction is confirmed, the Bridge Executor retrieves the latest block data (including the deposit) from the L1 node. It then submits a message to the rollup node to finalize the deposit. After the L2 node confirms the finalized deposit, it mints the corresponding opINIT tokens on the specified rollup.

### Deposit Sequence

```mermaid theme={null}
sequenceDiagram
    participant User
    participant IL1 as Initia L1
    participant OPH as OPhost Module
    participant OPB as OPinit Bot
    participant OPC as OPchild Module
    participant R as Rollup

    User->>IL1: Initiate token deposit
    IL1->>OPH: Process deposit
    OPH->>OPB: Emit deposit event
    OPB->>OPB: Process deposit event
    OPB->>OPC: Relay deposit transaction
    OPC->>R: Finalize deposit
    R->>R: Mint tokens to user on L2
```

## Token Withdrawals

The token withdrawal process begins when a user submits a withdrawal transaction on the rollup. Once the transaction is confirmed, the Bridge Executor retrieves the latest block data (including the withdrawal) from the L2 node. It then submits a message to the Initia L1 node to finalize the withdrawal. After the L1 node confirms the finalized withdrawal, it burns the corresponding opINIT tokens on the specified rollup.

The withdrawal then enters a withdrawal period during which the transaction can be challenged and potentially canceled. If no challenge is submitted by the end of this period, the user can claim the withdrawal on Initia L1.

### Withdrawal Sequence

```mermaid theme={null}
sequenceDiagram
    participant User
    participant R as Rollup
    participant OPC as OPchild Module
    participant OPB as OPinit Bot
    participant OPH as OPhost Module
    participant IL1 as Initia L1

    User->>R: Initiate token withdrawal
    R->>OPC: Process withdrawal request
    OPC->>OPC: Lock tokens and emit event
    OPC->>OPB: Notify of withdrawal event
    OPB->>OPB: Update Merkle tree
    OPB->>OPH: Submit updated L2 output root
    OPH->>IL1: Store L2 output root
    Note over OPB,IL1: Wait for finalization period
    User->>OPB: Request withdrawal proof
    OPB->>OPB: Generate Merkle proof
    OPB->>User: Provide withdrawal proof
    User->>IL1: Submit proof & finalize withdrawal
    IL1->>OPH: Verify proof
    OPH->>IL1: Approve token release
    IL1->>User: Transfer withdrawn tokens
```

The withdrawal period is designed to allow for a challenge period during which any malicious activity can be detected and addressed. If a challenge is submitted, the withdrawal is canceled. If no challenge is submitted, the transaction is finalized and the tokens are released to the user on Initia L1.
