The phase of web3.0 and decentralization, specifically in the ethereum and solana ecosystem, has tried to solve lots of challenges which are faced in traditional systems. More and more users are transitioning to these kind of open and permissionless systems. The ecosystem has been evolving and new apps are being built on top of blockchain, which are ready to use for wide adoption but the lot of consumer facing problems are yet unaddressed.
If you want to learn about ethereum, you can always start with these below
Ethereum primer/101, ETHHub, ETH for devs, and glossary.
With such wide variety of protocols and decentralized applications (dapps) being built on a lot of chains (layer1 and layer2), they've become more and more fragmented and cluttered with complicated user experience.
The end user of these protocols and dapps require significant knowledge of how things work under the hood and need to estimate their cost of interacting with them in a better way so that they do not end up overpaying or underpaying the fees (Every interaction, specifically writing to blockchain, requires the user to pay gas fees in the network's native token). Moreover, high gas prices on ethereum has also become a major hurdle for users.
Various layer 2 scaling solutions have tried tacking the problem of high gas fees on ethereum, but it introduces another set of problem such as bridging and managing funds across chains. This makes the usage and liquidity fragmented across chains.
Such drawbacks introduces friction among users and reduces usability of such products. Well, these are some of the major pain points, which biconomy is trying to solve with it's products. This post is meant to be a deep dive into Biconomy Protocol.
TLDR
Biconomy is trying to solve the above mentioned problems with it's multi-chain relayer protocol, which abstracts the technicalities from the user interaction process and makes it as simple and minimalistic as possible for the end users.
Brief one liner about biconomy
Meta transactions
To understand meta transactions, let us take a step back to understand how a transaction generally works in ethereum. Transactions are signed messages, sent by an account to be executed and recorded on the ethereum (or any EVM compatible) blockchain. The execution of transaction causes the state of ethereum network to change. In order for this to happen, the sender of the transaction has to pay gas fees (it's a unit to measure of computation required for execution of a transaction).
Well, the important thing is that gas fees needs to be payed in the native currency of the network (ETH for Ethereum), and the sender of the transaction (can be a user account or a smart contract) needs to have sufficient amount of currency for transaction execution.
So, the users have the following challenges
These challenges introduces lot of friction among users willing to operate any decentralised application. Well, we can overcome these problems because we're aware of the fact that only the account which sends the transaction to the network has to pay fees and here's when meta transactions come to rescue. We can delegate the responsibility starting from estimation of gas fees to paying the fees itself to a middleman (a relayer network).
There currently are a lot of ERC20 tokens (a token standard for evm based networks, more about ERC20 tokens here and here) and lot of protocols operate on these tokens. The same challenge of owning native tokens is faced by users when they try to interact with these protocols. It's hard to escape paying gas fees otherwise, because you'll need initial source to get native tokens like ETH. If you choose to transfer an ERC20 token to ETH, it still requires ETH to perform transfer :(
Who pays to biconomy then, you ask? The dapp developer/company, who chooses to integarte and allow their users to use the platform in a gassless fashion. The amount is aggregated (for a particular contract), which needs to be paid at certain intervals.
Basically, the users interacting with the protocols and dapps using these services, can just sign a single transaction which is handed over to the biconomy's relayer network and further to the destination blockchain.
Cross chain
The above mentioned solutions are available for multiple blockchains and layer 2 solutions, e.g. Polygon, Avalanche, BSC, etc. The protocol will enable frictionless movement of funds across chains by providing cost efficient bridges. Moreover, users can leverage it for cross-chain communication and contract calls (future goal). This all leads to a seamless multi-chain infrastructure for web3.0.
Biconomy Protocol Design
Currently, the protocol of biconomy is semi-centralised in nature, and is moving towards a fully decentralised protocol solution, in coming months. The protocol will consist of following major components
Biconomy token
BICO
is the native work and governence token. It plays a key role in decentralizing the network by acting as the network fees, incentivizing all stakeholders to secure and maintain the network, and participating in the networkβs governance.
Moreover, it will be used to pay the network fees for transactions which will be written in the biconomy blockchain. The node operators will earn incentives for contributing to the netwok and keeping the network in consensus. The delegators and liquidity providers will also be rewarded with this token itself.
As it moves towards complete decentralization, a governance mechanism will be put in place, where users can propose and vote for descisions affecting the protocol using these tokens.
Biconomy blockchain
It will be Proof of Stake (PoS) based blockchain, and users can stake their tokens to become a part of it and contribute. False actors in the network will be slashed and penalized by a slashing mechanism. Further to reduce the trust assumptions on Executors for carrying out the cross-chain transaction or smart-contract calls, Threshold Signature Scheme (TSS) will be used to distribute an authorized key that has the right to execute the transaction on the destination chain.
What next for Devs?
As a protocol/dapp/smart contract developer, you can start using biconomy right away as it's available on majority of popular chains. You can head over to their documentation and have a look at detailed explanations for using meta transactions (mexa and forward).
A quick explainer for making your dapp support meta transactions.
msg.sender
in your contracts functions, atleast in the state change ones as the transaction will be recorded on the destination blockchain by the relayer resulting in the relayer address as it's value and not the user address actually making the call. But, you can use a method (of the extended contract), which will provide you with the value of user (signer of the trasaction), but extracting it from the signature (check this contract out and it's _msgSender()
function).ββββββββpragma solidity ^0.6.2;
ββββββββimport "https://github.com/opengsn/forwarder/blob/master/contracts/BaseRelayRecipient.sol";
ββββββββcontract Relayer is BaseRelayRecipient {
ββββββββ mapping(address => string) private names;
ββββ
ββββββββ constructor() public {
ββββββββ // Polygon Mumbai Testnet forwarder address
ββββββββ trustedForwarder = address(0x9399BB24DBB5C4b782C70c2969F58716Ebbd6a3b);
ββββββββ }
ββββββββ function setName(string memory _name) public {
ββββββββ // using _msgSender() instead of msg.sender
ββββββββ names[_msgSender()] = _name;
ββββββββ }
ββββββββ function getName() public view returns (string memory) {
ββββββββ return names[msg.sender];
ββββββββ }
ββββββββ function versionRecipient() external view override returns (string memory) {
ββ return "1";
βββββ }
ββββββββ}
Hence, biconomy abstracts out a lot of hassle through their dashboard and JS SDK for the consumers.
A minor caveat
While making a contract call, generally on any EVM compatible blockchain, you can checkout the contract call being made using the wallet (preferably metamask). The image given below shows a contract call setName()
in a contract which is not yet supporting meta transactions.
You can see in data, which function is being called.
In case of meta transaction, you'll need to sign a message which first needs to be sent to the relayer network and then the relayer network is responsible for submitting it on blockchain. Think of it as a wrapper signature on top of original transaction signature.
This becomes risky, because the signing of the transaction remains is dark. A malicious dapp can ask us to sign something, and actually can make us sign something else.
Final thoughts
Now that we've seen how it works, it can be surely considered as one of the promising projects of the web3 ecosystem and will play a significant role in mass adoption of blockchain based solutions. Moreover, following a principle of progressive decentralization helps in maintaining the trade off for development and releases against bulding trust and security with time.
Finally, big ups to Superteam for onboarding great indian talent and helping in collaborative growth of the community. Check more about superteam here. Thank you for reading. Onwards and Upwards
References