These networks would offer a solution to free users from the payment of gas. The GSNs aim to reduce obstacles in the mass adoption of Ethereum.
After two months’ trial period, Open Zeppelin and Tabookey launched the Gas Station Network (GSN) for metatransactions in the main Ethereum network. It is a decentralized relay network used to send ETH transactions without end users having to pay for the gas normally charged for the transactions.
Zeppelin and Tabookey focused on solving the difficulties faced by users of the Ethereum network, such as going to a centralized exchange, undergoing a KYC process and waiting for approval, transferring money from their bank, buying ETH, installing MetaMask, learning to use it and transferring ETH to it.
The Ethereum GSN network emerged as a decentralized way of adding reverse-charge calls to smart contracts. The relay network pays the cost of gas from verified transactions and, in turn, they are reimbursed directly for the contract with which users wish to interact.
In order for the relays to pay the cost of the transaction gas, the contract with which the user is interacting is required to be enabled for the GSN. To do this, developers need to code their contracts with the application found in the OpenZeppelin Contracts library or download the GSN Starter Kit already configured with all components.
A single RelayHub open source smart contract acts as a registrar for relays. It is a mediator in transactions between relays and dApp contracts, and issues events that help users find relays and assess their reputation.
Fundamentals of the GSNs
The same as a post office, the GSNs require a destination address to send a transaction in ETH. This address can be another person or a smart contract.
The transaction is like putting cash in an envelope, while the price of gas is like giving the letter carrier an incentive to deliver the letter. On the other hand, the signature is the stamp put on the form at the post office as a proof that the content of the envelope to be sent has been verified.
GSNs use a public group of relays, of which the sender selects one. It is as if the sender of the letter selected the post office that offers a better service. That way, the sender has the option to negotiate their rate, verify their reliability and send the transaction.
The public group of transactions can be compared to a group of letter carriers in dispute for carrying the largest number of letters. They may eventually act selfishly and abuse the system, in order to increase their profits.
Post offices are reflected in the GSN network, which publishes its rates and URLs on the blockchain, accepting transactions with no time limit for users, filling them with gas, signing them, returning them to the user, relaying them to the blockchain and getting compensation for its effort.
Post offices are associated with a head office that acts as a registrar, as data from the associated post office are used to prevent abuse of services or censorship.
It is observed how the application selects a relay and delivers the transaction to the blockchain. Behind the scenes, the application selects a relay using information on the chain about the transaction fees and the current reputation, tries to send the transaction through the selected relay, immediately knows if the request was handled or retries with the next relay.
By Willmen Blanco