# Semi-technical guide for withdrawing ETH from L2

By [ant](https://paragraph.com/@ant-2) · 2025-01-22

---

Hey this is ant. As a dev support, I have seen many users struggling to withdraw their funds from Unichain after they have deposited ETH based on a previous leak on RPC info. Even though the fact that the info is not coming from an official announcement thus users should DYOR before aping, still I understand at least some of them will need those money back asap instead of waiting for the mainnet bridge UI to launch.

Therefore I want to share a step-by-step technical guide I wrote to walk you through how you can initiate, prove, and finalize withdrawal from L2 like Unichain. In this guide I break down the steps from the [original guide](https://docs.unichain.org/docs/technical-information/submitting-transactions-from-l1) on the Unichain docs, so this is sort of an extended version of that guide but for semi-technical or (relatively) non-technical users.

But prepare yourself, this could still be a tough one...  
Just ping me on [X](https://x.com/0xdevant) in case you run into any issues.

Walkthrough on the technical guide
----------------------------------

### Step 1. [Initiating a withdrawal from L1](https://docs.unichain.org/docs/technical-information/submitting-transactions-from-l1#initiating-a-withdrawal-from-l1)

1.  Head to the [Etherscan](https://etherscan.io/address/0x0bd48f6b86a26d3a217d0fa6ffe2b491b956a7a2#writeProxyContract) of OptimismPortal2 => Write as Proxy => Connect to Web3 (with the wallet you used to send the funds) => find `depositTransaction (0xe9e05c42)`
    

For the params pass in the following:\*

    depositTransaction: (skip this field)
    _to: 0x4200000000000000000000000000000000000016
    _value: (the amount that you have bridged and want to withdraw from Unichain, use an ETH unit converter e.g. swiss-knife.xyz to help calculate the amount in *wei* by inputting the amount of *Ether* you want to withdraw)
    _gasLimit: 300000
    _isCreation: false
    _data: 0x
    

![\*How it will look like on Etherscan after passing in the parameters](https://storage.googleapis.com/papyrus_images/36fb39c482c060ffa58637fd40f29cbaaee463e4df63e532a963482b722a2108.png)

\\\*How it will look like on Etherscan after passing in the parameters

Click on `Write` and submit the transaction

\============================================================

### Step 2. After your deposit has landed on L1, find your L2 transaction hash

1.  Go to the [Unichain chaineye explorer](https://unichainexplorer.chaineye.tools/)
    
2.  Search in the explorer by typing the wallet address you use to bridge from Ethereum mainnet to Unichain in the first place i.e. the one you used to submit the tx in Step 1
    
3.  Locate the transaction hash\* that involves transferring your ETH from Ethereum mainnet to Unichain via the Message Passer Proxy contract `0x4200000000000000000000000000000000000016`, this is [one](https://unichainexplorer.chaineye.tools/tx/0xa6028dc34c9dce65e28e780243d27717f030f5df5f91a95e72b219336f94afe3) of the examples.
    

So from this example we will pass in `0xa6028dc34c9dce65e28e780243d27717f030f5df5f91a95e72b219336f94afe3` as the `L2_TX_HASH` for Step 3 and 4 later.

![\*The transaction will be similar to this in your transaction history](https://storage.googleapis.com/papyrus_images/ec16f496022a86823ff20418755f5c6189fde6668c833112b210a4550932f3f1.png)

\\\*The transaction will be similar to this in your transaction history

\============================================================

### Step 3. [Relaying the Withdrawal from L2 to L1](https://docs.unichain.org/docs/technical-information/submitting-transactions-from-l1#relaying-the-withdrawal-from-l2-to-l1)

This step initiates your withdrawal on L1. This step requires a proposer to have proposed an output which includes your withdrawal. **Proposals occur about once every hour.**

> _You should already have_ -  
> a. The L2 transaction hash you found from the explorer in Step 2  
> b. [git](https://git-scm.com/downloads/mac) downloaded in a Mac  
> c. [golang](https://go.dev/dl/) downloaded in a Mac  
> d. little ETH for gas in your wallet on L1

> “Run” in below means typing what’s inside the code block - e.g. `cd ~/Desktop` in the terminal and then click “Enter”. If it went through you should enter a new line in the terminal!

1.  Open your terminal, run `cd ~/Desktop` to set the current directory to Desktop
    
2.  Run `git clone https://github.com/base-org/withdrawer.git` to download the project in your Desktop or download directly from their [repository](https://github.com/base-org/withdrawer)\*
    
3.  Run `cd withdrawer`
    
4.  Run `export L2_TX_HASH=PASTE_YOUR_L2_TRANSACTION_HASH_HERE` (replace your actual tx hash with `PASTE_YOUR_L2_TRANSACTION_HASH_HERE`)
    
5.  Run `export PK=PASTE_YOUR_L1_PRIVATE_KEY` (replace `PASTE_YOUR_L1_PRIVATE_KEY` with your actual Private Key and remove the leading `0x` - and pls don't expose your PK to anyone please!)
    
6.  Run `go run main.go --withdrawal $L2_TX_HASH --rpc=https://eth.merkle.io --fault-proofs --l2-rpc=https://mainnet-readonly.unichain.org --portal-address=0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2 --dfg-address=0x2F12d621a16e2d3285929C9996f478508951dFe4 --private-key=$PK --network=op-mainnet`
    

> _Note: this can be called from any L1 address, it does not have to be the same address that initiated the withdrawal on the L2._

![\*In case you can't do \`git clone\` for some reason, you can still go to their github repo directly to download the ZIP and put it in Desktop](https://storage.googleapis.com/papyrus_images/6b5d2ef8d2e243d449fd74433d1c4f3bac6d09f9005574020a65f5cd83c13b93.png)

\\\*In case you can't do \\\`git clone\\\` for some reason, you can still go to their github repo directly to download the ZIP and put it in Desktop

\============================================================

### Step 4. [Finalizing the L1 Withdrawal](https://docs.unichain.org/docs/technical-information/submitting-transactions-from-l1#relaying-the-withdrawal-from-l2-to-l1)

**After 7 days**, run the withdrawer command again to finalize the withdrawal.

> Users are required to wait for a period of seven days when moving assets out of L2 into the Ethereum mainnet. This period of time is called the Challenge Period and serves to help secure the assets stored on L2.

*   Open your terminal, go to the path where you downloaded the `withdrawer` project on Step 3(usually run `cd ~/Desktop` if you follow along) and run `cd withdrawer`
    

> For the following they are basically the same steps as (4) - (6) in Step 3 above

1.  Run `export L2_TX_HASH=PASTE_YOUR_L2_TRANSACTION_HASH_HERE` (replace your actual tx hash with `PASTE_YOUR_L2_TRANSACTION_HASH_HERE`)
    
2.  Run `export PK=PASTE_YOUR_L1_PRIVATE_KEY` (replace `PASTE_YOUR_L1_PRIVATE_KEY` with your actual Private Key and remove the leading `0x` - and don't expose your PK to anyone please!)
    
3.  (Same command as (6) in Step 3) Run `go run main.go --withdrawal $L2_TX_HASH --rpc=https://eth.merkle.io --fault-proofs --l2-rpc=https://mainnet-readonly.unichain.org --portal-address=0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2 --dfg-address=0x2F12d621a16e2d3285929C9996f478508951dFe4 --private-key=$PK --network=op-mainnet`
    

> _Note: this can be called from any L1 address, it does not have to be the same address that initiated the withdrawal on the L2._

You should now have the ETH withdrawn back to Ethereum mainnet after the withdrawal is finalized.

\============================================================

Conclusion
----------

In this guide we have learnt how to initiate a withdrawal via Optimism’s [message passing contract](https://etherscan.io/address/0x0bd48f6b86a26d3a217d0fa6ffe2b491b956a7a2), and utilize the [scripts](https://github.com/base-org/withdrawer) from Base to help prove and finalize our withdrawal from OP stack based chains.

If you notice you will see that actually you can reference this guide to basically withdraw from any L2s which are built on OP stack by replacing with the right context(e.g. the explorer for finding the L2 tx hash, the L2 RPC etc)!

As [Unichain](https://www.unichain.org/) is approaching the mainnet launch I definitely encourage you to keep an eye on their exciting features such as [250ms “Flashblocks”](https://writings.flashbots.net/introducing-rollup-boost) and their Decentralized Validation Network. Dive into their [whitepaper](https://docs.unichain.org/whitepaper.pdf) as well if you are feeling technical👀

Maybe you will want to deposit even more ETH to Unichain after reading that xD

Last but not least again if you run into any issues during the steps, or if you found anything that you think should be updated in this guide to make it easier for everyone to understand, definitely let me know by pinging me on [X](https://x.com/0xdevant).

Feel free to mint this guide or subscribe to my blog for more technical sharing or my thoughts on crypto(if I will even do any lol) :p

🐜

---

*Originally published on [ant](https://paragraph.com/@ant-2/semi-technical-guide-for-withdrawing-eth-from-l2)*
