RADIAN TECH NEWS: Using Crypto App Without Paying for the Gas!

RADIAN
6 min readOct 11, 2021

Introduction: The User friendly social application with meta-transaction for crypto layperson

Since the inception of Bitcoin and Ethereum, the crypto adoption rate has been surging. Metamask wallet sees a record increase in the number of active users from less than a million at the beginning of 2020 to slightly over 5 million in April 2021.

From post https://consensys.net/blog/metamask/metamask-surpasses-5-million-monthly-active-users/

What is Metamask?

Metamask is a web browser extension that functions as a convenient crypto wallet. It can be connected to any website on demand, requiring only a button click from the user for approval. After downloading Metamask, users are prompted to create their only wallet address or import it from elsewhere. The wallet address and its corresponding private key will be stored inside the Metamask extension. Users are able to sign transactions through interacting with the Metamask interface. The signed transactions will be broadcasted to the network by Metamask and users will be notified of the transaction status.

Metamask currently supports plenty of the solidity-based blockchains including Ethereum, polygon, and Binance Smart Chain. Users can swap their tokens on various supported decentralized exchanges, such as Uniswap, Paraswap, 1Inch, etc, within Metamask, and they can easily bridge their tokens from one chain to another using external DApps such as Zapper.fi.

Barrier to Entry in RADIAN Webapp

Since Metamask is the most popular wallet option, blockchain-based applications would have support for users to connect to their Metamask account and interact with the applications by signing transactions and broadcasting to the network. This is perfectly fine for users that already process crypto-currencies in their Metamask. However, for users who are new to the crypto space, this approach is extremely unfriendly, as they do not have any crypto-currencies to pay for the gas fee.

Users are usually presented with several choices:

  1. They need to obtain crypto-currencies from friends or family in a P2P manner, i.e. they will pay cash in exchange for crypto.
  2. They need to go to centralized exchanges, such as Binance, to deposit fiat and exchange for crypto tokens. Then, transfer the tokens to their wallet address in Metamask.
  3. The application itself provides a means for the users to directly purchase crypto with fiat.

Following this, it is not difficult to see that if the RADIAN Webapp relies on Metamask for both signing and broadcasting transactions, the tedious process to cash in will most likely scare away the non-crypto users, making it a playing field solely for the crypto holders.

Although our initial launch will be focusing on grabbing the attention in the crypto space, making it a social platform for people to display their NFTs, binding their identities to their wallet address, socializing, or even going off for an offline meet-up. In our roadmap, this should eventually evolve into a fully functioning dating and social app for the general population. Therefore, it needs to be as friendly to non-crypto users as possible. Ideally, RADIAN should offer non-crypto users a gateway to the crypto world, by earning their first crypto tokens through socializing in our app (Date/Socialize to Earn!).

Low Gas Fee and Meta-Transaction

As both the gas fee and the Ether price skyrocketed due to the bull market and the NFT minting activities, it has become unsustainable for RADIAN to be based on the Ethereum network. We chose Polygon to be our first supported Blockchain network due to its extremely cheap gas fee and the short block time of 2 seconds. Solana is also under our radar as it has an even lower block time (800 ms) with a gas fee comparable to the Polygon network. However, we make it our second go-to choice as most crypto assets are locked into solidity-based blockchains. Moreover, as mentioned before, Metamask has a high adoption rate which makes it the best wallet to interface within our application. After we are established in the Polygon network, we will certainly consider supporting Solana as a second choice.

Back to the story. Now, we are able to provide utilities to the users at a cheap gas fee and a fast transaction speed. The significantly lower gas fee implies that, given the right business model, we may be able to pay gas on behalf of our users and earn it back elsewhere. (For those that are interested, please go to our pitch deck for further information.) This is technologically possible with EIP-712 (https://eips.ethereum.org/EIPS/eip-712) which details the foundation of meta-transaction. EIP-712 defines the format to follow when letting the user sign a transaction using the Metamask without broadcasting to the network.

Meta-transaction workflow:

1) An user sign meta-transaction that consists of the following fields using Metamask

  • Owner: The signer address
  • Spender: The address that can spend the tokens, usually our smart contracts
  • Amount: The amount that the owner allows the spender to spend on his/her behalf
  • Nonce: The number of times that the owner address engaged in meta-transaction
  • Deadline: The deadline of this signature

The appearance of such a message displayed on the Metamask is given below.

2) The signed meta-transaction will be passed to our backend server under the parameters [owner, spender, amount, nonce, deadline, v, r, s], where we keep a pool of wallet addresses with sufficient gas for broadcasting.

3) A new transaction will then be constructed from the parameters obtained in Step 2, signed by our private key and then broadcasted to the Polygon network. This transaction interacts with our smart contract, in which the meta-transaction will be executed to give the contract the permission to move tokens in user’s wallet address, followed by another line of code to transfer the tokens from user’s wallet address to the spender’s address.

An example of the message to sign (Gasless Procedure)

Security and Abuse Prevention

Our backend will be responsible for verifying the user who requests to use the meta-transaction via an API call. Otherwise, malicious actors can abuse our system with transactions to deplete our gas reserve. Note that even for failed transactions some gas fee will be consumed in the process. Users are required to go through a registration process that needs a valid phone number and a successful OTP code confirmation, before being allowed access to our meta-transaction facilities. It is reasonable to assume that malicious actors are unlikely to get hold of thousands of working phone numbers. Secondly, the API call will be rate limited for each user account to prevent abuse.

Conclusion

Due to the low gas fee feature of the Polygon network, the gas fee burden can be shifted from the users to us via meta-transactions. Such an approach should open up the possibility to put a larger share of the workload on chain instead of on an off-chain backend, thus providing better transparency and accountability. Moreover, gasless meta-transactions will provide the necessary UX for attracting non-crypto users. On our platform, they can start earning cryptos and having a taste of the benefits. Increasing the crypto adoption rate is one of our missions.

RADIAN is a social ecosystem that directs users from online to offline meet-ups, and enables them to enjoy a meal/drink in our merchants with our token $RADI, earned/purchased on our platform. Feel free to connect with us in our telegram group https://t.me/RADIANCommunity, or visit our website https://www.radian.community/. Any feedback on tech or our pitch deck are welcome.

Henry Yeung
Ph.D.
Co-founder/Developer of RADIAN

#Polygon #RADIAN #DateFi #Meta-Transaction #Dating #Social_App

--

--

RADIAN

RADIAN is an open sourced infrastructure allowing developers to launch web3-ready social platforms and to enable Decentralized Society