Never pay gas fees again • Biconomy deep-dive

Sitesh Kumar Sahoo
14 min readJan 10, 2022

We all know how a transaction feels like in a web3 application. In the last few years, the web3 or blockchain applications took a massive leap in terms of no of users and transactions. A wide range of use cases has emerged with a lot of decentralized exchanges(e.g. Uniswap) lending and borrowing protocols(AAVE), NFT marketplaces(Opensea), and many more.

As you know every interaction with a dapp is an interaction with blockchain itself. But with the current versions of blockchain applications the user needs to have knowledge about wallets, gas fees, and many complicated UX. And the transaction fails and the waiting time just adds to the problem.

As most of the adoption has been on Etherum it’s has become a lot crowded on the ethereum blockchain. The activity is way higher than the efficiency of the chain. This resulted in absurdly high gas fees while transacting. This led to the solutions that could make transactions faster and cheaper which are referred to as Layer 2 solutions(L2), rollups, side-chains, etc.

As more and more dapps move beyond ethereum to various other chains according to their utility, it makes users switch chains to transact in those dapps. This is what is called multichain in web3. This multi-chain constitutes of Ethereum scaling solutions, their native tokens, Layer 1s, and applications fragmented across different blockchain infrastructures.

Though it introduced many use-cases, gave users choice to choose their platform of choice, It made the user experience and existing problems even worse. Biconomy solves these problems with its unique protocol design, and that’s what we are going to deep dive into.

Let’s discuss the problems

As we discussed above the ethereum gas fees being high and the scaling solutions which make that low tend to overcomplicate the user as they are spread across different chains. This requires uses to understand layer 2s and why their funds need to be on different chains to transact on that blockchain. They need to manually change their RPC(Remote Procedure Call, how the user interacts with blockchain system) and in addition to that, they need to hold their native tokens for gas to interact. Also, the communication and contract calls between these chains are insignificant and highly technical. This makes the user-experience complicated.

As more and more dapps scale to a multi-chain framework, this makes the onboarding process of new users slow and hard. As users don’t want to bear these complexities and deal with gas, transaction management, bridges they expect the dapp to manage everything.

New Users have a long complicated onboarding process. Non-crypto savvy new users will have to pass KYC, purchase ETH from an exchange, download a wallet, then connect their wallet before they can go any further, which can take days! No one waits for days to try out an application.

Biconomy comes with great solutions to these problems introducing a Multi-chain Relayer Protocol.

Biconomy logo banner

Building blocks

  1. Meta-Transaction

Meta-transactions are made by a third party on behalf of the user. The user has to sign a message that contains the details about the transaction they want to execute. Then the realtor executes these transaction details on the desired blockchain, also while paying the gas.

This shields users from complicated UX. The users neither have to hold the native tokens nor pay the gas fees. They just need to click once to sign and the relayer will ensure a 100% success rate handling everything under the hood.

2. Cross-Chain Transaction

Biconomy makes a seamless multi-chain infrastructure for Web3. It can manage the flow of funds and messages across different chains in an easy, affordable, and secure way while being decentralized. Also, it provides instant cross-chain communication & contract calls. The Biconomy blockchain will contain verified information for a transaction on any blockchain which makes the interaction between users and dapps seamless on every chain.

3. Decentralized Relayer network

There is a set of different node operators on every supported chain which power the Biconomy network. The meta-transactions, cross-chain transfers, and cross-chain communication are managed and processed by this decentralized multi-chain relayer network.

Solution Biconomy provides

  1. Onboard without paying gas through gasless transactions
  2. Pay gas in their favorite ERC20 token or your dApp token
  3. Avoid blockchain complexities such as changing network
  4. Enjoy lightning-fast confirmed transactions

Adding to this the Biconomy infrastructure takes care of gas optimization and transaction management. Which will deal with gas price fluctuations to reduce gas costs by as much as 40% so that you can focus on building your project.

Through Biconomy’s powerful and easy-to-use SDK/APIs, you can enable a simple and customized transaction journey so that the end-users don’t get intimidated by blockchain complexities. This enables seamless interactions between your application and your end-users.

  • With Biconomy SDK Mexa you can enable a gasless experience on your Dapps. Which will give a superior user experience by leveraging meta-transaction to sponsor all gas for your users.
  • And one of their products Hyphen lets you offer instantaneous value transfers between EVM chains, various L2s & allows quick onboarding from L1 to L2s with simple APIs.

Read the docs here.

How Biconomy solves this by their protocol design

In the Building blocks, we discussed what are the solutions that Biconomy provides. Now let’s dive deep into the execution and implementation part, how the protocol works and how they managed to do this.

If we over-simply the protocol design and try to see it from a distance we can broadly say that there are 3 entities that make up for the utility that this protocol provides. These are Validators, executors, and the different smart contracts of the protocol.

1. Multi-chain Meta transactions

It enables meta transaction support for any dapp across multiple chains. There are two distinct roles that manage the relayer infrastructure — “Executors” and “Validators”. Executors run the realtor nodes and are responsible for the meta transaction on the blockchain while validators verify the executors’ transactions and help secure the network.

Executors

Executors run the relayer nodes in the network. They have key parameters of their performance such as premium fee charged, transaction success rate, total uptime, etc. Executors can only decide their premium fee charge per relayed transaction while the rest of the parameters will depend upon their relay history.

Executors will relay the received transaction and pay for gas in order to get the transaction included in the next block on the destination chain. The executors will be reimbursed the gas fee in the destination chain’s native token. They will also receive the premium fee in the same transaction. After validators successfully verify the relayed transaction, they will also receive a reward in $BICO for the work that they have done.

The dapps get a list of all eligible executors from the Biconomy blockchain with their performance parameters and reputation details. They can either choose a relayer address based upon these parameters or can set default criteria to automatically choose the best one available on the pool.

💸 Executors’ payout per transaction = gas fee + premium fee + $BICO rewards

Validators

Validators verify the relayed transactions by the executor nodes. After executors successfully relay a transaction they send the details in a biconomy transaction. Validator nodes verify the information provided in the biconomy transaction. Verification is done by checking the receipt on the destination chain and cross verifying the receipt data with the data sent in the Biconomy transaction. Each validator verifies the transaction and once they reach a majority, it is included in the next block.

Validators get rewarded once their transaction gets included in the biconomy blockchain.

💸 Validator’s payout per block = $BICO block rewards

An Example of a Multi-chain meta transaction

Let’s say you want to stake a few tokens on a Defi dApp.

  1. You initiate a contract call from the Defi dapp’s website. Defi dapp forwards that cal to one of the executor nodes in Biconomy’s decentralized realtor network.
  2. The executor relays the staking transaction for the end-user and pays the required gas fee. The transaction gets successfully added to the destination chain. Once verified, the dApp pays the gas refund + the small premium charged by the executor. Also in the same transaction itself, the executors will be refunded for the gas they have spent in native chain tokens and the premium.
  3. Once the transaction has been successfully relayed, the executor node creates a Biconomy blockchain transaction with the details of the relayed transaction to claim their reward.
  4. Validators see this transaction and they cross verify the data received in the Biconomy blockchain transaction with the information present on the destination chain. Once a majority of the validators reach consensus and the information is verified, the data is added to the next block in the Biconomy blockchain
  5. When the relayed transaction gets added to the Biconomy blockchain, the executor gets a reward in $BICO token.

2. Cross-chain transactions

Across different chains either you would either transfer your assets or interact with a smart contract. Biconomy makes it simple and hassle-free let’s see how.

A. Cross-chain asset transfers

With the help of Validators and executors, the protocol provides cross-chain asset transfers for users. Which enables instant transfer of funds between various chains. The validators continuously listen for these asset transfer requests from the users on the source chain. The user deposits their funds on any source chain. The executors will initiate the final transfer to the user on the destination chain.

Validators

They listen for transactions on each supported blockchain. They are connected to the source blockchain and they listen for deposit transactions to the Liquidity Pool manager contract on the source chain. Once validators find a deposit transaction, it will be verified by each validator and one of them will put this information in a biconomy transaction. This information will include source chain, destination chain, the token being transferred, a mapped token on destination chain, amount, decimals, and some other metadata if needed. This transaction will be included in the Biconomy Chain in the next block.

💸 Validator’s payout per block = $BICO block rewards

Executors

Executors listen to the cross-chain fund transfer requests on the Biconomy chain. They are responsible for initiating the fund transfer transaction on the destination chain. The executor will transfer the funds to the user on the destination chain and also while paying the gas fee. The executors will be reimbursed the gas fees in the chain’s native token along with the small portion of the premium fees collected from the user. After the verification that the funds have been received, the executors will receive a reward in $BICO for their work.

💸 Executors’ payout per transaction = gas fee + premium fee + $BICO rewards

Liquidity Pools

There are liquidity pool smart contracts for each chain where the Liquidity Providers(LPs) will be able to add liquidity to any token. When a user initiates a cross-chain transfer request and deposits their funds (in y tokens) to the y token liquidity pool on the source chain. The executors use the y token liquidity pool on the destination chain to send the funds (in y tokens) to the user.

When the liquidity on a particular pool decreases, APY(Annual Percentage Yield) is increased to promote people to provide more liquidity. In case no one provides more liquidity on the pool, rebalancing can be triggered by the Executors to balance liquidity across chains using Native bridges. These APY rewards will be distributed in $BICO tokens.

Apart from the APY, the LPs will get a portion of the premium fees in the ratio of liquidity provided.

💸 Liquidity Provider’s payout = premium fee + $BICO rewards

An Example of a Cross-Chain Asset Transfer

You want to transfer 1000 USDC from the source chain Blockchain 1 to the destination chain Blockchain 2.

  1. You initiate the transfer, the protocol will take your 1000 USDC & it will be deposited to the source chain Liquidity Pool Manager contract.
  2. Validators will see this deposit transaction on the source chain and will create a Biconomy chain transaction. Once a majority of the validators reach consensus and the deposit information will be verified, the data will be added to the next block in the Biconomy blockchain
  3. The executor listening to this Biconomy chain for cross-chain transfer transactions will initiate a transaction on the destination chain as per the user’s request.
  4. This transaction will release the funds from Liquidity Pool Manager (on the destination chain) to your address after deducting the premium fee. (This receiver address can be different from your address as mentioned in the deposit transaction)

B. Cross-chain Smart Contract Calls

Multi-chain dApps can seamlessly communicate between their smart contracts deployed on multiple chains using this. This enables users to instantly interact with & trigger smart contract calls on any other chain, without having to move to that chain. Here also Biconomy shines leveraging the Biconomy Network of Validators and Executors, the protocol will provide cross-chain smart contract calls.

To enable these cross-chain smart contract calls, a Gateway Smart Contract(GSC) is deployed on each supported chain. This GSC act as the intermediary contract between source and destination chain. In this case the Validators will be listening to the transaction happening on source chain GSC and verifying it while Executors will be ensuring that the smart contract call gets executed on the destination chain via the destination chain GSC.

Validators

Once they receive a GSC transaction on the source chain, each validator verifies the transaction and one of the validators puts this information in a Biconomy Transaction. The Cross-Chain Smart Contract Call for the Biconomy chain transaction contains the destination smart contract call-data and address information along with the information about the source chain, destination chain, and other metadata if needed. This transaction will be included in the Biconomy Chain in the next block.

💸 Validator’s payout per block = $BICO block rewards

Executors

When there is a cross-chain smart contract call on the Biconomy Chain, they initiate a transaction on the destination chain GSC by passing all the information. This initiates the user requested action on the destination chain smart contract.

Like before, Executors will initiate a transaction on the destination chain, they’ll be paying the gas fee on the destination chain in its native token. The executors will be reimbursed the gas fee in the destination chain’s native token. They will also receive the premium fee in the same transaction. After successfully verifying that the destination smart contract has been called, they will also receive a reward in $BICO for the work that they have done.

💸 Executors’ payout per transaction = gas fee + premium fee + $BICO rewards

An Example of a Cross-Chain smart contract call

Let’s say you have funds on Ethereum (Blockchain 1) and you want to add liquidity to QuickSwap on Polygon (Blockchain 2).

  1. You initiate the contract call on Ethereum(source chain) & send 100 USDC to be added as liquidity. This contract call contains all the necessary information to add this liquidity on QuickSwap on Polygon.
  2. The smart contract on Ethereum forwards that call to the Gateway Smart Contract (GSC) on the Ethereum chain (blockchain 1). Each validator after seeing this GSC transaction on Ethereum verifies this information and puts it in the Biconomy chain as a Biconomy transaction.
  3. The executor listening to this Biconomy chain transaction interacts with Polygon GSC (destination chain). Polygon GSC calls the QuickSwap Smart Contract on Polygon (blockchain 2) and passes the call data to it.
  4. The USDC sent by you gets added as liquidity to QuickSwap on Polygon.

3. Decentralized Relayer Network

The stakeholders contribute to the functioning & maintenance of the Biconomy network.

These are the entities that help in the functioning of the network.

  1. Node operators: Validators and Executors are collectively called Node operators. They stake $BICO to provide their service and earn.
  2. Liquidity Providers: Anybody can add liquidity to the protocol and earn a fee as well as $BICO.
  3. Delegators: Token holders can delegate their tokens to node operators. These node operators will stake the delegated tokens and pass on some of their $BICO rewards to the delegators.
  4. Consumers: The consumers are web3.0 projects that use Biconomy’s services. They pay the network proportional to the amount of work requested.

All transactions are verified by Validators on the Biconomy blockchain using Proof of Stake (PoS) consensus. In case of any false transaction on the destination chain, or funds being taken away by Executors, or any other misconduct by the Executors, the security deposit can be slashed by the Validators for every Executor node which participated in that transaction.

$BICO token

$BICO is the native work & governance token of the decentralized multi-chain relayer infrastructure.

Token Utility

$BICO act as the network fee, Incentivizes the stakeholders to secure and maintain the network, and also in participating in the network’s governance.

Network fees

As Biconomy blockchain acts as a settlement and verification layer for all activity on the network across all supported chains, the node operators (executors & validators) pay a transaction fee in $BICO to add any information on the chain and they earn $BICO proportional to the work they perform on the network.

Stakeholder incentives

  1. Liquidity providers can provide liquidity in various fo crypto assets to protocol’s liquidity pools on different chains. The small fee which is collected when a user uses the liquidity pool will be distributed to the liquidity providers. Also apart from this fee LPs will also get $BICO in proportion to their relative contribution to a given liquidity pool.
  2. Node operators (Validators and Executors) have to stake $BICO to start contributing to the network. They earn $BICO proportional to their contribution and their $BICO stake. The network can also slash their stake in the case of bad behavior.
  3. Delegators are $BICO token holders who can stake their tokens to secure the network further. They earn $BICO proportional to their $BICO staked.

Governance and Distribution

The $BICO holders can propose and vote upon decisions affecting Biconomy’s protocol and overall Network. The decisions can include changes in the network’s code, adding additional services, or regarding the decisions related to treasury funds.

Also, any $BICO holder can submit a proposal for consideration by the Biconomy community.

There are a total of 1 billion $BICO tokens in supply. And the allocation is shown below

Projects using Biconomy

  1. Curve Finance: Curve Finance is using Biconomy to do meta transactions to do gasless BTC deposits.
  2. Perpetual Protocol: Perpetual Protocol is using Biconomy to provide a seamless trading experience on the xDai blockchain.
  3. Decentral Games: Decentral Games is using Biconomy on Matic Network to provide a seamless gaming experience to its users by providing gas-less transactions on Matic Network.
  4. Sapiens Network: A social blogging platform with over 40k users

And the list goes on…

Supported Networks

Biconomy supports Ethereum, Matic mainnet, xDai, BSC, and many more including some test nets. You find out more here.

Community and Backers

Biconomy community is growing rapidly with more than 100,000+ members on their Discord server. The community is super supportive and they participate in activities like the bug bounty program and developers there are always happy to help you whenever you are getting stuck while using biconomy.

Biconomy is also backed by prominent investors in the ecosystem including Mechanism capital, Binance, Coinbase ventures, and many more.

Conclusion

As more Web3 applications give seamless user experience even to crypto newbies and onboard users quickly we can expect the ecosystem to grow while providing exciting solutions to the barrierless world.

Until then…

All the images are taken from Biconomy sources. I didn’t do deeper into the code. But if you have made it this far and want to know more, you can refer to the Biconomy Litepaper and the docs.

Disclaimer: I’m not an expert, just starting out. So Feedbacks will be appreciated Ping me on Twitter @inSitesh.

--

--

Sitesh Kumar Sahoo

Crafting independent stories, research, and designing experiences. • Twitter @inSitesh