xhavic.com
GitHub (Coming Soon) Whitepaper
Docs / Bridging

Withdrawals (L2 → L1)

How to withdraw assets from Xhavic back to Ethereum — standard 7-day and fast exit options.

Withdrawals move assets from Xhavic (L2) back to Ethereum (L1). There are two withdrawal paths: a standard 7-day withdrawal and a fast exit via liquidity providers.

Standard Withdrawal (7-day)

The standard withdrawal follows the optimistic rollup security model:

  1. Initiate on L2 — Call the withdrawal contract on Xhavic. Your L2 tokens are burned.
  2. Wait for batch posting — The sequencer includes your withdrawal in the next batch posted to L1 (~1-5 minutes)
  3. Generate proof — After the batch is posted, generate a Merkle inclusion proof using xhv_getWithdrawalProof
  4. Wait for challenge period — 7-day window for fraud proofs
  5. Execute on L1 — After the challenge period, claim your assets on Ethereum

Timeline

StepDuration
Initiate withdrawalInstant
Batch posting to L11-5 minutes
Challenge period7 days
L1 claim transaction~5 minutes
Total~7 days

Code Example

// Step 1: Initiate withdrawal on L2
l2Bridge.withdraw(
    l2TokenAddress,
    amount,
    100_000,     // L1 gas limit
    bytes("")    // optional data
);
// Step 2: Generate proof (after batch is posted)
const proof = await provider.send('xhv_getWithdrawalProof', [txHash]);

// Step 3: Execute on L1 (after 7-day challenge period)
l1Bridge.finalizeWithdrawal(
    proof.batchIndex,
    proof.merkleProof,
    proof.withdrawalData
);

Fast Exit (via Liquidity Provider)

For users who need immediate L1 liquidity:

  1. Initiate withdrawal on L2 — Same as standard withdrawal
  2. LP fulfillment — A liquidity provider pays you on L1 immediately (minus a fee)
  3. LP claim — The LP waits for the 7-day period and claims the standard withdrawal

Fast Exit Parameters

ParameterValue
Settlement time< 10 minutes
LP fee0.1% - 0.3% (market-driven)
Minimum amountVaries by LP
AvailabilitySubject to LP liquidity

Note: Fast exits rely on third-party liquidity providers. The Xhavic protocol does not guarantee LP availability or fees.

Withdrawal Status

StatusMeaning
InitiatedTokens burned on L2, waiting for batch
ProvenMerkle proof generated, challenge period started
ChallengedA fraud proof has been submitted (rare)
ReadyChallenge period passed, ready to claim
FinalizedAssets claimed on L1