Breaking Web3 Entry Barriers with Meta Transactions
Learn how meta transactions can break down the entry barriers to Web3. Discover how this innovative technology can make decentralized finance more accessible!
As you begin dipping your toes into the much-hyped world of blockchain, crypto and Web3, you realise that, unlike Web2, this is not a piece of cake. This is primarily true irrespective of whether you are an end user or a developer of decentralised applications (dApps).
Web3 entails a significant barrier to entry for both end users as well as Web2 developers that are building decentralised applications (dApps) for the end users. Despite the hype, the Web3 adoption rates are nowhere close to those of Web2, in its infancy.
There is a long road ahead with a bumpy ride guaranteed. While dApp developers and end users grapple with onboarding woes, the blockchain backend ecosystems that power the dApps, have their own more significant challenges that are yet to be solved.
Should that deter you from delving any deeper into Web3 yet?
Not at all, unless you don’t enjoy a front-row seat in the fast-evolving Web3 technology arena.
In this post, we will look at some of these chicken-and-egg onboarding challenges impacting dApp adoption and how those can be addressed through the Meta Transaction approach while building dApps.
End user challenges
Getting started with a Web3 app requires end users to understand the blockchain onboarding model, the token and payment mechanisms involved and managing secret keys. Web3 apps use blockchain technology and smart contracts at the backend that are driven primarily by block mining and verification transactions. For initiating a transaction, the end user must have the following:
- A secret key to sign the transaction mechanism to store and access it securely.
- Besides the basic knowledge of blockchain semantics, the user needs to know which encryption and decryption mechanisms (key and data) are secure for them to use.
- A wallet with tokens or acceptable blockchain currency (coins) to pay gas or transaction fees.
Developer challenges
The biggest challenge faced by dApps developers is end-user adoption.
Well, they can make onboarding a little easier for end users by offering them dApp subscriptions that can be purchased using fiat currency. But, at the same time, the developers themselves bear the burden of paying gas fees through blockchain wallet and token mechanisms.
However, that brings up a different set of issues altogether related to creating and funding the wallet before any functions can be called (Setters) on the smart contracts living in blockchains:
- Searching for a suitable blockchain exchange that meets the requirements of the dApps security and privacy use model.
- They are creating and managing accounts and wallets.
- Storing personal information and identity proofs.
- Depositing fiat currency.
- Ensuring fiat funds are accredited and available for transactions
- Purchase currency or tokens required for the requisite blockchain transactions.
- Transfer currency to the wallet.
Suppose dApp developers choose to manage these for their end-users to make Web3 dApps onboarding experience similar to Web2 and enable more end-users. In that case, these issues listed above are big enough to waste a significant portion of dApp developers’ time and efforts. That time and effort can be better spent building the dApp application logic itself.
Well, this is where Meta Transactions can make a huge difference! First, let’s look at Meta Transactions and how they work.
Meta Transactions
A meta transaction is a typical Ethereum transaction that embeds another transaction within the actual transaction. The actual transaction is signed by a user and then sent to an operator or relayer. Users do not require gas and blockchain interaction to submit a meta transaction. Still, they could pay a subscription fee in fiat currency to the operator to submit blockchain transactions on their behalf. The operator takes this user-signed transaction and submits it to the blockchain paying for the fees himself. The operator cannot change the transaction but submit it to the blockchain smart contract. The contract checks that there is a valid signature on the actual transaction and then executes it.
There are three key actors in a meta transaction — The user, the Relayer or Operator, and the Blockchain Smart Contract.
The figure below shows the sequence of actions that form a meta transaction:
The sequence of actions that take place in the above illustration:
- User signs the transaction using their private key.
- Next, the user sends the signed transaction to the relayer.
- Finally, the relayer verifies the transaction received from the user.
- The relayer wraps the signed transaction into an Ethereum blockchain transaction and executes it after paying the requisite gas fees.
- The contract receives the transaction made by the relayer.
- It unwraps the meta-transaction and extracts the user signature to execute the transaction.
So does meta transaction solve all onboarding issues? Maybe not. Let us take a look at some of the advantages and disadvantages.
Pros and Cons
Pros:
- Users can get started with Web3 dApps with Fiat currency.
- Wallets are not mandatory but optional as long as the dApp developer offers secure key storage and management or passwordless features in dApps taking off the key management burden from end users.
Cons:
- Not all smart contracts support meta-transactions.
- There could be a trust issue as the meta-transaction model involves a third party between a user owning and signing a blockchain transaction on one end and the smart contract on the other. There is no guarantee that the operator or relayer will submit the transaction.
Security Considerations
In the context of meta-transactions, there are specific security considerations that we need to be aware of:
- EIP712: Ethereum Typed Structured Data Hashing and Signing: When a user signs the meta transaction, instead of a normal signature, he must perform a typed signature. This is done because, in the case of normal signatures, users do not have visibility and don’t know what they are signing for. However, in typed signatures, they can obtain a clearer picture of what data they are signing in. The figure below shows the difference between a normal signature and a typed signature:
2. EIP2771: Secure Protocol for Native Meta Transactions: Meta transaction-related wrapping and unwrapping of the transaction happen through this protocol. Developers have to inherit their contracts from here to wrap the transaction. After inheriting the contracts in their code, developers need to rename two keywords. 1. msg.sender to _msgSender() 2. msg.data to _msgData()
Conclusion
Meta transaction is a way forward to enable Web2 users and developers to onboard Web3 easily with a lower barrier to entry. For more information, see the following references:
- Understanding Ethereum meta transactions https://betterprogramming.pub/ethereum-erc-20-meta-transactions-4cacbb3630ee
- Gasless or meta transactions https://docs.openzeppelin.com/learn/sending-gasless-transactions
- Contracts: Meta transactions core https://docs.openzeppelin.com/contracts/4.x/api/metatx
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