
Since the AA narrative became popular in the Ethereum community in 2022, the concept of account abstraction has been popular in the Web3 community.It is actually a design concept about the account system, aiming to establish standards at a higher level and enhance the functionality of the account.andIn mainstream blockchains such as Ethereum, due to the limitations of fixed rules, the flexibility and universality of the account system are very poor.For example:
-
You should have Gas Tokens such as ETH in advance in your account, otherwise you will not be able to initiate transactions. Obviously, this is very unfriendly to new accounts;
-
Public chains represented by EVM systems only support a single account system, and other public chains or Web2 users need to use new account tools and portals.
The EIP-4337 proposal, which was previously popular in the Ethereum community, was considered to solve the above problems, but due to factors such as its technical model, historical burden and ecological development, and developer cognition.The patching solution of EIP-4337 is more like patching rather than fundamentally solving the problem; EIP-3074, which attempts to add a new opcode to the EVM, is considered to have a security risk.While solving old problems, new problems are brought about by controversial feasibility.
Due to various reasons, the founding team of Ethereum did not consider the account system at the beginning of the main network, leaving a lot of burdens, such as: the separation between EOA accounts and contract accounts, does not support gas-free transactions, and does not support multiple.Encryption primitives, etc.These historical burdens have caused obvious obstacles to the implementation of the Ethereum AA roadmap. It can even be said that Ethereum’s AA solution cannot allow its account system to surpass the later new public chains, but is only making up for the gap between the two.If a public chain is designed with full account design when it is initially designed, there is no need to take detours like Ethereum.
Unlike the EVM-based public chain, Nervos took into account the issue of the account system at the beginning of its design. After conducting research, we believe thatNervos’ account system is more inclined to the underlying and essentials of AA. Its UTXO account model and OmniLock that supports multiple verification methods are in-depth in line with AA’s goals from beginning to end.And it has no historical burden and is born to support account systems for other public chains such as BTC, ETH and even Solana.
In addition, for the recently popular BTCFi, since it itself introduces Defi and other scenarios for native Bitcoin assets, in order to enable Bitcoin holders to have a seamless product experience, it is necessary to be compatible with mainstream Bitcoin wallets and other peripheral facilities.CKB’s native AA solution naturally achieves this, creating the necessary conditions for the large-scale adoption of BTCFi.
Below we will interpret Nervos’ account abstract system from multiple perspectives such as design concept, system architecture, application, and ecology.
Bitcoin UTXO and Nervos’ Cell Model
Most people know that the data storage structure of the public chain based on the UTXO model is not based on the “account-balance” system, but adopts a unique form.Specifically,UTXO can be melted or minted like gold, and every transaction will have old UTXO destroyed and new UTXO is born.In addition, UTXO data is not stored in a centralized address, but is stored scatterly in the transaction that generates UTXO, and records of past blocks must be read before they can be found.
Recommended reading: “Getting to BTC: Background Knowledge Needed to Understand BitVM (1)”
It is no exaggeration to say that Bitcoin has created a storage paradigm that is different from the traditional Web2 platform’s “account-information” system, which can solve the problems of state explosion, inefficient data reading and writing efficiency, and fuzzy ownership.Under the UTXO model, the asset data storage location and ownership of different people are very clear, which is more friendly to parallelism/concurrency, and is convenient to support storage and leasing functions, which can avoid many pitfalls in the traditional account system.
At the beginning of design, the account system of Nervos public chain fully absorbed the advantages of Bitcoin UTXO.Its Cell model is actually an upgraded version of Bitcoin UTXO, providing Turing’s complete programmability.In addition, both CKB and other assets are first-class assets, and they do not treat native assets differently from ERC-20 like EVM public chains.
CKB’s Cell is roughly the same as Bitcoin UTXO in terms of operation mechanism: they are all driven by “lock scripts” and “unlock scripts”.When each UTXO/Cell is generated, there will be a “lock script”, like a password lock; and the “unlock script” is the corresponding key, which can unlock the “lock script”.As long as you can submit the “key” corresponding to the “lock”, the associated UTXO will be at your disposal.
But unlike Bitcoin UTXO,Cell has added “TypeScript” field to lock script.IfLockScript is an authentication device that determines whether you are qualified to rewrite this cell. TypeScript is a smart contract attached to the cell.The codes of DEX and lending protocols can be deployed in TypeScript.
If a developer wants to implement a liquidity pool similar to AMM on CKB, he only needs to write the contract code in the TypeScript of a dedicated cell, and then store the status information of the liquidity pool in the Data field of this cell (such as in the pool).All types of asset balances), then the user can interact with the code in TypeScript.
This design of CKB has expanded more diverse scenarios on the Bitcoin UTXO model and is much more programmable. Since CKB itself uses a RISC-V virtual machine, it supports programs written in multiple programming languages, which can be supported.Various logics are far more powerful than Bitcoin.
As forCell’s lock script LockScript is positively related to our core topic AA today.Because a major feature advocated by AA is that it allows on-chain accounts to support flexible and diverse authentication methods.For UTXO, to implement this function, you need to work hard on LockScript, which acts as an authenticator.CKB has launched OmniLock scripts that specifically support multiple authentication solutions.
Let’s learn about the specific design of OmniLock below.
OmniLock with Account Abstraction
As we mentioned earlier, the usage permissions of CKB’s Cell and Bitcoin UTXO are defined by lock scripts.LockScript will determine who can rewrite this cell to serve as authentication.To support multiple authentication methods, CKB provides a name calledOmniLock’s universal lock script is compatible with a variety of signature algorithms and verification mechanisms.
OmniLock modularly processes different verification logics. As long as different parameters are set, different verification algorithms can be flexibly configured.Users can use BTC, ETH, and even WebAuthn and other accounts, wallets/authorization methods respectively to directly manipulate assets on the CKB chain.
So how exactly is OmniLock implemented and used?In fact, it needs to be a common explanation.OmniLock is a piece of code that Nervos officially arranged directly on the CKB chain. This code is written on a specific cell and can be used by other cells, just like the “system contract” in the EVM public chain.If a cell wants to use OmniLock, you can declare a reference to OmniLock in your lock script.
Below we can understand how lock scripts and OmniLock work through a piece of pseudo-code.
The CKB lock script includes three fields: Code hash, hash type and Args. Since Code hash and hash type are not closely related to the content of this section, it will not be explained here.Next we focus on the Args field.By flexibly configuring Args, you can use different verification algorithms defined in OmniLock.
The corresponding content of the Args field can be divided into two parts, part of which is auth, which is specifically used for authentication. Its length is 21 bytes, contains 1 byte of flag identifier, and 20 bytes of authentication data.The authentication data of auth contains a preset public key hash, and only the public key owner corresponding to the public key hash can pass the authentication.Qualify to rewrite data in a Cell.
The flag in Auth is an identifier used to select different authentication methods.The authentication method mentioned here not only refers to cryptographic verification, but also includes comprehensive processes such as information processing: if the flag is 0x01, it represents the authentication method of external messages on Ethereum.In addition to Ethereum, OmniLock also supports rich message verification forms such as Bitcoin, Dogecoin, Tron, and multi-signature.
Another part of Args is called Omnilock args. It is like a button that can be selected in the functional mode preset by OmniLock.For example, use administrator mode (such as USDT’s administrator freezing function), anyone-can-pay mode for small payment (used for small donation), time lock mode, etc.Anyway, as long as Omnilock args is adjusted, you can use different functions pre-written in OmniLock.
In summary, we can enter different parameters in the Auth and Omnilock args fields of the Cell lock script to select the authentication methods for different public chains or platforms, and introduce a variety of authentication methods for CKB.Of course, in addition to the several authentication methods predefined in OmniLock, developers can also define their own authentication schemes.
Nervos account abstract ecology: CCC, Mobit and JoyID
As we already know above, OmniLock is the basis for Nervos to implement account abstraction, while OmniLock-based wallets such as Mobit, .bit, Omiga and middleware CCC (Common Chains Connector) constitute Nervos’ rich BTCFi account abstraction ecosystem, and also includesDid.id, a DID platform that provides security and privacy protection and identity management services, as well as Dobby, a decentralized Dobs asset trading platform.
The good characteristics of AA also bring great convenience to the application of BTCFi ecosystem, allowing projects within the CKB ecosystem to directly support BTC wallet interaction, lowering the threshold for use.In the following, let us take a specific case to examine the AA ecology of CKB.
Common Chains Connector (CCC)
First, let’s take CCC as an example. This is a wallet connection middleware that specifically provides the operability of various public chains to CKB for wallets and dApps.
The following figure is the connection window of CCC.Here we take MetaMask as an example. If you have an Ethereum account, how to operate the corresponding account on the CKB chain.
When using CCC to conduct on-chain transactions, the demo will redirect the MetaMask walletpersonal_signMethod to sign, this method is used to sign a text message that is not directly linked.
We can see that the content contained in this information is a series of hexadecimal codes of CKB transaction.The message signed by MetaMask will be submitted to the Nervos CKB chain and verified through mechanisms such as OmniLock.
And we mentioned earlier,Nervos itself supports verification of Ethereum’s message format. It can be said that CKB has considered connecting with other public chain ecosystems from the bottom.For users, you can enter the CKB ecosystem through existing and familiar portals and tools;
For developers, Nervos defines the OmniLock standard at the bottom and abstracts the implementation details of multi-chain wallets through CCC, greatly reducing the difficulty of development, allowing upper-level application developers to better focus on the development of upper-level business logic.Don’t pay too much attention to the underlying details.
Mobit
Mobit is a DID and asset management platform based on Nervos. If you use a metaphor, Mobit is like a gate for the outside world to enter the Nervors ecosystem, and the threshold for this gate is very low.With Mobit, users need almost no pre-emptive knowledge.Just a few simple operations can be used to complete interaction in the Nervos ecosystem using other public chain accounts.
The following figure is the connection window of Mobit.It can be seen that Mobit has currently supported account systems for multiple mainstream public chains, and this list is still expanding.
Let’s take Metamask wallet as an example.The interface after connection can also see the user’s EVM and CKB addresses, and display the Token and DOBs assets held by the address on the CKB chain.
Let’s talk about DOBs here. It is a assets unique to the Nervos ecosystem and similar to NFTs, but DOB is essentially different from NFTs.First of all, the data of DOBs are completely stored on the chain, which can be regarded as “full-chain NFT”, while many Ethereum NFT data are not fully stored on the chain;
In addition, each DOBs can set up Chatbot, and can have interactive scenarios such as dialogue with the holder. With different holdings’ different cultivation paths, compared with traditional NFTs, each DOBs will have more significant individuals.difference.
As for Omiga, the trading platform for DOBs in the Nervos ecosystem, users can directly jump to Mobit’s Apps interface with one click.
Omiga also takes advantage of Nervos’ account abstraction.
Mobit is simple to operate and comprehensive in functions, which will help BTCFi interaction.The essence of BTCFi products is to provide a diverse Defi experience for native Bitcoin assets. Whether it can be compatible with mainstream Bitcoin wallets will be an important factor that needs to be considered in the surrounding facilities of BTCFi, and CKB is currently ready.
Adoption of WebAuthn
WebAuthnIt is a network standard jointly developed by the World Wide Web Alliance (W3C) and FIDO (Fast IDentity Online) alliance.The goal is to improve the security of user authentication, simplify the login process, and reduce dependence on traditional passwords or private keys.
Some mainstream desktop or mobile operating systems such as key management software built in iOS and Android can use local security modules or cloud storage to store keys and sign them.Currently, the mainstream WebAuthn practice generally supports P-256, P-384, P-521, etc. Since Nervos’ OmniLock supports custom cryptography primitives, these can also be covered.
Here are some WebAuthn-supported clients:
-
Apple KeyChain:
-
Security Enclave: Apple’s devices use Secure Enclave to handle critical encryption operations, including private key storage and signatures.
-
iOS and macOS: Apple’s system can use the Keychain API for authentication and signature operations, or user authentication through Face ID or Touch ID.
-
Windows Hello:
-
TPM (Trusted Platform Module): Windows devices can use TPM to generate and sign private keys through Windows Hello.
-
Biometrics: Windows Hello supports fingerprint recognition and facial recognition to verify user identity.
-
Android Keystore:Android devices can use hardware security modules for key storage and signatures, and are authenticated by biometrics such as fingerprints or facial recognition.
-
Ubisoft Security Keys:Security key hardware devices, such as YubiKey, support security authentication and signature operations via USB or NFC.
CKB Eco-Wallet JoyID is an application implemented using WebAuthn technology.With JoyID, users can authenticate directly through biometrics (such as fingerprint or facial recognition), achieving seamless and highly secure login and identity management.
.bit in the Nervos ecosystem is also a scenario where Apple’s WebAuthn implementation is used to log in and use blockchain.
From the above case we can see that CKB’s AA solution is born to support other public chains and Web2 users.For the majority of Web2 users, supporting WebAuthn is crucial. It gets rid of the burden of private key and mnemonic management and greatly lowers the threshold for use.The sooner the public chain ecosystem is put into operation in this direction, the more advantage it will be in the future.
Summarize
Ethereum is limited by its historical burden problem, and existing AA solutions basically treat the symptoms but not the root cause, and cannot solve the problem from the root;Nervos fully considered the design of the account system when it started the main network and provided OmniLock function, which can support any form of identity verification.
Nervos’ Cell model is essentially an expansion of the functions of Bitcoin UTXO. Its lock script can support multiple sign-in verification algorithms. OmniLock supports any cell to be called directly in the lock script in a system contract, which is for developers.Provides a Web2-level experience with users;
At present, there are already products such as CCC, Mobit, Joyid and other products in the abstract ecosystem of Nervos account, which are basically complete;
BTCFi is essentially a Defi experience for native Bitcoin assets. Whether it can be compatible with mainstream Bitcoin wallets will be an important factor that needs to be considered in the surrounding facilities of BTCFi. As an important facility in the BTCFi ecosystem, CKB has adopted inclusive and inclusiveIn this way, we should create necessary conditions for BTCFi’s mass adoption on both the developer and user side as much as possible.