Author: Cameron Dennis, core contributor to NEAR protocol; F.F, head of web3 infrastructure research at LBank Labs; Translated by: Jinse Finance xiaozou

1 Introduction

The proliferation of different blockchains, rollups, and modular components has brought great complexity and severe fragmentation to the Web3 ecosystem, making it difficult for users and developers to get the best experience, as countless chains will cause fragmentation of liquidity, applications, and users. The corresponding complex user interface is difficult for mainstream users to operate efficiently.

Bridging assets between different chains often involves a confusing and non-intuitive process of wrapping tokens. Furthermore, cross-chain bridging mechanisms are inconsistent and cumbersome, presenting vulnerabilities and security risks. This lack of standardization not only hinders the seamless transfer of assets, but also exposes users to potential security threats. Additionally, the liquidity of non-native assets on various chains is often limited, further complicating the asset transfer process.

The recent Bitcoin Renaissance event has created a strong demand to bring smart contract functionality on-chain, exacerbating the challenges of compatibility and interoperability between different chains.

To achieve the vision of mass adoption, a unified account system is essential. This system will allow users to seamlessly interact with applications on various chains and automatically bridge or exchange assets. This eliminates the need to manage accounts for multiple chains separately (each chain requires a different wallet interface). The ability to sign transactions on any chain with a single NEAR account simplifies user interaction through a unified interface, enabling seamless transactions.

The NEAR protocol stands out as a comprehensive solution for Chain Abstraction, with a core focus on promoting mass adoption. NEAR aims to lower the barrier to entry for users, reduce developer friction, and provide seamless services. It allows accounts to be created and restored using an email address, accounts to be used without accessing funds, and control accounts on other chains. Despite the complexity of its underlying system, NEAR provides a very easy-to-use platform with an enhanced user experience.

The focus of this article is to take a deep dive into the basic components of NEAR chain abstraction, including Account Abstraction, Frontend Abstraction, and Backend Abstraction. We will also explore potential new use cases enabled by these abstraction layers.

2. Login abstraction: native domain name system

Account abstraction, which has been built into every wallet on the NEAR protocol since its initial launch in April 2020, has been a prominent topic in the Ethereum ecosystem over the past year, with EIP 4337 sparking a lot of discussion. However, there is still a lack of consensus on the exact definition of the concept of account abstraction. Generally, people tend to include auxiliary functions such as social login, multi-signature capabilities, and gas fee payments under the umbrella of account abstraction. Essentially, account abstraction refers to the ability to programmatically establish the validity conditions of transactions and execute transactions using smart contracts.

The NEAR protocol introduces a native domain name system that associates human-readable accounts with numerous keys of different permissions with different functions. NEAR also provides the ability to convert external accounts (EOAs) into smart contracts. Therefore, what is considered "account abstraction" on other blockchain platforms is an inherent aspect of the NEAR architecture and a built-in feature of the protocol.

(1).near is the original account abstraction

The near account model forms the basis of NEAR smart contracts, providing high composability and a wide range of user possibilities.

FastAuth is a critical key management system that allows users to recover or register a NEAR account using their email address. The feature provides a web2-like login experience without the need to store mnemonics or passwords. Instead, keys are protected through advanced "Passkeys" technology, which replaces passwords with biometric data such as fingerprints or FaceID associated with a specific device. Users can regain access to their accounts at any time using their email through the MPC recovery service.

The next version of FastAuth is scheduled to be released this month and will include mapping of NEAR addresses to EVM, Bitcoin, and other blockchain addresses. This feature will enable NEAR accounts to sign transactions on other chains, thus enabling seamless development of multi-chain applications directly in NEAR’s smart contract environment.

(2) .tg opens a new era

Each NEAR account can be associated with various access key pairs. If we think of a NEAR account as a real person, then this person can hold different keys to access various protocols, and even hold different keys to navigate different chains with different signature algorithms.

The integration with Telegram unlocks the full potential of NEAR, thanks to its WebAssembly-based runtime. Until now, users of the NEAR protocol have been limited to a single top-level domain, .near. However, the introduction of the .tg domain opens the door to a plethora of opportunities.

Leading mainstream exchanges have begun supporting deposits and withdrawals for .tg accounts, paving the way for smoother integration of other top-level domains.

Telegram has proven to be a gateway to mass adoption through HOT DAO, a multi-chain MPC network that allows users to create and manage wallets on Telegram. According to DappRadar, HOT DAO has an average of 3.88 million weekly active users over the past 30 days. The weekly active users of this app alone exceed those of Solana, Base, and BNB combined (June 5, 2024).

This wallet demonstrates that the user experience can be similar to familiar mobile applications. In addition, it also has the ability to introduce multi-chain functionality, providing users with chain-agnostic Dapps.

3. Front-end abstraction

(1) Gateway to NEAR Protocol

The Web Assembly-driven blockchain operating system (BOS) marks a groundbreaking step for the NEAR protocol towards the Open Web. While NEAR is not the first public chain that can host static resources, it is the first public chain to propose a composable decentralized front-end approach. By leveraging the cost-effective storage and computing power of the NEAR blockchain, the code of the NEAR component is stored entirely on-chain within the SocialDB smart contract.

A composable decentralized frontend refers to a framework that can be seamlessly integrated with any Web2 or Web3 backend and any wallet. BOS inherits the design of React, and each component is built on top of a React component. This structure promotes contributions to the open source codebase from a large community of developers proficient in JavaScript. It is worth noting that many frontend components can be reused through forked protocols, such as a DEX platform modeled after Uniswap.

In addition, the combination of components similar to Lego blocks allows complex applications to be built. This approach simplifies the process of publishing a unified platform, providing users with a comprehensive experience and facilitating cross-protocol operations on a single page. NEAR's official website near.org is not only a social platform, but also a component store for developers and a Dapp store for users.

Interoperability between NEAR components and smart contracts is often overlooked when discussing BOS. NEAR components can interact seamlessly with smart contracts on the NEAR blockchain. The view method allows anyone to make free queries, while the call method requires the user to authenticate.

(2) Gateway to L2

The decentralized front end can provide easy-to-use components and build on top of the chain abstraction.

As a universal gateway to Ethereum L2, DapDap provides a seamless and user-friendly platform that simplifies the operation of the entire DeFi by integrating it into a single UI. DapDap supports more than 10 Ethereum L2s and over 100 dApps, standing out as the ultimate DeFi solution for easy login and seamless exploration of the open network.

In addition, DapDap is not limited to L2, the ecosystem and protocol of the EVM chain are essentially the same, including decentralized exchanges, lending platforms, and NFT markets. This unity makes it possible to create a comprehensive platform across various EVM chains, providing users with a one-stop solution to navigate the decentralized financial space.

4. Backend abstraction: chain signature

(1)TSS

The underlying technology that facilitates this is Chain Signatures, a groundbreaking threshold signature protocol that leverages a network of multi-party computation (MPC) signers on NEAR.

MPC is not a new concept and has been used in solutions such as Coinbase Wallet, where users keep one key and centralized parties keep other keys. MPC has several distinct advantages:

  • The user experience remains the same as traditional applications.

  • MPC can support any chain, whether it supports smart contracts or not (e.g. Bitcoin and Doge).

  • It supports the underlying elliptic curves of multiple chains at the same time. For example, Bitcoin and EVM use ECDSA-based curves, while chains like NEAR, Solana, and Cardano use the EdDSA algorithm.

One challenge with traditional MPC signature methods is that updating a node requires generating a new public key. However, integrating the new threshold signature protocol with the key re-sharing process enables MPC signers to maintain the same aggregate public key even as key shares and nodes are constantly updated.

When MPC is applied to chain signatures, each user on each chain will generate a different address, allowing them to deposit assets into these addresses for seamless exchange.

A key advantage of NEAR is its account model, which is essentially a domain that controls a set of private keys. Smart contract wallets can directly request validators to sign any arbitrary payload, such as transactions on Bitcoin or Optimism. NEAR integrates programmable MPC capabilities among its validators.

(2) Mature components

  • Meta Transaction

Meta transactions are a basic transaction type in the NEAR ecosystem that allow users to trade on the NEAR protocol without owning any gas or tokens. This process involves users creating and authorizing off-chain transactions, while third parties called relayers pay submission and execution fees, thereby simplifying the process of users logging into the NEAR platform.

Meta transactions only work with relayers, an application layer concept that operates off-chain. While realers may initially offer their services for free, other payment models may be required for long-term sustainability. Users can compensate relayers through methods outside the NEAR blockchain or using fungible tokens on the NEAR network.

This feature paved the way for chain abstraction and the introduced relayers played a vital role in supporting this initiative. Sweat was the first protocol to adopt this feature and successfully converted its millions of Web2 users to Web3 users.

  • Intent Relayer

Based on the intention of realyer development and construction, NEAR needs a key component to support user transactions across heterogeneous chains: a realyer network. This network monitors responses from multi-party computation (MPC) services, processes signed transactions, and submits them to their respective corresponding chains to complete the transaction.

The architecture follows an intent-based infrastructure, where NEAR contains a complex multi-chain intent network. This setup simplifies the integration of AI intent capabilities in ecosystem projects, in line with the upcoming AI-driven future.

  • Multi-chain Gas Relayer

When used with chain signatures, the multichain gas relayer allows applications and users to avoid handling multiple gas tokens across different chains. It efficiently manages gas payments on the respective chains, enabling users to use one token for all gas transactions.

NEAR enables wallet and application developers to explore options such as using application tokens to pay for multi-chain transactions, implementing a fixed-fee subscription model, or offering discounts to incentivize specific user behaviors.

Additionally, the Sweat Economy protocol has demonstrated its functionality on testnet, marking a major development milestone.

5. New design space for cross-chain dApps

Currently, applications only target the user base of the single chain they were issued on. However, being able to use applications on all chains through a single account unlocks a range of previously challenging use cases for founders and developers.

(1) Multi-chain wallet

In a NEAR account, users can manage any number of keys, support key rotation for enhanced security, and implement a multi-signer model. Multi-chain Gas Relayer further simplifies the complexity associated with various gas tokens on different chains. With chain signatures, people can effectively "NEARize" accounts on different chains, facilitating account abstraction at a multi-chain scale - from Ethereum and Solana to Bitcoin.

Wallet developers can easily leverage NEAR’s decentralized composable interface to integrate applications from all chains directly into their wallet experience. For example, the wallet is a prime example of such an integration.

Additionally, the account abstraction feature provides the possibility of social recovery. Consider a social_recovery.near contract that maintains a record of friends associated with a specific account root.near. Initially, the root.near account adds a public key that the social_recovery.near account can sign with a chain signature. A friend can initiate the recovery process by forwarding a new user-provided public key to social_recovery.near. Upon receiving a sufficient number of such requests, social_recovery.near can sign a NEAR transaction with the signer root.near adding a new key representing its own remote key. This transaction, once executed, immediately adds a new key to root.near, enabling the user to recover their account through the social recovery flow they have pre-set up for potential account recovery needs.

The concept of Sender Wallet promises to revolutionize the user experience by simplifying private key management in several fundamental aspects. First, it simplifies the process for users by providing Ethereum accounts that are instantly generated from your NEAR account. Second, it supports atomic swaps, allowing seamless transactions between NEAR accounts and other chains, thereby improving transaction efficiency. Finally, Sender Wallet supports paying gas fees in preferred tokens, enhancing the flexibility of transaction management.

According to DappRadar, Here Wallet is recognized as one of the leading dApps with the most unique address active wallets (UAW).

Initially, Here Wallet launched as a mobile wallet designed to provide a superior user experience. However, despite its merits, it struggled to gain substantial traction.

The recent shift to the MPC wallet via Telegram has completely changed this. Telegram has a huge user base, a significant portion of which are active participants in the crypto space. This shift means natural growth of NEAR users, leading to real user stickiness.

In the cryptocurrency space, token incentives play a key role, and Bitcoin mining is an example. Here Wallet's HOT mining campaign has proven to be very successful, attracting more than 8 million users in just 6 months. The appeal of HOT mining and referral mechanisms initially succeeded in attracting users, but as Here Wallet continues to launch new features and applications - such as NFT marketplace MITTE in the HOT App Store - they will still play a role in continuing to explore the ecosystem.

(2) Non-smart contract chain ecosystem

Chainsignatures enable developers to leverage NEAR as a smart contract “layer” for chains that do not natively support this functionality.

NEAR smart contracts can act as escrow contracts, effectively managing ownership. Based on this basic functionality, developers can create exchange or lending protocols that accommodate assets from multiple chains, even those with unique state.

In the trustless Bitcoin Ordinals market system running on East Blue’s NEAR, the workflow ensures secure and transparent transactions between sellers and buyers. Sellers establish a deposit account associated with their Bitcoin wallet through the market contract. The market contract specifically requires MPC signers to trade on behalf of Bitcoin accounts. Sellers have ownership of their Bitcoin accounts in the smart contract state, allowing them to deposit and withdraw Ordinals. After depositing and listing an Ordinal with 10 USDC, sellers will be restricted from withdrawing that Ordinal if an active order is associated with their listing. The market contract protects buyers by preventing sellers from making unauthorized withdrawals. In turn, buyers deposit USDC into the market contract and continue to receive the specified 10 USDC listing. The trade is only executed after both parties confirm that they agree to the account swap transaction, which is automatically processed by the market contract within a block.

6. Data Abstraction: NEAR DA

Integral to NEAR’s vision of seamless blockchain interoperability is its fast and low-cost approach to Data Availability (DA). As Layer 2 rollup solutions gain traction, solving the challenge of efficient and cost-effective data storage becomes critical. NEAR’s DA solution provides a comprehensive architecture that is carefully designed to leverage the network’s inherent high speed and low cost to provide a powerful and scalable storage layer tailored for rollup data.

At the heart of NEAR DA is the Blob Storage Contract, a dedicated smart contract that enables decentralized storage of arbitrary DA blobs directly on the NEAR blockchain. By leveraging NEAR’s consensus and receipt processing mechanisms, the contract ensures efficient and secure storage without overburdening the consensus layer with excessive data. In addition to this innovative storage solution, there is also the Light Client, a trustless off-chain component that supports advanced features such as KZG commitments, erasure coding, and storage connectors. This versatile client allows rollup providers to build complex proof systems by verifying transaction and receipt inclusion proofs, further improving the credibility and transparency of DA solutions. In addition, the DA RPC Client serves as the main interface for seamless interaction with NEAR’s DA system, providing a consistent and concise experience across a variety of programming languages.

7. Liquidity Abstraction: Bridgeless Cross-Chain DeFi

One of the most compelling aspects of chain signatures is their ability to eliminate the need for bridges, facilitating cross-chain transactions through the MPC signature protocol. There is a high demand for DeFi platforms that span multiple chains. Some notable use cases are native cross-chain swaps (e.g., exchanging XRP on Ripple for NFTs on Solana), the implementation of cross-chain lending order books (e.g., using X on Optimism as collateral to borrow Y on Arbitrum), and the ability to re-collateralize any asset on any chain while managing the associated rewards or penalties from NEAR.

This capability is especially valuable for applications like DapDap, which is developed on the NEAR protocol and allows users to explore and participate in DeFi applications across different L2 solutions within a unified interface. While DapDap currently provides on-chain front-end components for interacting with L2 solutions, users still need to switch network settings on MetaMask to sign transactions. What if users could simply log in to their NEAR wallet and sign transactions on any preferred blockchain?

The NEAR Protocol introduces a novel solution that may provide the most cost-effective way to trade assets on-chain without having to worry about the high transaction fees and latency issues on traditional chains such as Bitcoin and Ethereum. Through smart contracts, users can trade derivative paths, enabling them to trade specific assets deposited in remote accounts without having to involve the entire account in the trading process. For example, a decentralized exchange (DEX) can maintain a path derivative of asset ownership on each chain and support direct asset trading through remote addresses without incurring settlement fees on other blockchains.

8. Conclusion: Prerequisites for User-Owned AI

NEAR's chain abstraction provides a solution to the fragmented blockchain environment, enabling seamless interaction between all chains. This approach combines account abstraction, front-end abstraction, back-end abstraction, liquidity abstraction, and data abstraction, allowing users to participate in the decentralized ecosystem as seamlessly as they use their favorite centralized applications.

However, NEAR's vision goes far beyond mere chain interoperability. Its ultimate goal is to provide a fully autonomous operating system equipped with a personal AI assistant that optimizes to the user's needs without compromising privacy. The platform will support peer-to-peer interactions and transactions between all AIs owned by individual users, while also supporting the establishment of shared community AIs governed by their respective members.

These community AIs will represent the collective knowledge and needs of their members, ranging from small clubs and startups to city, national, and even global-scale communities. With the ability to fork existing communities and create new ones, governed by the members themselves, this ecosystem fosters innovation and self-determination. By selectively curating the data used for training and enabling private inference through cryptographic proofs, these community models ensure transparency and verifiability, paving the way for a future of AI that is truly owned and controlled by the people.

As the NEAR ecosystem continues to grow, its focus on harnessing the potential of verifiable, user-owned AI will become increasingly important. By leveraging chain abstraction infrastructure, NEAR is expected to facilitate the development of innovative AI applications that go beyond the blockchain, enabling individuals and communities to shape the future of the open web.