---
eip: 1613
label: ERC-1613
title: Gas Stations Network
status: Draft
type: Standards Track
category: ERC
created: 2018-11-18
requires: 712, 2771
official: https://eips.ethereum.org/EIPS/eip-1613
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1613.md
canonical: https://eips.huatuo.xyz/eip-1613/
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]
---

# ERC-1613: Gas Stations Network

> A decentralized network allowing smart contracts to accept and pay for relayed transactions, enabling gasless user experiences.

**TL;DR:** 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.

## What problem does it solve?

To 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.

The 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.

## How it works

1. A dapp owner or sponsor deposits ETH into the **RelayHub**, earmarked for the contract that will pay.
2. A **sender** with no ETH signs a request describing the call.
3. A **relay** picks up the request, checks it will be paid, and submits it to the hub, paying gas.
4. 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.
5. The **recipient** contract sees the call as coming from the sender, not the relay.

Relays 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.

The spec covers two versions:

| | Version 1 | Version 2 |
| --- | --- | --- |
| Who decides to pay | Recipient's `acceptRelayedCall` | Separate **Paymaster** contract |
| Signature and replay protection | Nonce in `RelayHub` | **Forwarder** ([EIP-712](/eip-712/), [ERC-2771](/eip-2771/)) |
| Reading the real sender | `getSender()` | `_msgSender()` from the last 20 bytes of calldata |
| Stakes | In `RelayHub` | In a `StakeManager` |

## Sample code

A Version 2 style recipient that trusts one forwarder and reads the real sender per ERC-2771:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Counter {
    address public immutable trustedForwarder;
    mapping(address => uint256) public count;

    constructor(address forwarder) { trustedForwarder = forwarder; }

    function isTrustedForwarder(address f) public view returns (bool) {
        return f == trustedForwarder;
    }

    function _msgSender() internal view returns (address sender) {
        if (msg.sender == trustedForwarder && msg.data.length >= 20) {
            assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) }
        } else {
            sender = msg.sender;
        }
    }

    function increment() external {
        count[_msgSender()] += 1;   // credited to the user, not the relay
    }
}
```

Who pays is decided by a separate paymaster, which implements `preRelayedCall` (revert to reject) and `postRelayedCall`, and keeps a deposit in the hub.

## Things to know

- **Status: Draft.** The text describes the deployed GSN v1 and v2 systems, but the standard itself is not final.
- A recipient must only trust a forwarder it controls or has audited: a trusted forwarder can impersonate any sender.
- 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.
- [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.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1613
