Cover photo

Introduction to Zyfi on ZKsync, Tearing Down A Barrier To Crypto Adoption

How Zyfi can make onboarding new users to crypto much easier

*All my articles are 100% written by a human (that's me AKA thoughtcrimeboss)

#ZyfiBountyContest

Just imagine, what if you could onboard somebody into crypto instantly, without needing to worry about gas fees? What if all they had to do was download a wallet app and they could just immediately start interacting with crypto dapps (decentralized applications)? This is exactly what Zyfi enables, they are like a portal into the ZKsync (an Ethereum layer 2 blockchain) ecosystem, as long as you enter through their portal, then it doesn't matter if you have Ethereum (ETH) for gas or not. If you have any ERC-20 token with value in your wallet, or if the dapp you want to use is willing to sponsor your gas fees, then you will be able to do transactions. The dreaded gas fee is currently one of the biggest barriers to crypto adoption. Zyfi is a free and open source project operating on ZKsync, that offers a solution to this problem. By utilizing a unique feature of ZKsync, protocol level account abstraction, Zyfi has developed a way for dapps to either sponsor some or all of a user's gas costs, or allow the user to pay transaction fees with any ERC-20 token instead of only Ethereum. The potential of this technology is significant and could lead to a massive increase in users for applications on ZKsync that adopt it. Let's take a deeper look at the problem of gas fees and then explore how Zyfi addresses the problem.

What if every brand of car required a different type of gas to run? That's what crypto is like.

So what are gas fees, and why are they such a barrier to widespread adoption of cryptocurrency? Gas fees, also known as transaction fees, are what makes transactions possible on any blockchain. Gas is a unit of measurement for computing power on a blockchain, and the more complex your transaction is, the more gas or computing power it requires. By paying a gas fee to either a miner or a validator, you are paying for your transaction to be included in the next available block. Each blockchain requires a different gas token to conduct any transactions. With EVM(Ethereum virtual machine) compatible chains such as ZKsync, Arbitrum, Optimism, and many others, that gas token is usually Ethereum. While the gas fees are much cheaper on most of these EVM chains then they were even a short time ago, you still have to have some gas or you aren't going to be able to do anything, just like if you forgot to put gas in your car. Unfortunately, even though ETH is the gas token for many of these chains, you can't just use the same ETH for all of them, at least not exactly. It's much more complicated than that, because there is basically a different version of ETH for each of these chains. Although ETH on Arbitrum and ETH on ZKsync are both ETH, as in they are going to be valued the same and originate from the same place (Ethereum mainnet, the granddaddy of all these EVM chains), they are not quite fully compatible with each other. If you have ETH on Arbitrum, you can't use it to pay a transaction fee on ZKsync. You would have to first use a bridge to transfer the ETH from Arbitrum to ZKSync. That means for every single EVM chain you want to use, you have to have a little ETH stored separately on each chain. It would be like if you had multiple cars, but had to buy a different kind of gasoline for each one. So to get around this problem, people use dapps called bridges to get their ETH from one chain to another, and while bridges are much cheaper and safer than they used to be, they are still a security risk. You have to temporarily lock your ETH into a bridge's smart contract and hope it doesn't get hacked before it spits the ETH back out onto the chain you want to use. This added complexity is a huge barrier to adoption, I know that even I, someone who has been using crypto for many years, am still often caught without enough gas on a chain to do any transaction at all. This can be a big problem, especially in a time sensitive situation, such as if I'm about to get liquidated on a loan if I don't add more collateral. I might have enough collateral to rebalance the loan, but not enough ETH to actually do the transaction. I am constantly having to bridge ETH around every which way and getting stuck with small amounts of ETH on many different chains. If bridging annoys me, someone who loves crypto, then I know it's likely to turn off someone who is just crypto curious.

Bridges can be dangerous...and annoying

Ok, so we have established that gas fees are annoying, but couldn't you just go onto a centralized crypto exchange and buy all the ETH you need for gas with your bank account? Then you can bridge it all to wherever it needs to go, and while annoying, it's not that big of a deal, right? Well, for many people, it is a much bigger problem that it may be for someone privileged enough to be able to easily send fiat currency to an exchange. Not everyone has a bank account or even a valid ID to open accounts with. This can be for a variety of reasons, and can be completely out of the person's control. Just being born in the wrong place can mean you may have to go through life without these resources.

As an example, let's look at a hypothetical crypto onboarding situation. Our hypothetical user, Raoul, has won $20 worth of some memecoin on an Ethereum layer 2 in a giveaway. He has never used crypto before, but is curious about it and wants to cash out his $20 of memecoins into a stablecoin. The only problem is, he doesn't have any ETH to pay the gas fee required to do a swap. In today's short attention span society, this alone might make him give up and move on to something else. However, Raoul decides to at least try to get some ETH because $20 is a lot of money to him. Raoul googles "how to get ETH" and clicks on one of the first results, Binance. Raoul doesn't yet know that he can't just buy mainnet ETH, but needs ETH that resides on the same layer 2 as his memecoin, or he's going to have to bridge it over. Raoul never gets that far though, because he quickly realizes he can't purchase any ETH at all on Binance without doing a KYC (Know Your Customer) process first. After all, Raoul might be an evil money launderer or planning to buy raw milk or something nefarious like that. Raoul can't pass the KYC because he doesn't have valid ID at the moment, and he couldn't fund the account even if he did have an ID, because he also doesn't have a bank account. He was hoping he could just make a Binance account and then go buy a Binance gift card or something to get his ETH, but that's not an actual option. He also can't use one of the "purchase crypto with a debit card" services either. Once he realizes how hard it's going to be to purchase some ETH, he just says screw it and decides to do it later. Then, in three months when he gets around to it again, his memecoin is now worth almost nothing. After realizing he lost all his money just because he couldn't swap his memecoin without gas, he gets frustrated and decides crypto isn't for him.

Raoul is so over it

That scenario, or one similar to it, has probably happened many times all over the world. One of the visions that a lot of pioneers had for crypto since day one, was that it could be a tool to bank the unbanked, by providing access to crypto versions of the financial services that someone like Raoul didn't have access to. According to a 2022 estimate by the World Bank, there are approximately 850 million people in the world who don't have valid government ID. Even more people, an estimated 1.4 billion adults, don't have a bank account at all (including me!). That means almost 1 in 5 people don't have bank accounts. The first world is not immune to this problem either, 5.4% of American households don't have a bank account. So what are you supposed to do if you want to use crypto, but you don't have an ID or a bank account? If you don't have a friend willing to sell you some ETH for cash, you can try to find a crypto meet up in your area. If there isn't one nearby, maybe you can find a Bitcoin ATM and buy BTC at a significant markup. You can then trade the BTC for ETH on one of the few remaining crypto exchanges that don't require KYC. Unfortunately, the growth in BTC ATMs has been hampered somewhat by governments around the world shutting them down and sometimes arresting their owners for the victimless "crime" of selling BTC to a consenting adult. I guess you can always beg people in a random crypto discord to send you a little ETH, which could work I suppose, but definitely isn't guaranteed. Onboarding thus remains a major challenge for the crypto space. There have been improvements to the ease of onboarding in some instances, but there has also been set backs due to government regulations and interventions. I believe someone without an ID or bank account should have just as much access to cryptocurrency as anyone else. Thankfully, despite the challenges, there are many people working towards the goal of improving onboarding and making the process as safe and simple as possible for all kinds of people.

Thanks to Zyfi, there is now a potential solution for the gas fee problem. If Raoul's memecoin prize had been on ZKsync, then he could of easily swapped it into a stablecoin by paying his transaction cost with the memecoin itself, as long as he used any DEX (decentralized exchange) that had integrated Zyfi's API. This would of eliminated all of the nonsense that Raoul went through in our earlier example. If he wanted to, he could then deposit his newly acquired stablecoins into a Zyfi enabled defi dapp to earn some yield. He could also swap again, this time easily buying some ETH, and then use that to explore non Zyfi enabled dapps. Zyfi would of enabled him to gain a foothold into crypto, starting with nothing but a memecoin. This turns what would of been a very negative onboarding experience into a very positive experience in which Raoul can go from having never used crypto to earning yield in defi in just a few steps, without worrying about getting ETH first.

How does Zyfi work it's magic? The reason Zyfi can work at all, is because of ZKsync's protocol level account abstraction feature which fixes a problem with how Ethereum's account model works. Ethereum is an account based blockchain which is different from something like Bitcoin which is a UXTO (Unspent Transaction Output) based blockchain. To enable the smart contract functionality that is lacking on Bitcoin, Ethereum uses two different kinds of "accounts", externally owned accounts (EOAs) and contract accounts. EOAs are accounts that are controlled by whomever has the private keys. Any personal Ethereum wallet, like Metamask, is an EOA. Contract accounts are smart contracts that have been deployed onto the Ethereum blockchain or any EVM compatible blockchain and they are controlled by code rather than by anyone with the keys. EOAs are free to create and initiate transactions. Contract accounts have a cost to deploy, and can only perform a transaction in response to another transaction. By sending a transaction from an EOA to a contract account, you can trigger a number of different actions in response, based on the code of the smart contract. Unfortunately, the fact that only EOAs can initiate new transactions creates some problems for specific use cases, such as smart contract wallets and privacy protocols. ZKsync fixes those problems by using account abstraction to enable smart accounts and paymasters. Smart accounts are like EOAs except they are programmable like contract accounts, so it's like having the features of both account types in one. This enables so many new exciting capabilities, including the ability to batch multiple transactions into one, automatic subscription payments, and even the recovery of private keys if lost or if you die (key recovery is another major barrier to crypto adoption). Paymasters are just accounts that act as intermediaries between a user and a dapp. Once a user grants approval, a paymaster can pay transaction fees on behalf of the user without the need for them to have any ETH.

Even without ETH in my wallet, I can still do this swap on Zyfi by selecting USDT as my fee token!

There are currently 3 different paymaster products that Zyfi offers through it's API, the ERC20 paymaster, the sponsored paymaster, and the permissionless multi-signer paymaster. The ERC20 paymaster allows the dapp to let the user pay their transaction fee using any ERC20 token on ZKsync. This ensures that no user will ever find themselves in the position where they have value in their wallets, but can't do any transactions because they don't have enough ETH. The sponsored paymaster allows a dapp's team to deposit ETH into the vault contract, which will then be used to cover either a percentage of or the entirety of a user's transaction costs. The multi-signer paymaster allows several different addresses to approve the transaction and share the responsibility of paying any gas fees. Any dapp on ZKsync can easily integrate Zyfi's paymaster API to enable gasless transaction functionality. Many dapps have already integrated this API, including Gravita, Zerolend, Increment Fi, and zkMarkets. Users can connect to the dapp's front end and simply sign a gasless transaction to approve the paymaster, which then allows them to pay gas fees with any token, or for the dapp to cover the gas fees partly or entirely.

After signing 2 gasless transactions, my swap is complete, paid for with USDT. Absolutely beautiful.

The potential of Zyfi is just beginning to be explored, there are all kinds of exciting use cases. A new game could easily use Zyfi to sponsor all transactions conducted during an introductory trial period or special event, so that a new player can just start playing the game without having to have any balance in their wallet whatsoever. The new player could even potentially earn some tokens by playing the game, and then use those tokens to pay for their transaction costs after the introductory period is over. This alone is a "game changer" for crypto games, because you can recruit players from all over the world who don't necessarily have any crypto, and they can be easily be onboarded into the game and earn rewards that they can use to explore other dapps. This enables a simple conversion from a crypto curious gamer to someone who now uses crypto on a regular basis because that initial gas fee friction was removed by ZyFi. Personally, I am keen to keep an eye on any games that integrate ZyFi, because there is a good chance one of those games could be the next breakout dapp in crypto, simply because of how much easier it will be for them to acquire new users. Zyfi can also benefit NFT communities who can enable gasless transactions for anyone holding a particular NFT. Someone could be on boarded to crypto as easily as creating a wallet and receiving an NFT that lets them use certain dapps without paying for gas. Any new dapps could sponsor transaction costs for all users during a grand opening style event, which should make recruiting new users much easier, thus solving one of the biggest problems for new dapps.

Could Zyfi enable a breakout crypto game?

Another very exciting possibility is that Zyfi could enable much easier adoption of stablecoin payments. Let's say you wanted to pay someone for a good or service in stablecoins, but they haven't used crypto before. Before paymasters and account abstraction, you would of had to send them both the stablecoin and some ETH to get them started, as well as explain to them why they are getting two different tokens. Gas fees just make it way more complicated to get someone who hasn't used crypto before to accept your payment. With paymasters, you could simply have them download a wallet app, send them $20 of USDT (tether, a popular dollar pegged stablecoin), and they could instantly deposit that USDT into defi and earn yield on it until they need it again. The reason this particular use case excites me so much is that it could lead to the use of crypto for payments spreading far and wide because it just makes it so much easier to get started!

Zyfi continues to grow (Courtesy of Dune Dashboards)

Zyfi and Zksync, with their paymasters and account abstraction capabilities, are at the very bleeding edge of crypto development. Even with the many projects that have already integrated Zyfi's API, many more are going to come onboard in the future and expand the reach of Zyfi's gas abstraction layer on top of Zksync. An entire ecosystem is forming, comprised of crypto dapps that are easier to onboard into then ever before, and this could very well propel Zksync to the top of a competitive layer 2 environment. Zyfi has already processed more than 1.3 million transactions since it launched and that number continues to grow rapidly. I know I personally will be paying close attention to see if this technology has the effect on new user growth that I suspect it will. I have only scratched the surface of this in this article, so if you would like to find out more about Zyfi, check them out here. I encourage you to try it out on your own and see for yourself how it works.

Loading...
highlight
Collect this post to permanently own it.
Thought Crime Trap House logo
Subscribe to Thought Crime Trap House and never miss a post.
#zyfi#zksync#web3#crypto#defi#ethereum#zyfibountycontest