{"id":25393723,"url":"https://github.com/base/withdrawer","last_synced_at":"2025-05-15T10:00:52.465Z","repository":{"id":184821453,"uuid":"672428509","full_name":"base/withdrawer","owner":"base","description":"Golang utility for proving and finalizing withdrawals from op-stack chains.","archived":false,"fork":false,"pushed_at":"2025-02-11T09:00:06.000Z","size":75,"stargazers_count":441,"open_issues_count":6,"forks_count":277,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-05-08T09:43:41.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/base.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-30T03:49:44.000Z","updated_at":"2025-05-05T14:33:36.000Z","dependencies_parsed_at":"2023-07-30T13:25:53.681Z","dependency_job_id":"944a223c-bcac-40ac-acd0-114ed34fc281","html_url":"https://github.com/base/withdrawer","commit_stats":null,"previous_names":["base-org/withdrawer","base/withdrawer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fwithdrawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fwithdrawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fwithdrawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fwithdrawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/base","download_url":"https://codeload.github.com/base/withdrawer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319715,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-15T18:11:37.114Z","updated_at":"2025-05-15T10:00:51.793Z","avatar_url":"https://github.com/base.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# withdrawer\n\nGolang utility for proving and finalizing ETH withdrawals from op-stack chains.\n\n\u003c!-- Badge row 1 - status --\u003e\n\n[![GitHub contributors](https://img.shields.io/github/contributors/base/withdrawer)](https://github.com/base/withdrawer/graphs/contributors)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/w/base/withdrawer)](https://github.com/base/withdrawer/graphs/commit-activity)\n[![GitHub Stars](https://img.shields.io/github/stars/base/withdrawer.svg)](https://github.com/base/withdrawer/stargazers)\n![GitHub repo size](https://img.shields.io/github/repo-size/base/withdrawer)\n[![GitHub](https://img.shields.io/github/license/base/withdrawer?color=blue)](https://github.com/base/withdrawer/blob/main/LICENSE)\n\n\u003c!-- Badge row 2 - links and profiles --\u003e\n\n[![Website base.org](https://img.shields.io/website-up-down-green-red/https/base.org.svg)](https://base.org)\n[![Blog](https://img.shields.io/badge/blog-up-green)](https://base.mirror.xyz/)\n[![Docs](https://img.shields.io/badge/docs-up-green)](https://docs.base.org/)\n[![Discord](https://img.shields.io/discord/1067165013397213286?label=discord)](https://base.org/discord)\n[![Twitter BuildOnBase](https://img.shields.io/twitter/follow/BuildOnBase?style=social)](https://x.com/BuildOnBase)\n\n\u003c!-- Badge row 3 - detailed status --\u003e\n\n[![GitHub pull requests by-label](https://img.shields.io/github/issues-pr-raw/base/withdrawer)](https://github.com/base/withdrawer/pulls)\n[![GitHub Issues](https://img.shields.io/github/issues-raw/base/withdrawer.svg)](https://github.com/base/withdrawer/issues)\n\n## Installation\n\n```\ngit clone https://github.com/base/withdrawer.git\ncd withdrawer\ngo install .\n```\n\n## Usage\n\n\u003e [!CAUTION]\n\u003e Do not send ERC-20 or other tokens to the L2StandardBridge, only native ETH is supported.\n\n### Without Fault Proofs\n\n#### Step 1\n\nInitiate a withdrawal on L2 by sending ETH to the `L2StandardBridge` contract at `0x4200000000000000000000000000000000000010`, and note the tx hash.\nExample on Base Sepolia: [0x5e47346867cf87d8e8c82cae1d30a94b8d5587dc9d354aef5c5a7b4c84ad9463](https://sepolia.basescan.org/tx/0x5e47346867cf87d8e8c82cae1d30a94b8d5587dc9d354aef5c5a7b4c84ad9463).\n\n\u003e [!NOTE]\n\u003e Users are required to wait for a period of seven days when moving assets out of Base mainnet into the Ethereum mainnet. This period of time is called the Challenge Period and serves to help secure the assets stored on Base mainnet.\n\n#### Step 2\n\nProve your withdrawal:\n\n```\nwithdrawer --network base-mainnet --withdrawal \u003cwithdrawal tx hash\u003e --rpc \u003cL1 RPC URL\u003e --private-key \u003cL1 private key\u003e\n```\n\nor use a ledger:\n\n```\nwithdrawer --network base-mainnet --withdrawal \u003cwithdrawal tx hash\u003e --rpc \u003cL1 RPC URL\u003e --ledger\n```\n\nExample output:\n\n```\nProved withdrawal for 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13: 0x6b6d1cc45b6601a30646847f638847feb629221ee71bbe6a3de7e6d0fbfe8fad\nwaiting for tx confirmation\n0x6b6d1cc45b6601a30646847f638847feb629221ee71bbe6a3de7e6d0fbfe8fad confirmed\n```\n\n_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._\n\n#### Step 3\n\nAfter the finalization period, finalize your withdrawal (same command as above):\n\n```\nwithdrawer --network base-mainnet --withdrawal \u003cwithdrawal tx hash\u003e --rpc \u003cL1 RPC URL\u003e --private-key \u003cL1 private key\u003e\n```\n\nExample output:\n\n```\nCompleted withdrawal for 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13: 0x1c457f1992f48f1f959ceaee5b3c7e699a26f6f05d93997d49dafe703fd66dea\nwaiting for tx confirmation\n0x1c457f1992f48f1f959ceaee5b3c7e699a26f6f05d93997d49dafe703fd66dea confirmed\n```\n\n_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._\n\n### With Fault Proofs\n\n\u003e [!NOTE]\n\u003e With the recent fault proofs upgrade for Base on Sepolia testnet, withdrawals are required to wait for a period of seven days. This mirrors the Challenge Period that exists for Base mainnet. Additionally, withdrawals are required to be finalized against dispute games that resolve in favor of the output root claim. If the dispute game is blacklisted, resolves against the output root claim (challenger wins), or the respected game type is changed, then the withdrawal will need to be re-proven.\n\n#### Step 1\n\nInitiate a withdrawal on L2 by sending ETH to the `L2StandardBridge` contract at `0x4200000000000000000000000000000000000010`, and note the tx hash.\nExample on Base Sepolia: [0x5e47346867cf87d8e8c82cae1d30a94b8d5587dc9d354aef5c5a7b4c84ad9463](https://sepolia.basescan.org/tx/0x5e47346867cf87d8e8c82cae1d30a94b8d5587dc9d354aef5c5a7b4c84ad9463).\n\n#### Step 2\n\nProve your withdrawal:\n\n```\nwithdrawer --network base-mainnet --withdrawal \u003cwithdrawal tx hash\u003e --rpc \u003cL1 RPC URL\u003e --private-key \u003cL1 private key\u003e --fault-proofs\n```\n\nor use a ledger:\n\n```\nwithdrawer --network base-mainnet --withdrawal \u003cwithdrawal tx hash\u003e --rpc \u003cL1 RPC URL\u003e --ledger --fault-proofs\n```\n\nExample output:\n\n```\nProved withdrawal for 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13: 0x6b6d1cc45b6601a30646847f638847feb629221ee71bbe6a3de7e6d0fbfe8fad\nwaiting for tx confirmation\n0x6b6d1cc45b6601a30646847f638847feb629221ee71bbe6a3de7e6d0fbfe8fad confirmed\n```\n\n_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._\n\n#### Step 3\n\n\u003e [!IMPORTANT]\n\u003e Unlike the non fault proof withdrawal flow, you MUST use the same address that proved the withdrawal to finalize the withdrawal.\n\nAfter the dispute game has resolved in favor of the root claim AND the finalization period has elapsed, finalize your withdrawal (same command as above):\n\n```\nwithdrawer --network base-mainnet --withdrawal \u003cwithdrawal tx hash\u003e --rpc \u003cL1 RPC URL\u003e --private-key \u003cL1 private key\u003e --fault-proofs\n```\n\nExample output:\n\n```\nCompleted withdrawal for 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13: 0x1c457f1992f48f1f959ceaee5b3c7e699a26f6f05d93997d49dafe703fd66dea\nwaiting for tx confirmation\n0x1c457f1992f48f1f959ceaee5b3c7e699a26f6f05d93997d49dafe703fd66dea confirmed\n```\n\n## Flags\n\n```\nUsage of withdrawer:\n    -rpc string\n        Ethereum L1 RPC url\n    -network string\n        op-stack network to withdraw.go from (one of: base-mainnet, base-sepolia, op-mainnet, op-sepolia) (default \"base-mainnet\")\n    -withdrawal string\n        TX hash of the L2 withdrawal transaction\n    -fault-proofs\n        Use fault proofs withdrawal flow (only for networks that support fault proofs)\n    -private-key string\n        Private key to use for signing transactions\n    -mnemonic string\n        Mnemonic to use for signing transactions\n    -ledger\n        Use ledger device for signing transactions\n    -hd-path string\n        Hierarchical deterministic derivation path for mnemonic or ledger (default \"m/44'/60'/0'/0/0\")\n    -l2-rpc string\n        Custom network L2 RPC url\n    -l2oo-address string\n        Custom network L2OutputOracle address\n    -portal-address string\n        Custom network OptimismPortal address\n    -dfg-address string\n        Custom network DisputeGameFactory address (only for networks that support fault proofs)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Fwithdrawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbase%2Fwithdrawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Fwithdrawer/lists"}