{"eip":1613,"title":"Gas Stations Network","description":"A decentralized network allowing smart contracts to accept and pay for relayed transactions, enabling gasless user experiences.","authors":["Yoav Weiss (@yoavw)","Dror Tirosh (@drortirosh)","Alex Forshtat (@forshtat)","Shahaf Nacson (@shahafn)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2018-11-18","requires":[712,2771],"discussionsTo":"https://ethereum-magicians.org/t/erc-1613-gas-station-network/29051","repo":"ERCs","label":"ERC-1613","officialUrl":"https://eips.ethereum.org/EIPS/eip-1613","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1613.md","url":"https://eips.huatuo.xyz/eip-1613/","tldr":{"en":"The Gas Station Network: relayers pay gas for users' signed requests and are reimbursed from a dapp's or paymaster's deposit, so people without ETH can still use contracts.","ja":"Gas Station Network: リレイヤーがユーザーの署名付きリクエストのガス代を支払い、dapp や Paymaster のデポジットから払い戻しを受ける。ETH を持たない人でもコントラクトを使える。","ko":"Gas Station Network: 릴레이어가 사용자의 서명된 요청에 대한 가스를 대신 내고, dapp이나 paymaster의 예치금에서 보전받는다. ETH가 없는 사람도 컨트랙트를 사용할 수 있다.","zh":"Gas Station Network：中继者为用户已签名的请求支付 gas，并从 dapp 或 paymaster 的押金中获得补偿，使没有 ETH 的人也能使用合约。"},"tags":["gasless","meta-transactions","relayer","paymaster","ux"],"explainers":{"en":{"lang":"en","tldr":"The Gas Station Network: relayers pay gas for users' signed requests and are reimbursed from a dapp's or paymaster's deposit, so people without ETH can still use contracts.","tags":["gasless","meta-transactions","relayer","paymaster","ux"],"related":[2771,712,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1613/","markdown":"## What problem does it solve?\n\nTo call a contract you need ETH for gas. For a new user that means buying ETH on an exchange before they can even try a dapp, which is a major drop-off point. Dapp owners often would happily pay those fees themselves, or let users pay by card, but Ethereum transactions must be paid by the sender.\n\nThe Gas Station Network (GSN) lets a contract accept \"collect calls\". A user signs a request off-chain, a relay server submits it and pays the gas, and the relay is reimbursed (plus a fee) from a deposit that the dapp or a sponsor has placed on-chain. It needs no protocol change.\n\n## How it works\n\n1. A dapp owner or sponsor deposits ETH into the **RelayHub**, earmarked for the contract that will pay.\n2. A **sender** with no ETH signs a request describing the call.\n3. A **relay** picks up the request, checks it will be paid, and submits it to the hub, paying gas.\n4. The **hub** checks signature and nonce, asks the payer to accept, performs the call with the sender's address attached, then pays the relay from the deposit.\n5. The **recipient** contract sees the call as coming from the sender, not the relay.\n\nRelays stake ETH in the hub. Misbehaviour that can be proven on-chain (such as signing two transactions with the same nonce) lets anyone claim part of the stake. As long as one honest relay exists, requests cannot be censored.\n\nThe spec covers two versions:\n\n| | Version 1 | Version 2 |\n| --- | --- | --- |\n| Who decides to pay | Recipient's `acceptRelayedCall` | Separate **Paymaster** contract |\n| Signature and replay protection | Nonce in `RelayHub` | **Forwarder** ([EIP-712](/eip-712/), [ERC-2771](/eip-2771/)) |\n| Reading the real sender | `getSender()` | `_msgSender()` from the last 20 bytes of calldata |\n| Stakes | In `RelayHub` | In a `StakeManager` |\n\n## Sample code\n\nA Version 2 style recipient that trusts one forwarder and reads the real sender per ERC-2771:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Counter {\n    address public immutable trustedForwarder;\n    mapping(address =\u003e uint256) public count;\n\n    constructor(address forwarder) { trustedForwarder = forwarder; }\n\n    function isTrustedForwarder(address f) public view returns (bool) {\n        return f == trustedForwarder;\n    }\n\n    function _msgSender() internal view returns (address sender) {\n        if (msg.sender == trustedForwarder \u0026\u0026 msg.data.length \u003e= 20) {\n            assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) }\n        } else {\n            sender = msg.sender;\n        }\n    }\n\n    function increment() external {\n        count[_msgSender()] += 1;   // credited to the user, not the relay\n    }\n}\n```\n\nWho pays is decided by a separate paymaster, which implements `preRelayedCall` (revert to reject) and `postRelayedCall`, and keeps a deposit in the hub.\n\n## Things to know\n\n- **Status: Draft.** The text describes the deployed GSN v1 and v2 systems, but the standard itself is not final.\n- A recipient must only trust a forwarder it controls or has audited: a trusted forwarder can impersonate any sender.\n- Paymasters carry real financial risk. Accepting anonymous requests invites relays or users to drain the deposit; whitelists, signed approval data and gas-price limits are the usual defences.\n- [ERC-4337](/eip-4337/) account abstraction later introduced its own paymaster concept for smart accounts, and is now the more common path to gasless UX.\n"},"ja":{"lang":"ja","tldr":"Gas Station Network: リレイヤーがユーザーの署名付きリクエストのガス代を支払い、dapp や Paymaster のデポジットから払い戻しを受ける。ETH を持たない人でもコントラクトを使える。","tags":["gasless","meta-transactions","relayer","paymaster","ux"],"related":[2771,712,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1613/","markdown":"## 何を解決するのか\n\nコントラクトを呼び出すにはガス代として ETH が必要です。新規ユーザーにとっては、dapp を試す前に取引所で ETH を購入しなければならないということで、大きな離脱ポイントになっています。dapp の所有者は、その手数料を自分で喜んで負担したり、ユーザーにカードで支払わせたりしたいことが多いのですが、Ethereum のトランザクションは送信者が支払わなければなりません。\n\nGas Station Network（GSN）は、コントラクトが「コレクトコール」を受け付けられるようにします。ユーザーがオフチェーンでリクエストに署名し、リレーサーバーがそれを提出してガス代を支払い、dapp またはスポンサーがオンチェーンに預けたデポジットから、リレー（と手数料）が払い戻されます。プロトコルの変更は不要です。\n\n## 仕組み\n\n1. dapp の所有者またはスポンサーが、支払いを行うコントラクト用に確保した ETH を **RelayHub** に預けます。\n2. ETH を持たない**送信者**が、呼び出しを記述したリクエストに署名します。\n3. **リレー**がリクエストを拾い、支払いを受けられることを確認し、ガス代を支払ってハブに提出します。\n4. **ハブ**は署名とナンスを確認し、支払者に承諾を求め、送信者のアドレスを付けて呼び出しを実行し、その後デポジットからリレーに支払います。\n5. **受信側**のコントラクトからは、呼び出しがリレーではなく送信者から来たように見えます。\n\nリレーはハブに ETH をステークします。オンチェーンで証明できる不正（同じナンスで 2 つのトランザクションに署名するなど）があれば、誰でもステークの一部を請求できます。誠実なリレーが 1 つでも存在する限り、リクエストが検閲されることはありません。\n\n仕様は 2 つのバージョンを扱っています。\n\n| | バージョン 1 | バージョン 2 |\n| --- | --- | --- |\n| 支払うかどうかを決めるのは | 受信側の `acceptRelayedCall` | 別の **Paymaster** コントラクト |\n| 署名とリプレイ保護 | `RelayHub` 内のナンス | **Forwarder**（[EIP-712](/eip-712/)、[ERC-2771](/eip-2771/)） |\n| 実際の送信者の読み取り | `getSender()` | calldata の末尾 20 バイトからの `_msgSender()` |\n| ステーク | `RelayHub` 内 | `StakeManager` 内 |\n\n## サンプルコード\n\n1 つのフォワーダーを信頼し、ERC-2771 に従って実際の送信者を読み取る、バージョン 2 方式の受信側:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Counter {\n    address public immutable trustedForwarder;\n    mapping(address =\u003e uint256) public count;\n\n    constructor(address forwarder) { trustedForwarder = forwarder; }\n\n    function isTrustedForwarder(address f) public view returns (bool) {\n        return f == trustedForwarder;\n    }\n\n    function _msgSender() internal view returns (address sender) {\n        if (msg.sender == trustedForwarder \u0026\u0026 msg.data.length \u003e= 20) {\n            assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) }\n        } else {\n            sender = msg.sender;\n        }\n    }\n\n    function increment() external {\n        count[_msgSender()] += 1;   // credited to the user, not the relay\n    }\n}\n```\n\n誰が支払うかは別の Paymaster が決めます。Paymaster は `preRelayedCall`（リバートで拒否）と `postRelayedCall` を実装し、ハブにデポジットを保持します。\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** このテキストはデプロイ済みの GSN v1 と v2 のシステムを記述していますが、標準そのものは最終化されていません。\n- 受信側は、自分で制御しているか監査したフォワーダーだけを信頼しなければなりません。信頼されたフォワーダーは、任意の送信者になりすませます。\n- Paymaster には実際の金銭的リスクがあります。匿名のリクエストを受け入れると、リレーやユーザーがデポジットを使い果たす恐れがあります。ホワイトリスト、署名付きの承認データ、ガス価格の上限が一般的な防御策です。\n- [ERC-4337](/eip-4337/) のアカウント抽象化は、後にスマートアカウント向けに独自の Paymaster の概念を導入し、現在ではガスレス UX を実現するより一般的な道筋になっています。\n"},"ko":{"lang":"ko","tldr":"Gas Station Network: 릴레이어가 사용자의 서명된 요청에 대한 가스를 대신 내고, dapp이나 paymaster의 예치금에서 보전받는다. ETH가 없는 사람도 컨트랙트를 사용할 수 있다.","tags":["gasless","meta-transactions","relayer","paymaster","ux"],"related":[2771,712,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1613/","markdown":"## 어떤 문제를 해결하나요?\n\n컨트랙트를 호출하려면 가스용 ETH가 필요합니다. 신규 사용자에게는 dapp을 써 보기도 전에 거래소에서 ETH를 구매해야 한다는 뜻이며, 이는 큰 이탈 지점입니다. dapp 운영자는 그 수수료를 기꺼이 직접 부담하거나 사용자가 카드로 결제하게 하고 싶어 하는 경우가 많지만, 이더리움 트랜잭션은 발신자가 비용을 내야 합니다.\n\nGas Station Network(GSN)는 컨트랙트가 \"수신자 부담 전화(collect call)\"를 받을 수 있게 합니다. 사용자가 오프체인에서 요청에 서명하면 릴레이 서버가 이를 제출하고 가스를 내며, dapp이나 후원자가 온체인에 맡겨 둔 예치금에서 릴레이가 (수수료와 함께) 보전받습니다. 프로토콜 변경이 필요 없습니다.\n\n## 어떻게 동작하나요?\n\n1. dapp 소유자나 후원자가 비용을 낼 컨트랙트 몫으로 ETH를 **RelayHub**에 예치합니다.\n2. ETH가 없는 **발신자**가 호출을 기술하는 요청에 서명합니다.\n3. **릴레이**가 요청을 받아 보상을 받을 수 있는지 확인한 뒤, 가스를 내고 허브에 제출합니다.\n4. **허브**는 서명과 nonce를 확인하고, 결제자에게 수락 여부를 묻고, 발신자의 주소를 붙여 호출을 수행한 다음, 예치금에서 릴레이에 지급합니다.\n5. **수신** 컨트랙트에는 호출이 릴레이가 아니라 발신자에게서 온 것으로 보입니다.\n\n릴레이는 허브에 ETH를 스테이킹합니다. 온체인에서 증명할 수 있는 부정 행위(같은 nonce로 트랜잭션 두 개에 서명하는 것 등)가 있으면 누구나 스테이크의 일부를 청구할 수 있습니다. 정직한 릴레이가 하나라도 있는 한 요청은 검열될 수 없습니다.\n\n명세는 두 가지 버전을 다룹니다.\n\n| | 버전 1 | 버전 2 |\n| --- | --- | --- |\n| 결제 여부를 결정하는 주체 | 수신자의 `acceptRelayedCall` | 별도의 **Paymaster** 컨트랙트 |\n| 서명 및 재전송 방지 | `RelayHub`의 nonce | **Forwarder**([EIP-712](/eip-712/), [ERC-2771](/eip-2771/)) |\n| 실제 발신자 읽기 | `getSender()` | calldata 마지막 20바이트에서 읽는 `_msgSender()` |\n| 스테이크 | `RelayHub`에 | `StakeManager`에 |\n\n## 샘플 코드\n\n포워더 하나를 신뢰하고 ERC-2771에 따라 실제 발신자를 읽는 버전 2 스타일의 수신자:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Counter {\n    address public immutable trustedForwarder;\n    mapping(address =\u003e uint256) public count;\n\n    constructor(address forwarder) { trustedForwarder = forwarder; }\n\n    function isTrustedForwarder(address f) public view returns (bool) {\n        return f == trustedForwarder;\n    }\n\n    function _msgSender() internal view returns (address sender) {\n        if (msg.sender == trustedForwarder \u0026\u0026 msg.data.length \u003e= 20) {\n            assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) }\n        } else {\n            sender = msg.sender;\n        }\n    }\n\n    function increment() external {\n        count[_msgSender()] += 1;   // credited to the user, not the relay\n    }\n}\n```\n\n누가 비용을 낼지는 별도의 paymaster가 결정하며, paymaster는 `preRelayedCall`(revert하면 거부)과 `postRelayedCall`을 구현하고 허브에 예치금을 둡니다.\n\n## 알아둘 점\n\n- **상태: Draft.** 이 문서는 배포된 GSN v1과 v2 시스템을 설명하지만 표준 자체는 확정되지 않았습니다.\n- 수신자는 자신이 제어하거나 감사한 포워더만 신뢰해야 합니다. 신뢰받는 포워더는 어떤 발신자든 사칭할 수 있습니다.\n- Paymaster에는 실제 금전적 위험이 따릅니다. 익명 요청을 받아들이면 릴레이나 사용자가 예치금을 바닥낼 수 있습니다. 화이트리스트, 서명된 승인 데이터, 가스 가격 상한이 일반적인 방어책입니다.\n- [ERC-4337](/eip-4337/) 계정 추상화는 나중에 스마트 계정을 위한 자체 paymaster 개념을 도입했으며, 지금은 가스리스 UX를 구현하는 더 일반적인 길이 되었습니다.\n"},"zh":{"lang":"zh","tldr":"Gas Station Network：中继者为用户已签名的请求支付 gas，并从 dapp 或 paymaster 的押金中获得补偿，使没有 ETH 的人也能使用合约。","tags":["gasless","meta-transactions","relayer","paymaster","ux"],"related":[2771,712,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1613/","markdown":"## 它解决什么问题？\n\n调用合约需要 ETH 作为 gas。对新用户来说，这意味着在试用 dapp 之前，必须先去交易所购买 ETH，这是一个主要的流失点。dapp 所有者往往很乐意自己承担这些费用，或让用户用银行卡支付，但以太坊交易必须由发送者支付。\n\nGas Station Network（GSN）让合约可以接受\"对方付费电话\"（collect call）。用户在链下签署一个请求，中继服务器提交它并支付 gas，随后中继者（连同一笔费用）从 dapp 或赞助方存放在链上的押金中得到补偿。它不需要修改协议。\n\n## 它如何运作\n\n1. dapp 所有者或赞助方把 ETH 存入 **RelayHub**，指定给将要付费的合约。\n2. 没有 ETH 的**发送者**对描述调用的请求签名。\n3. **中继者**接收请求，检查自己能得到报酬，然后支付 gas 并把它提交给 hub。\n4. **hub** 检查签名和 nonce，请付款方确认接受，带上发送者的地址执行调用，然后从押金中向中继者付款。\n5. **接收方**合约看到的调用来自发送者，而不是中继者。\n\n中继者要在 hub 中质押 ETH。可以在链上证明的不当行为（例如用同一个 nonce 签署两笔交易）会让任何人都能索取一部分质押。只要还存在一个诚实的中继者，请求就不会被审查。\n\n规范涵盖两个版本：\n\n| | 版本 1 | 版本 2 |\n| --- | --- | --- |\n| 谁决定付费 | 接收方的 `acceptRelayedCall` | 独立的 **Paymaster** 合约 |\n| 签名与重放保护 | `RelayHub` 中的 nonce | **Forwarder**（[EIP-712](/eip-712/)、[ERC-2771](/eip-2771/)） |\n| 读取真实发送者 | `getSender()` | 来自 calldata 最后 20 字节的 `_msgSender()` |\n| 质押 | 在 `RelayHub` 中 | 在 `StakeManager` 中 |\n\n## 示例代码\n\n一个版本 2 风格的接收方，它信任一个 forwarder，并按 ERC-2771 读取真实发送者：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Counter {\n    address public immutable trustedForwarder;\n    mapping(address =\u003e uint256) public count;\n\n    constructor(address forwarder) { trustedForwarder = forwarder; }\n\n    function isTrustedForwarder(address f) public view returns (bool) {\n        return f == trustedForwarder;\n    }\n\n    function _msgSender() internal view returns (address sender) {\n        if (msg.sender == trustedForwarder \u0026\u0026 msg.data.length \u003e= 20) {\n            assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) }\n        } else {\n            sender = msg.sender;\n        }\n    }\n\n    function increment() external {\n        count[_msgSender()] += 1;   // credited to the user, not the relay\n    }\n}\n```\n\n由谁付费由一个独立的 paymaster 决定，它实现 `preRelayedCall`（revert 即拒绝）和 `postRelayedCall`，并在 hub 中保存押金。\n\n## 需要注意\n\n- **状态：Draft。** 文本描述的是已部署的 GSN v1 和 v2 系统，但标准本身尚未最终确定。\n- 接收方只能信任自己控制或已审计过的 forwarder：受信任的 forwarder 可以冒充任何发送者。\n- Paymaster 存在真实的资金风险。接受匿名请求，会招致中继者或用户把押金耗尽；白名单、已签名的批准数据和 gas 价格上限是常见的防御手段。\n- [ERC-4337](/eip-4337/) 账户抽象后来为智能账户引入了自己的 paymaster 概念，如今已是实现无 gas 体验更常见的路径。\n"}}}
