Counterfactual Wallet & NFTs on Loopring

Frankle
Loopring Protocol
Published in
6 min readAug 29, 2021

--

On August 29th, Loopring founder Daniel Wang was invited to participate in EDCON 2021 and gave a speech on the theme of “Counterfactual Wallet & NFTs on Loopring”.

Daniel:

Hey, my name is Daniel. I’m the founder and CEO of Loopring. Today I’m not going to talk about technical details, but I want to describe two features that we are very excited about in our wallet as well as our layer-2.

The first one is the counterfactual wallet. So first of all, for those of you who don’t know much about the smart wallet, a smart wallet is actually smart contract-based. So each wallet is a smart contract. It features some very nice properties.

One of them is that the private keys are decoupled from the address or the identity of your wallet so that if the private key on leaked, you can swap the private key with a new one, and then the wallet will become secure again.

The other nice property is that the state of the wallet is recovered from the logic. Because every smart wallet is behind a proxy, we can upgrade the logic behind a proxy and keep the state so these we achieve upgradeability.

While the nice and well-known feature of the smart wallet is the social recovery compared to the EOA wallet where people have to try to use best practices to keep a secret to make sure the valid are secure. With social recovery, you can just pick up the right social network and use them as your Guardians to secure your wallet.

We have been marketing our smart wallet solution for a while, but a big challenge is that deploying the wallet costs a lot of money. Right now on the Ethereum mainnet, each wallet will cost about 650K gas, which translates to, you know, about $100 sometimes.

This is a huge barrier to our massive adoption. So the idea now for us is that we want to allow people to try more wallets before they pay for the wallet creation. So how can we do that? We delay the wallet creation to a later time.

We call this undeployed wallet a counterfactual wallet. Once people feel like they like the wallet, they want to pay for the creation for the deployment, they can do it manually, or they can predefine some rules. For example, if the total asset in their wallet exceeds a threshold, then we can help them to deploy the wallet and then charge a fee.

So under the hood, a smart wallet address is created with internal states, their initial owners, their initial Guardian network, their modules, etc. When we do some, for example, for signature verification, we can delegate to another contract, and then we can just use the States, the data provided, and recalculate the address to make sure they match.

What we can do and what we can’t do with the counterfactual wallet. First of all, it is a normal Ethereum address, you can receive tokens easily on layer1 without any problem. The counterfactual wallet will be activated on Loopring layer 2. It’s fully functional on Loopring layer 2 and other layer-2s can also respect the rules in calculating the counterfactual addresses, and then support those wallets as well.

Interaction with Layer 1 DEFI is also possible with technologies such as our ethport where you deposit funds directly to Layer 2 and when you interact with, for example, Compound, the funds will be transferred directly from your Layer 2 to Compound without going through your Layer 1 contract first.

But there are some things that you cannot do with a counterfactual wallet. For example, if you transferred crypto-assets into the Layer-1 address, then it stuck there. You cannot do anything before you deploy your wallet, and some other nice features for the smart wallet cannot be used. For example, the daily quota. Those things belong to Layer 1. You cannot use those features before a wallet is deployed.

So besides this counterfactual wallet feature, we also want to make sure the smart wallet can be deployed on other layer-1 or layer-2. So right now we are working with Arbitrum, and most of the work has been done. The next step will be probably working with either Binance chain or Optimism to make sure the wallet can be deployed there. So in other words, our smart wallet will go multi-chain & multi-layer 2.

Then there will be another problem if you have your wallet on Ethereum mainnet and other people or your friends’ smart wallets are on other networks. How can you be social Guardians of each other? We have a new cool feature called a Network Notice of Recovery, which enables you to add any Loopring wallets regardless of where there was have been deployed. So we feel like this is a very nice feature, a most helpful feature for multilayer-2 deployment.

Loopring now supports NFTs, the Loopring version 3.9 supports NFTs. So on Layer-2, you can mint NFTs directly without any interactions on Layer-1. You can do other based trading on Layer-2. You can also transfer on Layer-2s. Right now we support ERC-721 and ERC-1155.

The cost per transaction on Layer-2 is really small compared to Layer-1 solutions. For example, if we compare the ERC-20 NFT trading right now with the Loopring solution, it will be at least 400 times less expensive than the Opensea trade. So we are going to launch the relayer support for NFT trading and minting an Ethereum mainnet maybe next week.

Some people ask me a question whether Loopring will launch our own marketplace. The answer is no. We don’t have a plan to launch our own NFT marketplace, but we are working with a premium owner to make sure they can launch their marketplace successfully and very soon, probably in Q4 and with a lot of other stuff.

Yeah. So that’s it. I don’t have other stuff to show. Thank you for the invitation and thank you for listening.

About Loopring

Loopring is an Ethereum zkRollup protocol for scalable, secure exchanges & payments. Loopring builds non-custodial, high-performance products atop our layer-2, including the Loopring Wallet — a mobile Ethereum smart wallet, and the Loopring Exchange — an L2 orderbook and AMM DEX. To learn more, you can sign up for our Quarterly Update or see Loopring.org.

Twitter Discord Forum Reddit GitHub Docs YouTube Weibo

--

--