Author: Xiaozhu Web3
Blockchain wallet is the entrance to the blockchain, used to create accounts, manage assets, participate in the ecosystem and transactions. Compared with Alipay, it is more decentralized, anonymous, and has clearer asset ownership. Wallets have evolved from simple forms in the early days to multifunctional ones today, including DEX and financial management, but they still face challenges in private key custody. Smart contract wallets and account abstraction are solutions to the private key problem. In the future, wallets may integrate more functions and become the core tools of Web3.
What is a blockchain wallet
Blockchain wallet (hereinafter referred to as wallet) is the entrance for users to access the blockchain and is the user's pass in the Web3 world.
Wallets usually include the following functions:
Create a blockchain account
Since the process of creating a blockchain account is relatively complicated, the existence of wallets can help users simplify these processes. Generally, after creating an account, the wallet will guide the user to back up the private key or mnemonic, and then perform a secondary verification to ensure that the private key or mnemonic backed up by the user is accurate.
Manage blockchain assets
The existence of wallets greatly facilitates users to manage their own assets, mainly including transfers, collections, viewing asset details, transaction details, etc. The functions are similar to bank apps. You can see what assets you currently own, how many, and transfer your assets.
Explore the blockchain ecosystem
Currently, some public chain designs will encourage users in the ecosystem to actively participate in the construction of the public chain ecosystem. The main forms include node voting, referendums, staking, etc., which can all be participated in through wallets.
And some large DApp applications exist in the form of third-party independent APPs. When experiencing these APP-based DApps, wallets are also needed as a medium for login and transaction authorization.
Transactions
Some wallets also support crypto asset trading services such as currency exchange, exchange trading, and OTC trading. Among them, OTC (Over The Counter) trading is a point-to-point transaction outside the exchange, guaranteed by a third party, and is currently the main way of one-to-one trading between legal currency and crypto assets.
Others
Since wallets naturally have financial attributes, some wallets will integrate a variety of financial tools and functions including mining pools, financial management, mining, project investment, etc., which can meet the needs of users for asset appreciation.
Compare with "Alipay"
For users who are new to blockchain, we can first compare blockchain wallets to "Alipay" from a non-strictly defined perspective.
Similarities with Alipay:
Both can manage assets, make payments and transfers, view assets, etc.
Both can manage identities and authorize logins to access third-party apps or websites
Differences from Alipay:
Alipay is a centralized product controlled by Ant Group, while blockchain wallets are native to decentralized blockchains and are almost impossible to control
Creating an Alipay account requires an ID card and mobile phone information, which can be retrieved if lost. Blockchain wallet accounts are anonymous and almost impossible to retrieve if lost
The Development and Challenges of Wallets
When Bitcoin was first created, wallets were very simple and it even took several days to synchronize and download the entire Bitcoin ledger before they could run. At that time, only a few geeks who operated on computers could use wallets. The picture below is the world's first Bitcoin wallet designed by Satoshi Nakamoto, the founder of Bitcoin:
With the development of Bitcoin, on June 29, 2011, Bitcoin payment processor BitPay launched the first Bitcoin electronic wallet for smartphones. This was a historic step for wallets to reach ordinary users, but its main feature was that it could only store Bitcoin.
In November 2013, nearly five years after the birth of the Bitcoin Genesis Block, the Ethereum white paper came out, announcing that the blockchain had entered the 2.0 era and smart contracts began to be used in the blockchain. At this time, in addition to transferring and receiving payments, wallets can also perform on-chain contract operations.
In 2018, the word DeFi was first proposed on Telegram. With the launch of protocols such as Compound, Uniswap, and DAI, the Ethereum ecosystem began to flourish. After the outbreak of yield farming and aggregators in the summer of 2020, trading activities increased significantly, DeFi liquidity mining became popular, the number of blockchain wallet users exceeded 50 million, and blockchain wallets entered a period of rapid expansion.
From 2021 to date, with the narrative of cross-chain and Layer2, blockchain wallets have become a popular choice for people to store assets and transactions. At the same time, supporting cross-chain assets has also become one of the key considerations for users when choosing wallets.
In 2022, at the Devcon 6 conference held in Bogota, Tomasz Tunguz mentioned some statistics of Web3: the cumulative DAU of the mainstream public chains is about 2.5 million, while the DAU of the traditional Internet is 5 billion, and the former barely reaches 0.05% of the latter. From the supply side, there are about 16,000 developers developing in Web3, while the total number of developers in the world has reached 27 million, and Web3 developers account for less than 0.06%. Therefore, Web3 is still a long way from large-scale adoption.
As the entrance to Web3, the first challenge for large-scale adoption of wallets is to solve the problem of "private key custody".
In the blockchain world, private keys control everything, and there is a consensus in the industry that "Not Your Keys, Not Your Coins".
Decentralized wallets use mnemonics and hierarchical deterministic (HD) structures to derive private keys and self-custody, which seems to mean that decentralized wallets should be the best practice for managing crypto assets. According to a report released by Finbold, there are 295 million cryptocurrency wallet users on exchanges worldwide, and only 81 million decentralized wallet users, accounting for 21.5%.
It is naturally unsafe to entrust private keys to centralized exchanges. The collapse of FTX in November 2022 is the latest in a long list of exchange security incidents. However, a large number of users are still willing to take custody risks in exchange for lower costs and ease of use. Because for the vast majority of users, although they can manage their assets independently by mastering private keys without handing over assets and data to others, the custody of private keys has become a major problem. I believe many people have the experience of writing mnemonics on paper.
According to OKLink data statistics, in 2022, the user's digital asset losses caused by private key leakage and private key loss were the largest, reaching US$930 million, accounting for about 40% of the total losses. In the blockchain world, once the private key is lost or stolen, it means permanent loss of assets, which is unbearable for ordinary users.
In order to solve the "private key custody" problem, wallet manufacturers are exploring private keyless wallets and social recovery, and smart contract wallets are one of the mainstream solutions.
Smart Contract Wallet
Ethereum's account types are divided into external accounts (Externally Owned Account, EOA) and contract accounts (Contract Account, CA).
A smart contract wallet is a contract account that behaves like a wallet, that is, a smart contract that allows users to manage assets and interact with DApps. Unlike external account wallets, smart contract wallets do not have private keys, only addresses. Therefore, smart contract wallets cannot actively initiate transactions, and can only execute transactions according to the written code after being triggered. And smart contracts need to be deployed on the chain, so the creation of smart wallets requires initial costs.
The multi-signature wallet we often talk about is a type of smart contract wallet, which requires the signature of the M-of-N key to execute transactions.
Each entity in a multi-signature wallet holds its own private key. Executing transactions requires multiple entities to pass the verification of the wallet contract. The contract generally also provides a recovery option. The majority of entities can vote to change the authorized key set, which can effectively solve the problem of the private keys of a few entities being stolen or lost.
Multi-signature wallets are widely used by DeFi protocols and DAOs, but they are not a technical path for the popularization of wallets. After all, ordinary users are already accustomed to Web2 payments and accounts, such as biometric payments and social recovery accounts.
To achieve such powerful functions in the Web3 world, it is necessary to introduce the concept of "account abstraction".
In computer science, "abstraction" refers to extracting relevant parts from a larger fragment and splitting something into smaller parts.
In Ethereum, account abstraction refers to splitting transaction verification and transaction execution from a single process into modular components that can be adjusted according to the user's personal needs.
The core goal of account abstraction is to make smart contracts as the initiating account of transactions, allowing users to customize the security model and operation model of their accounts, and completely eliminating the need for external accounts. Because external accounts are so tightly coupled with key pairs that they are essentially the same thing, it is impossible to program with custom code to authorize transactions and unlock user experience.
V God mentioned in the article "Three Transformations of Ethereum": If everyone cannot migrate to smart contract wallets, it will lead to the failure of Ethereum.
Therefore, account abstraction is of great significance to Ethereum. Once it is truly implemented, new applications, gameplay, and imagination space may be born in Web3.
Account Abstraction
Since Ethereum was launched in 2015, the discussion of account abstraction has not stopped. The latest ERC-4337 was proposed by Vitalik and others,
Introduced UserOperation, which is a special transaction that represents user intention and allows contract accounts to actively perform operations. These UserOperations are managed by a role called Bundler, which simulates the execution of UserOperation and adds valid operations to a special transaction pool. Then, the EntryPoint contract verifies and executes these UserOperations to realize user intentions.
ERC-4337 does not require modifications at the consensus protocol level, which is its biggest advantage, because it does not require a hard fork.
The verification and transaction process is separated into two smart contracts: the EntryPoint contract and the Wallet contract. The EntryPoint contract acts as a coordinator and interacts with the Wallet contract. The Wallet contract handles the user's transaction verification based on custom logic. If the Wallet contract successfully verifies a transaction, the entry point contract executes the transaction and then submits it to the next block.
This abstraction gives developers and users the freedom to program anything they want into a custom wallet contract as a requirement for a transaction to be valid. For example, a wallet contract can use multi-signatures, social recovery functions, or even quantum-resistant signature schemes.
ERC-6551 is a proposal by the Future Primitive team to connect non-fungible tokens (NFTs) with smart contract wallets in a whole new way, which can achieve more control and flexibility over assets. The protocol is called "Token bound accounts" and allows each NFT to have its own wallet address.
ERC-6551 is not an account abstraction, nor is it a new token standard. But it can be combined with smart contract wallets to significantly enhance the functionality of NFTs, making them more practical than ever before, such as achieving NFT composability, on-chain reputation, game character inventory, etc.
In principle, NFT holders create smart contract wallets by interacting with the Registry contract. The Registry contract is immutable, permissionless, and has no owner. It deploys a unique, deterministically addressed smart contract wallet for each NFT, and its control is only owned by the NFT holder. When the ownership of the NFT is transferred, the control of the account is also transferred.
With the latest ERC-4337 proposal and ERC-6551 proposal becoming the industry's benchmark, the industry ushered in rapid development in 2023, as shown in the following figure:
EIP-3074 is another proposal that has received widespread support from the Ethereum community and has been officially included in the next Ethereum hard fork.
EIP-3074 was proposed by Ethereum researcher Sam Wilson, Go Ethereum developer Matt Garnett and others. Its core is to allow any EOA account to operate like a smart contract wallet, without the need to deploy additional contracts or manual migration.
EIP-3074 introduces two new Ethereum virtual machine instructions: AUTH and AUTHCALL, which enable EOA to connect to a smart contract and give control of the transaction to the smart contract.
AUTH: Used to verify a signature and set a context variable "authorized". If the signature is valid and the signer address matches the given authorized address, "authorized" is set to the authorized address. The AUTH instruction allows a smart contract to perform operations on behalf of an EOA, thereby implementing authorized delegation;
AUTHCALL:Similar to the existing CALL instruction, it is used to perform an external call. The difference is that AUTHCALL will use the authorized address previously set by the AUTH instruction as the caller address. This means that AUTHCALL will use the authorized EOA as the sender, not the contract itself.
EIP-3074 needs to be implemented through an Ethereum hard fork. The main goal is to give EOA functions similar to smart contracts and delegate control of EOA to smart contracts. However, since the account itself is an EOA, if the key is stolen or lost, it means a complete loss of control.
EIP-7702 was released by Vitalik on May 7 this year as an alternative to EIP-3074. EIP-7702 allows EOA to temporarily adopt the functionality of smart contracts during a transaction. EOA can convert EOA into a smart contract wallet during a single transaction and return to normal state after the transaction. EIP-7702 introduces a new transaction type containing a "contract_code" parameter and a signature. During the transaction, the signed EOA account is temporarily converted into a smart contract wallet, thereby achieving the equivalent functionality of EIP-3074. EIP-7702 does not introduce new opcodes, so no hard fork is required. The main goal is to make EIP-3074 more streamlined and more compatible with EIP-4337, because the introduced "contract_code" parameter can be an existing EIP-4337 wallet code, and through an additional EIP (EIP-5003), EOA accounts can also be permanently upgraded to smart contract wallets.
In the final account abstraction, all accounts on Ethereum use smart contract wallets to manage assets and transactions, and no longer rely on traditional EOA accounts.
Current cutting-edge research on account abstraction is as follows:
Social recovery
Social recovery refers to a mechanism that uses social relationships to help users regain account access in the event of a lost key, such as using an email to reset the password of a smart contract wallet.
Users who use the social recovery function usually need to set up a guardian during or after the wallet creation process and reach a certain guardian verification threshold, such as 2 out of 3 guardians, to log in or recover the wallet. This process is often called multi-factor authentication.
Social recovery is currently a popular research direction for account abstraction. Wallets that have implemented social recovery include Argent Wallet, Loopring Wallet and UniPass.
Intent Transaction
Intent is a set of signed declarative constraints that allow users to outsource transaction creation to a third party without giving up full control over the transaction. Simply put, if a transaction specifies "how" to perform an operation, then the intent defines "what the expected result of the operation is."
Intent transaction uses the wallet client as the intent layer, allowing users to express their intentions and complete the process from intent to UserOperation.
Currently, there are only some experimental projects for intent transaction. Whether it is natural language input of intent, or disassembling goals, calculating optimal paths and executing operations, AI can play its advantages. It is expected to become one of the scenarios for blockchain combined with AI.
Device Account
Device Account (DA) is a technology that uses the hardware security module on the user's modern computing devices (such as PCs, mobile phones, tablets, etc.) to manage user keys and wallet accounts.
Device accounts rely on passwordless authentication technology Passkey/WebAuthn, which is more convenient and safer than traditional authentication methods:
Protected by the devices that store them, using biometrics as an additional security guarantee, no password is required;
Can be seamlessly synchronized between multiple devices such as mobile phones and computers through Airdrop/Bluetooth, solving single point of failure;
Can log in securely across devices, scan the code with the phone and then log in to the web page through biometrics, improving the user experience.
Summary
As one of the essential tools for participants in the crypto market, wallets occupy a very important position in the field of infrastructure. In the future, the importance of wallet entrances will surpass trading platforms and become a gathering place for Web3 traffic and one of the infrastructures of the metaverse.
While supporting payment and transfer, all DApps are integrated into the wallet, and project developers and users can gather in large numbers to form a new generation of Internet ecosystem based on blockchain technology. In this ecosystem, all online operations of users can be performed through the wallet, including social networking, short video browsing, shopping, ordering food, taxis, and traveling. The wallet will truly become the "Alipay" in Web3.