Original title: "Explanation of terms: a major review of concepts related to Web3 accounts"
Original author: Zhixian, founder of Unipass
Just now At the end of Devcon, account abstraction was one of the hottest topics. Recently, you can often see abbreviations and codes such as AA / EOA / SCW / 4337 appearing in various talks, panels and information streams. In addition, the narrative began to develop in the direction of "Onboarding next billion users", and some new adjectives also began to appear before the product, such as seedless / gasless / social recovery / non-custodial. I believe that after reading these two sentences, you have already started to have a headache, so let me do my best to help you sort out what these noun concepts represent.
Reminder before reading: This article is not a serious technical document, and may be explained or compared in an imprecise but easy-to-understand language. Welcome to use this as a starting point to go deeper Explore the details of these techniques.
EOA is called External Accounts
in Chinese b>, the address generated by MetaMask that we are most familiar with is EOA. It is characterized by simple principles, such as the generation rules are:
Private key - public key - Keccak256 hash - last 20 Bytes - hexadecimal string ( EOA address)
It can be seen that this rule is very straightforward, it is all calculated by mathematical transformation, and the generated address does not have any structure and logic inside. There are also fixed rules when a node verifies whether a transaction is authorized by the address owner:
Transaction signature - ec_recover - public key - (generated with the above rules) address - Compare the addresses to be operated
If the comparison results are consistent, then the signature verification is passed, and the follow-up process will be carried out; if it is not passed, it will be returned directly, and the transaction will not be broadcast further.
Another setting of EOA is to act as the initiator of the transaction and pay gas, and the corresponding CA (contract account) can only be called by other CA or EOA. That is to say, EOA is the trigger of a transaction. No matter how many contract calls there are in the future, a transaction must be initiated by an EOA and paid enough gas to proceed.
It should be pointed out that EOA is a concept only found in Ethereum and other EVM-compatible chains (or EVM-like chains), strictly speaking, it includes BTC Mainstream non-EVM chains do not have this setting.
CA in Chinese is called contract account (also known as internal account), our common ERC-20 Token contracts, DeFi business contracts, etc. all have an address that looks very similar to EOA, which is CA.
In terms of setting, CA is an aborigine in the Ethereum world, and EOA and ETH are triggers and fuels prepared for CA's business logic; actually use it , all assets on Ethereum except ETH are carried by CA, and business logic such as DeFi is all realized by CA. However, the setting of CA's inability to actively operate and pay gas also limits its ability, as early as There was a proposal in 2016 hoping to let the CA pay for the gas itself.
Simply speaking, CA is an Ethereum account with internal logic, which can be business logic (Token contract is used for bookkeeping, pledge contract is used for lending and liquidation), or account logic (such as gnosis safe's multi-signature logic), and the latter is the concept of "SCW-Smart Contract Wallet" we will mention soon.
CA address rules are generated by calculation, there are two ways of CREATE and CREATE2, which will not be expanded here. You just need to remember that there is no necessary correspondence between the CA and the public key. For example, in the CA created by gnosis safe, you can set any number of public keys to unlock the assets corresponding to its address; of course, the CA can also not set any key , but it is determined by the logic of other CAs whether it can be unlocked, such as the DeFi loan contract, as long as the money is repaid, the pledged assets can be retrieved.
Smart Contract Wallet It should be the best understanding of the literal meaning, that is, the wallet scheme that uses CA as the address, and our commonly used EOA wallet scheme uses the aforementioned public key transformation result as the address. Due to its internal logic, smart contract wallets can implement many functions that EOA cannot implement, such as gas payment, batch transactions, rights management, offline authorization, social recovery, etc.
Here are a few examples to show the expansion potential of smart contract wallets:
1 .Gnosis safe uses the smart contract wallet architecture to realize multi-signature logic;
2. Users can send different tokens to multiple addresses at the same time in an on-chain transaction, or allow approve and Swap is completed in one transaction, so as to achieve as much authorization as is required, and avoid security risks caused by excessive authorization.
3. Users can set different operation permissions for different assets, such as setting a higher operation threshold for PFP than ordinary ERC-20 tokens (for example, an admin key managed by a hardware wallet is required to Transfer), so that even if the key is leaked in the daily use environment, hackers will not be able to transfer high-value assets away, striking a balance between security and convenience.
4. The user can sign an offline authorization "who can give me 100 ETH, I can transfer one of my BAYC", so that the user can P2P with other people without authorizing a third-party contract To complete the atomic transaction.
Account Abstraction is not actually It is a new concept, which can be traced back to some discussions in 2015. At that time, Vitalik thought that at least the cryptographic algorithm used by Ethereum to verify transactions should be replaced, such as ed25519 with better performance (see here for details), it can be said that neither Vitalik nor EF has Stop discussing and exploring account abstraction schemes, here is a well-organized link tree< /a> It can help you review the history.
So how to understand account abstraction? Here I quote ERC-4337 Description of the goal:
Achieve the key goal of account abstraction: allow users to use smart contract wallets containing arbitrary verification logic instead of EOAs as their primary account. Completely remove any need at all for users to also have EOAs (as status quo SC wallets and EIP-3074 both require)
It can be seen that Ethereum’s expectation for account abstraction is to change the current situation that most people are using EOA According to the current situation, users are expected to switch to SCW and completely remove the ecology's dependence on EOA. In addition to the EIP-3074 mentioned in it, there is a more radical and long-term EIP-5003, here are a few paragraphs of the original text (with omissions):
EOAs … are limited by the protocol in a variety of critical ways. These accounts do not support rotating keys for security, batching to save gas, or sponsored transactions to reduce the need to hold ether yourself. There are countless other benefits that come from having a contract account or account abstraction, l ike choosing one's own authentication algorithm, setting spending limits, enabling social recovery, allowing key rotation, arbitrarily and transitively delegating capabilities, and just about anything else we can imagine.
…This EIP provides a path not to ens hrine EOAs, but to provide a migration path off of them, once and for all.
It is not difficult to see that the goal of EIP-5003 is to convert EOA to CA at one time, Let all users use SCW to completely solve the problem of forward compatibility. (After the explanation of the terms above, are these abbreviations smoother?)
At this point, everyone should have an understanding of the ins and outs and future goals of AA. But it should be pointed out that the concept of AA is not exclusive to Ethereum and EVM, and many chains already have different degrees of AA features. For example, EOS / Polkadot / Near / Solona / Flow / Aptos ... even BTC (single-signature / multi-signature / Taproot), these chains have been designed to make the account have an internal structure and even have the ability to manage rights. StarkNet / CKB and others have more complete account abstraction capabilities. Speaking of this, it is not difficult to find that Ethereum's AA is solving the historical problems brought about by the unexpected popularity of EOA, so as to become more advanced and flexible at the account level.
From the above discussion on AA, it is not difficult to see that ERC-4337 is just one of many proposals in this direction , but why does everyone mention AA or SCW when they mention it? Let's look at the subtitle of this document:
An account abstraction proposal which completely avoids consensus-layer protocol changes, instead relying on higher-layer infrastructure.
That is to say, ERC-4337 is the first time that AA's line has changed from "violent revolution" to "peaceful evolution" and no longer pursues AA is implemented using changes in the consensus layer, but instead uses a user layer solution such as SCW. And in order to achieve better interoperability, ERC-4337 defines some interfaces that SCW should implement, as well as infrastructure frameworks such as meta-transaction packaging and gas payment. Its appearance enables various SCW solutions with great differences at present to have a unified user interface and share some open infrastructure built at the ecological level, which helps various scenarios to quickly realize the SCW solutions they need. On the other hand, the promotion of ERC-4337 will help to promote the compatibility of other ecological participants with SCW, such as the need for signature verification EIP-1271 and some rules defined in some DeFi protocols that prohibit CA interaction.
The seed here refers to the seed phrase, which is when we create a wallet A mnemonic that is often asked to back up. Then seedless means "without mnemonic", or it can also be said as "without private key". Note that "none" does not mean that there is no key in the actual sense, but that users are not required to back up mnemonic/private keys or perceive their existence.
A common question is, if the user does not back up the mnemonic, does the user have no control over the account? Once the user switches to a new device environment, isn't the account inaccessible? That's right, just cutting off the function of user backup mnemonic words can only be regarded as a product design error, and what seedless pursues is that users "do not need" to know the existence of mnemonic words, while still having full control over the account. In other words, the user (and only the user himself) has the ability to restore account control on the new device, but no longer relies on mnemonics, which is a poor UX and too geek way. For example, the social recovery mentioned below is very good kind.
The gas here refers to the gas fee, so gasless means " free of gas fee". Similarly, gasless does not mean that users do not really need to pay gas fees, but that users do not need to be forced to understand the concept of gas, let alone purchase various native Tokens in advance to pay for gas.
So who will pay for the gas? There are two situations:
One is when the user account already has a crypto asset, such as playing to earn to get a token, or receiving an airdrop, or It is someone else's transfer, as long as these tokens have certain value and liquidity, there will be a relayer willing to accept them and help users pay gas to earn income.
The other is that there is no valuable token in the user account, such as the account just created. If on-chain interaction is required at this time, the application side can choose to subsidize users with some "targeted" gas to help them bootstrap, thereby reducing user loss. Even if the consumption of gas subsidies is counted at this time, the overall user acquisition cost may be even higher. Low; or by allowing users to watch advertisements in exchange for some gas. Both of these strategies work very well on L2 where gas costs are low.
Social Recovery refers to the use of social relationships Mechanisms to help users regain access to their accounts in the event of a lost key. If you have used WeChat to log in to a new device, you should have had the experience of "letting two of your friends send xxx to your account to log in"-this is the effect that social recovery wants to achieve, but the verification party has changed from WeChat to smart contract.
A common misunderstanding is to call the solution of using social accounts to create/login wallets as social recovery. "Platform Account" is marked with an equal sign. The old smart contract wallet Argent has built-in social recovery capabilities. It requires your guardian to provide an Ethereum address, so that you can provide a signature for authorization when you need to log in to a new device. However, the potential setting of this solution is: your guardian Must be more professional than you in managing the Ethereum account, otherwise when you need their signature, if their own account is no longer accessible, your account will also suffer. Therefore, a more feasible approach is to use common cryptographic tools such as email cryptographic proof (DKIM Signature) or electronic passports to enhance the practicability of social recovery schemes.
Non-custodial can be said to be crypto It is one of the most politically correct and abused concepts in the industry, because in many cases each company has its own definition. Here I also share our definition of non-custodial, mainly in two aspects:
1. Wallet developers cannot operate users' accounts without authorization
< p>2. Wallet developers cannot prevent users from operating their own accountsIf you agree with these two points, then judge whether a wallet is custodial, semi-custodial or non-custodial Trusteeship can directly use these two rules to test:
Not satisfied with 1 - managed; satisfied with 1 - not satisfied with 2 - semi-hosted; 1, 2 are both Meet - unmanaged.
So what is the use of knowing what kind of hosting level is, users may not care about the principle behind it, as long as it is easy to use! That's right, in fact, I partially agree with this point of view. At least at the current stage, the industry has not yet developed to the point where a paradigm shift in user perception occurs. In fact, I think three types of solutions are suitable for different scenarios:
1. Hosting plan - suitable for Scenarios such as trading platforms, financial services of large institutions, and strong compliance, such as some services provided by coinbase. The characteristic is that the number of users is small, there is no need to deal with high-frequency interaction, and the unit price is high, which can support service providers to spend a lot of money to maintain a series of high-defense systems.
2. Semi-management solution - Suitable for relatively high-end individual user groups. They understand that the service party can review their own transactions, and has the ability to prepare a backup plan in advance (such as exporting the private key), so that the security of their assets will not be affected when the service party actively or passively refuses the service. In this way, you can enjoy safety and convenience in daily use, and you can preserve assets in extreme cases. Note that this solution has very high requirements for the service provider’s operation and maintenance capabilities. After all, there are a large number of individual users, and the daily interaction requirements with various applications are also higher. Furthermore, the data availability requirements are high. After all, once the data stored on the server is lost It is possible that all users who do not have a backup will never be able to access the account.
3. Unmanaged solution - Suitable for mass adoption-oriented scenarios. It may sound counter-intuitive at first, but in terms of cost, the unmanaged solution is the only solution that can guarantee sufficient security and availability in low unit price scenarios. If an application side facing a large-scale user scenario intends to choose the above two solutions, it must consider whether the other party can provide enough safe and available services for its user base, otherwise, once the service is shut down due to malicious insiders, hackers or force majeure, All your users will be implicated, and your business may also suffer as a result. Numerous cases in history tell a story, safety is no small matter, and being responsible for users is being responsible for yourself.
Multi-Party ComputationZero-knowledge proof (ZKP) can be called the two major "magic" of the current Web3. Once you get involved with them, it seems that you can somehow do things that you couldn't do before. In fact, this is the case in some cases, especially ZKP, where probability can be exchanged for feasibility; MPC achieves risk control or disaster recovery capabilities by decentralizing control rights.
MPC is actually a paradigm, including many technical solutions, most of which refer to tss in the current Web3 context.
Threshold SignatureYes A distributed multi-party signature protocol, including distributed key generation, signature, and re-sharing algorithms that replace private key fragments without changing the public key.
A m-n tss means that a public key corresponds to n private key fragments, and the joint signature of m fragments can be successfully verified by the public key. It is not difficult to find that this logic is similar to multi-sig, and their difference is mainly in the number of public keys.
For example, a 2-2 multi-signature is a door with 2 locks, and two keys must be used to open them both to open the door; 2 The tss of -2 is that a lock is hung on a door, but there are two keys, which can be used together to open the door. For better understanding, the description here is not rigorous. Combining two keys into one is actually more in line with the Shamir Secret Sharing algorithm; the key fragments under the tss algorithm will not meet, but after they are signed separately, they can be obtained through a specific algorithm. Pass the signature verification with the corresponding public key.
So is tss necessarily managed or unmanaged? In fact, there is no necessary connection, it mainly depends on how the final plan is designed and chosen. The non-custodial scheme requires the user to have the ability to independently operate the account, so the user must have no less than the threshold number of key fragments. Achieve semi-management (such as ZenGo); but if users manage the most private key fragments, it will inevitably increase the requirements for user capabilities, and it is difficult to achieve mass adoption.
Original link blockquote>
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia