目前往以太坊发送的每一笔交易,都需要付一定数量的gas fee,以太坊矿工也是根据gas price排序去打包交易以获取报酬。这样引出了一堆问题,例如
很多拥有ERC20 token的用户去玩Dapp,必须在钱包中始终持有一定量的Ether以支付gas费用,这对很多刚玩区块链的新手操作门槛极为高,难怪有人说:这是阻碍以太坊、DApp普及的最大障碍之一。
能不能直接用token来支付gas费用呢?
此类需求一般称之为Meta Transactions 或Gasless Transactions,Ethereum社区提出了各种解决方案, 《The State of Meta Transactions》对各种解决方案及应用场景作为很好的总结。另外 《MetaTransactiosn_UniversalLogins_Proxy》对各类项目总结得也比较全面。
一些典型的解决方案:
基于Constantinople EIP 1014 CREATE2的方案
- ERC20 backward-compatible gas abstraction using Constantinople’s EIP 1014
-
DAI in the hands of all— You can now send DAI without paying Ether gas fees.
Smart Contract Based Delegators
New Token Standards
- ERC-1776 Native Meta Transactions
- ERC-865 Pay transfers in tokens instead of gas, in one transaction
- ERC-1003 Token Standard (ERC20 Extension)
- ERC-1228 Delegated Execution
Wrapper Contracts
Changes to EVM
- EIP1035 Transaction execution batching and delegation
Relayer Networks
- Uport TxRelay (requires compatible smart contracts)
- Aragon’s Pay Protocol
- EIP-1613 Gas Station Networks
Signature Standards
- ERC-1077 Executable Signed Messages refunded by the contract
这些解决方案中,重点分析一下Proxy Bouncers 和基于Constantinople EIP 1014 CREATE2的方案,其中 Proxy Bouncers 是最先提出meta transactions概念及MVP的项目,Metacash 的解决方案解决算是比较完美的方案。
基于Meta Transactions技术可以拓展出很多不错的应用场景
1、DApp直接用ERC20 token支付各种费用
2、Universal Logins
3、PULLPAY (Subscription或Recurring Payment)
转载请注明:出家如初,成佛有余 » Ethereum Meta Transactions(Gasless Transactions)解决方案概述