# Depositing and Withdrawing Assets

Where is my money?

If you are not sure what is happening with your withdrawal, search for the transaction hash here (opens new window), the withdrawal might still be in the validity proof period. Alternatively, you might just need to finalize the transaction.

The easiest way to move assets between Layer 1 and Layer 2 is to use the Optimism Gateway (opens new window). You can make use of this gateway on any of our networks. Click here for a list of our networks and connection details.

Note that in Optimistic Ethereum there is no ETH as we know it. Instead, gas costs are charged using a wrapped ETH ERC-20 token. When you deposit ETH into Optimistic Ethereum, those ERC-20 tokens are what you get on L2.

# Which Assets?

We have a list of supported ERC-20 tokens (opens new window), but you are not limited to them, you can select any token that exists on both L1 and L2 (opens new window).

# Depositing into L2

First we'll go over the basics of transferring tokens for L1 into L2. We'll be depositing ETH in this tutorial, but you can also deposit any token supported on the Gateway frontend. This tutorial uses MetaMask (opens new window). Your experience may vary if using a different wallet provider.

  1. We'll be using the Kovan testnet during this tutorial. Make sure you're connected to the Kovan testnet before you continue:
select the kovan network
  1. You'll also need some Kovan ETH (KETH). If you don't already have Kovan ETH, try using this Kovan ETH faucet (opens new window). Alternatively, you can try asking someone for Kovan ETH on the Optimism discord server (opens new window).

  2. Once you're connected to Kovan and you have some KETH, head over to gateway.optimism.io (opens new window). You'll be greeted with a disclaimer that contains some important information. Please read this disclaimer carefully. We also highly recommend reading through our FAQs to get a better basic understanding of the Optimistic Ethereum system. Whenever you're ready, click CONNECT.

read the disclaimer
  1. You'll now be asked to connect your wallet to the Gateway app. Select the MetaMask option:
select your wallet
  1. You should now see a popup asking you to connect your wallet to the website. Select the account you'd like to use and click Next continue.
accept the metamask popup
  1. Now you'll see a "deposit" page where you can input some amount of Kovan ETH to transfer from Layer 1 to Layer 2. You can also click on the ETH dropdown to deposit other supported tokens but for this tutorial we'll stick with ETH. Input a small amount of Kovan ETH and click DEPOSIT.
input KETH and click deposit
  1. You'll be given another chance to review your transaction. Click DEPOSIT again.
read disclaimer and click deposit
  1. You'll be presented with a transaction to sign. Go ahead and sign it by clicking Confirm.
accept metamask transaction
  1. Now you just need to wait a minute for your transaction to be processed! When moving assets from Layer 1 to Layer 2, you'll first have to wait for the transaction to be confirmed on Layer 1. This should only take about a minute. You'll also be showered with confetti once your transaction is confirmed. 🎉🎉🎉
wait for transaction to be processed
  1. Your deposit is officially finalized on Kovan! Head back to the previous page to check your balance:
go back to last page
  1. Assuming everything went according to plan, you should now have a balance on the Optimistic Kovan testnet:
view layer 2 balance

Congrats! You just made your first deposit. Next we'll look at the process of moving tokens back to Layer 1.

# Withdrawing back to L1

After you've deposited some tokens into L2, you might want to try withdrawing those tokens back to L1. This tutorial will show you how to perform the full withdrawal process. Please make sure you've already completed the previous tutorial about depositing into L2 before you continue. As in the previous tutorial, we'll be using MetaMask connected to the Kovan testnet.

  1. First, head over to gateway.optimism.io (opens new window).
  2. Click on the Withdraw button on the main page in order to switch into withdrawal mode:
click the withdraw button
  1. You'll be greeted with a popup asking you to switch over to the Optimistic Kovan test network. Accept this popup by clicking on the Switch network button:
accept the network switch popup
  1. Next, input some amount of ETH to transfer back to L1 and click WITHDRAW:
input an amount and trigger the withdrawal
  1. You'll now be presented with another disclaimer. Please ready this disclaimer carefully. It includes information about the cost to finalize your withdrawal on L1 and the required waiting period before you can claim your withdrawal on L1. Note that the Optimistic Kovan testnet has a waiting period of only 60 seconds to speed up the testing process. Once you're ready, click the WITHDRAW button to trigger your withdrawal:
trigger the withdrawal

On withdrawal times

While communication from Layer 1 to Layer 2 only takes a few minutes, communication from Layer 2 to Layer 1 on the Optimistic Ethereum mainnet takes about a week. This is a security measure that leaves enough time for invalid transaction results to be caught and reverted before they become "finalized." This means that you must wait one week before you can claim a withdrawal on the Optimistic Ethereum mainnet.

  1. Accept the transaction in MetaMask:
accept the withdrawal in metamask

# When is the Withdrawal Ready?

  1. During the challenge period there are several ways to check on your withdrawal:

    • Use the gateway (opens new window) to see a list of withdrawals and deposits.

      Check on the withdrawal in the gateway
    • Use Etherscan (opens new window) to view the L2 transaction (identified by its hash). and once it is recorded in L1 click the L1 State Root Submission Tx Hash:

      Look at the L2 transaction

      The challenge period starts at the timestamp of the L1 state root transaction. On Optimistic Ethereum you can withdraw once seven days have passed from that timestamp.

      Look at the L1 transaction

# Finalizing the withdrawal

  1. After the waiting period has passed, you'll need to submit a second transaction on L1 to complete your withdrawal. You should now see a screen that displays the date and time when your withdrawal can be completed. Since we're on Kovan, this should only be a minute from the time when you started the withdrawal on L2:
see when the withdrawal can be completed
  1. Click on your address in the top right corner of your screen to see the status of your withdrawal:
click on your address
  1. You should be presented with a list of withdrawals that you've made. Now you simply need to wait for the withdrawal challenge period to elapse! On the Optimistic Kovan testnet this withdrawal period is only 60 seconds. Feel free grab a drink or go to the bathroom or something while you wait. Click on your withdrawal once the status symbol turns yellow:
see yellow status symbol
  1. Assuming you've waited 60 seconds or more, you can now claim your withdrawal on L1. Click the button that says CLAIM WITHDRAWAL:
go to etherscan to claim withdrawal
  1. You'll be brought to a page on Etherscan that looks something like the following. Note that the status of your withdrawal is Ready for relay:
view the withdrawal claim page on etherscan
  1. Since you'll be claiming this withdrawal on L1 (Kovan) you'll need switch back to the Kovan test network in MetaMask before you can continue:
switch back to Kovan
  1. Once you've switched back to Kovan, click the Execute button on the Etherscan page:
click the execute button on Etherscan
  1. Accept the confirmation popup:
accept the confirmation popup
  1. After a few seconds you'll be asked to sign a final transaction in MetaMask:
accept the last transaction in metamask
  1. Wait for the transaction to be confirmed on Kovan, then refresh the page. If you see that the message is now Relayed, then your withdrawal was successful:
check withdrawal was relayed correctly
  1. You can also confirm that your withdrawal was completed by going back to gateway.optimism.io (opens new window) and confirming that your L2 balance has decreased and your L1 balance has increased:
check your balance again

Congrats! You've now completed a deposit and a withdrawal. You're an Optimistic Ethereum pro.

Still confused?

We hope this tutorial was helpful ❤️. If you're still confused by something, we'd love to hear how we can make this tutorial better. Please always feel free to leave feedback by creating an issue on GitHub (opens new window). We read through our issues almost every day and try to fix issues within a week.