Developer's Corner
January 23, 2023

Breaking Web3 Entry Barriers with Meta Transactions

Breaking Web3 Entry Barriers with Meta Transactions

Darkweb v2.0 public release is here

Lorem ipsum dolor sit amet, consectetur adipiscing elit lobortis arcu enim urna adipiscing praesent velit viverra sit semper lorem eu cursus vel hendrerit elementum morbi curabitur etiam nibh justo, lorem aliquet donec sed sit mi dignissim at ante massa mattis.

  1. Neque sodales ut etiam sit amet nisl purus non tellus orci ac auctor
  2. Adipiscing elit ut aliquam purus sit amet viverra suspendisse potent i
  3. Mauris commodo quis imperdiet massa tincidunt nunc pulvinar
  4. Adipiscing elit ut aliquam purus sit amet viverra suspendisse potenti

What has changed in our latest release?

Vitae congue eu consequat ac felis placerat vestibulum lectus mauris ultrices cursus sit amet dictum sit amet justo donec enim diam porttitor lacus luctus accumsan tortor posuere praesent tristique magna sit amet purus gravida quis blandit turpis.

All new features available for all public channel users

At risus viverra adipiscing at in tellus integer feugiat nisl pretium fusce id velit ut tortor sagittis orci a scelerisque purus semper eget at lectus urna duis convallis. porta nibh venenatis cras sed felis eget neque laoreet suspendisse interdum consectetur libero id faucibus nisl donec pretium vulputate sapien nec sagittis aliquam nunc lobortis mattis aliquam faucibus purus in.

  • Neque sodales ut etiam sit amet nisl purus non tellus orci ac auctor
  • Adipiscing elit ut aliquam purus sit amet viverra suspendisse potenti
  • Mauris commodo quis imperdiet massa tincidunt nunc pulvinar
  • Adipiscing elit ut aliquam purus sit amet viverra suspendisse potenti
Coding collaboration with over 200 users at once

Nisi quis eleifend quam adipiscing vitae aliquet bibendum enim facilisis gravida neque. Velit euismod in pellentesque massa placerat volutpat lacus laoreet non curabitur gravida odio aenean sed adipiscing diam donec adipiscing tristique risus. amet est placerat in egestas erat imperdiet sed euismod nisi.

“Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum”
Real-time code save every 0.1 seconds

Eget lorem dolor sed viverra ipsum nunc aliquet bibendum felis donec et odio pellentesque diam volutpat commodo sed egestas aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod eu tincidunt tortor aliquam nulla facilisi aenean sed adipiscing diam donec adipiscing ut lectus arcu bibendum at varius vel pharetra nibh venenatis cras sed felis eget dolor cosnectur drolo.

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:

  1. User signs the transaction using their private key.
  2. Next, the user sends the signed transaction to the relayer.
  3. Finally, the relayer verifies the transaction received from the user.
  4. The relayer wraps the signed transaction into an Ethereum blockchain transaction and executes it after paying the requisite gas fees.
  5. The contract receives the transaction made by the relayer.
  6. 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:

  1. 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:
Normal Signature
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:

  1. Understanding Ethereum meta transactions https://betterprogramming.pub/ethereum-erc-20-meta-transactions-4cacbb3630ee
  2. Gasless or meta transactions https://docs.openzeppelin.com/learn/sending-gasless-transactions
  3. 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.

Book a Demo

Official Links: Website | Twitter | Discord| Telegram | TG Announcement | Medium | GitHub