A Quick Guide to Understanding Meta Transactions
Unleash the power of meta transactions with our comprehensive guide. Learn how to reduce gas costs and enhance user experience in your blockchain apps. Read now!
Developers are building fantastic dApps, but as a user, there is friction to interacting with these dApps. Users must go through a tedious process.
This process involves:
- Downloading a wallet
- Creating a wallet (managing your keys)
- Funding that wallet
We are well versed in how someone can download a wallet and manage their keys. But does a user need to fund the wallet — the answer is transaction fees. Users need to pay transaction fees whenever they call any function on a smart contract, i.e. using the dApp.
But that doesn't sound tedious. Right? Funding the wallet is not an easy step. It involves:
- Selecting an exchange
- Creating an account
- Entering personal data and uploading proof of identity
- Depositing fiat currency
- Awaiting for funds to be accredited
- Purchasing currency needed for the transaction &
- It was transferring currency to a wallet that was created earlier.
The friction is super high, and the user drops off before finishing these steps. Hence it becomes difficult for dApps to scale and reach critical mass. Meta transaction is a way to solve the above steps of creating and funding the wallet.
A meta transaction is a way to separate the transaction's signer and gas fee and payer. There are three main actors in meta transactions: The user, the relayer, and the contract.
- Usera. User signs the transaction with their private key.b. They send the signed transaction to the relayer.Note: Here user just signed the transaction and didn't execute it.
- Relayera. Relayer verifies the transaction received from the user.b. Relayer wraps the signed transaction into an Ethereum transaction and executes it.c. In this way, the relayer pays the transaction fees.
- Contracta. The Contract receives the transaction made by the relayer.b. It then unwraps the original signature and uses it.
Advantages of Meta Transactions
- It reduces friction as users don't have to fund their wallet
- Developers can pay for users initially and recover the money over time in fiat or any other simple mode.
- It helps you scale and improves adoption.
- User identity is protected
- dApp gets faster as no. of pending transactions reduces
Disadvantages of Meta Transactions
- Meta tx does not work on all the contracts. Therefore, it should support meta transactions by importing appropriate code.
- Some applications deploy a centralised relayer (single entity), which goes against the ethos of decentralisation.
Technical details
- EIP 712: Ethereum-typed structured data hashing and signingWhen a user signs the transaction instead of a standard signature, it is said to be a typed signature. The main reason behind doing this is that in a normal signature, users don't know what they are signing for. In a typed signature, however, they have a clear picture of what data they are signing in.
- EIP 2771: Secure Protocol for Native Meta TransactionsWrapping and unwrapping of transactions happen through this protocol. A developer has to inherit their contracts from here. After inheriting their contracts in their code, they need to rename two keywords throughout their code:a. msg.sender to _msgSender()b. msg.data to_msgData()
About Arcana Network
Arcana is Web3 infra for devs to launch and scale apps through its Auth, Store, and Access SDKs. Web3 apps use Arcana's SDK to authenticate users with Social and Passwordless Auth and create non-custodial wallets, Store Encrypted/Unencrypted Data, and Manage Access. Built for Ethereum and EVM-based chains, with Arcana's privacy stack, developers can build secure and privacy-preserving apps with a seamless user experience.
Arcana has raised 2.7Mn USD from some of the leading investors and founders in the ecosystem, such as Balaji Srinivasan, Founders of Polygon, Woodstock, Republic Crypto, and Digital Currency Group.
Watch out for Arcana's upcoming Mainnet in December 2022. Want to know more about our Mainnet features? Book a demo.
Official Links: Website | Twitter | Discord| Telegram | TG Announcement | Medium | GitHub