#43 - NEAR Protocol: Exploring Chain Abstraction
How NEAR is Paving The Way For A Crypto-Unified System
Stanford Blockchain Review
Volume 5, Article No. 3
📚Authors: F.F — LBank Labs
Cameron Dennis — NEAR Core Contributor
🌟Technical Prerequisite: Moderate
Introduction
The proliferation of various blockchains, rollups, and modular components within the Web3 ecosystem has introduced significant complexity and fragmentation. This has resulted in suboptimal user and developer experiences, as the multitude of distinct chains leads to liquidity, app, and user fragmentation. The resulting complex user interface can be challenging for mainstream users to navigate effectively.
Bridging assets between different chains often involves the confusing and non-intuitive process of wrapping tokens. Moreover, the bridging mechanisms across chains are inconsistent and cumbersome, presenting vulnerabilities and security risks. This lack of standardization not only hinders seamless asset transfer 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 has generated a strong demand for introducing smart contract capabilities into these chains, exacerbating challenges in terms of compatibility and interoperability among different chains.
To achieve the vision of mass adoption, a unified account system is essential. This system would allow users to interact with applications on various chains seamlessly, with assets being bridged or swapped automatically. This eliminates the need to manage separate accounts for multiple chains, each requiring a different wallet interface. The ability to sign transactions on any chain from a single NEAR account simplifies user interactions through a unified interface, enabling seamless transactions.
NEAR Protocol stands out as a comprehensive solution for Chain Abstraction, with a core focus on facilitating mass adoption. NEAR aims to lower entry barriers for users, reduce developer friction, and provide seamless services. It allows for account creation and recovery using email addresses, and account usage without needing funds acquisition, and control over accounts on other chains [1]. Despite the complexity of its underlying system, NEAR delivers an easy-to-use platform that enhances the user experience.
Our focus in this article is to delve into the foundational components of NEAR’s chain abstraction stack, including Account Abstraction, Frontend Abstraction, and Backend Abstraction. We will also explore potential new use cases enabled by these abstraction layers.
Onboarding Abstraction: Native Domain Name System
Account Abstraction has been built into every wallet on NEAR protocol since its initial launch in April 2020 despite it being a prominent topic in the Ethereum ecosystem over the past year with EIP 4337 generating significant discussion [2]. However, there remains a lack of consensus on the precise definition of this concept. Often, people tend to include ancillary features such as social login, multi-sig 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 a transaction and to utilize smart contracts for its execution.
Conversely, NEAR Protocol introduces a native domain name system, associating human-readable accounts with numerous keys that possess varying permissions for different functionalities. NEAR also offers the functionality to convert externally owned accounts (EOAs) into smart contracts. Thus, what is considered "Account Abstraction" on other blockchain platforms is an inherent aspect of NEAR’s architecture, representing a built-in feature within the protocol.
.near is the Original Account Abstraction
The .near account model forms the foundation for NEAR’s smart contracts, offering high composability and extensive user possibilities.
FastAuth is a pivotal key management system that enables users to recover or sign up for a NEAR account using their email addresses. This feature provides a Web2-like onboarding experience without the need to store a seed phrase or password. Instead, keys are safeguarded through advanced "Passkeys" technology, which replaces passwords with biometric data such as fingerprints or FaceID linked to a specific device. Users can regain access to their accounts at any time using their email through the MPC recovery service.
The upcoming version of FastAuth, scheduled for release this month, will include mappings for NEAR addresses to EVM, Bitcoin, and other blockchain addresses. This feature will enable NEAR accounts to initiate transaction signing for other chains, thereby facilitating the seamless development of multichain applications directly within NEAR’s smart contract environment [3].
.tg Opens New Era
Each NEAR account can be associated with various access key pairs. If we consider a NEAR account as a real person, it can hold different keys to access various protocols, or even different keys to navigate different chains with distinct signature algorithms.
The integration with Telegram due to NEAR’s WebAssembly-based run time, has fully unlocked its potential. Until now, NEAR Protocol users have been confined to one top-level domain, .near. However, the introduction of the .tg domain opens the door to a multitude of opportunities. Now, any other widely-used platform can secure its top-level domain on the NEAR Protocol, such as .x, .ins, and more [4].
Leading mainstream exchanges have already started supporting deposits and withdrawals to and from .tg accounts, paving the way for smoother integration of additional top-level domains.
Telegram has proven to be a gateway to mass adoption through HOT DAO, a multichain MPC network that allows users to create and manage wallets on Telegram. According to DappRadar, HOT DAO has had an average of 3.88 million weekly active users over the last 30 days. This app alone if more weekly active users than all of Solana, Base, and BNB combined (on June 5th, 2024).
This wallet showcases that the user experience can mirror familiar mobile applications. Moreover, it has the ability to introduce multi-chain functionality, offering chain-agnostic Dapps for users.
Frontend Abstraction
The Gateway to NEAR Protocol
The Web Assembly powered Blockchain Operating System (BOS) marks NEAR Protocol’s pioneering step towards the Open Web. While NEAR is not the first public chain that can host static resources, it is the first to propose a composable and decentralized frontend approach. By harnessing the cost-effective storage and computation capabilities of the NEAR Blockchain, NEAR Components’ code is fully stored on-chain within the SocialDB smart contract.
A composable decentralized frontend refers to a framework that seamlessly integrates with any Web2 or Web3 backend, as well as any wallet. BOS inherits React’s design, where each component is built on top of a React Component. This structure facilitates easy contributions from a large developer community proficient in JavaScript to the open-source library. Notably, many frontend components are reusable through the fork protocol, as exemplified by DEX platforms modeled after Uniswap.
In addition to that, the LEGO block-like composition of components allows for the construction of complex applications. This method simplifies the process of launching a unified platform that provides users with a comprehensive experience and facilitates their navigation through protocols on a single page. The NEAR official website, near.org, serves not only as a social platform but also as 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 seamlessly interact with smart contracts on the NEAR Blockchain. While view methods permit querying by anyone free of charge, call methods necessitate user authentication.
A Gateway to L2s
A decentralized frontend can provide easy-to-use components for building in a chain-abstracted manner.
DapDap serves as the universal gateway to Ethereum L2s, offering a seamless and user-friendly platform that simplifies navigation across the DeFi landscape by consolidating it into a single UI. Supporting 10+ Ethereum L2s and over 100 dApps, DapDap stands out as the ultimate DeFi solution for effortless onboarding and seamless exploration of the open web.
Moreover, DapDap is not limited solely to L2s; the ecosystem and protocols within EVM chains are essentially the same, encompassing decentralized exchanges, lending platforms, and NFT marketplaces. This uniformity enables the creation of a comprehensive platform that spans various EVM chains, offering users a one-stop solution for navigating the decentralized finance space.
Backend Abstraction: Chain Signatures
TSS
The underlying technology facilitating this is Chain Signatures, a pioneering threshold signature protocol that leverages a multi-party computation (MPC) signer network on NEAR.
While MPC itself is not new—having been used in solutions like the Coinbase Wallet, where users retain one key and centralized parties retain others—it offers several distinct advantages:
The user experience remains consistent with traditional applications.
MPC can support any chain, whether it supports smart contracts or not (ie: Bitcoin and Doge).
It supports underlying elliptic curves compatible with multiple chains concurrently. For instance, Bitcoin and EVM use ECDSA-based curves, while chains like NEAR , Solana, and Cardano employ the EdDSA algorithm.
A challenge with the conventional MPC signing approach is that changing nodes necessitates generating a new public key. However, the integration of a novel threshold signature protocol with a key resharing procedure allows the MPC signer to maintain the same aggregate public key, even as key shares and nodes undergo constant changes [5].
When applying MPC to Chain Signatures, a distinct address is generated for each user on every chain, enabling them to deposit assets into these addresses for seamless swaps.
A key advantage of NEAR is its account model, which inherently involves a domain name controlling a series of private keys. The smart contract wallet can directly request validators to sign any arbitrary payload, such as a transaction on Bitcoin or Optimism. NEAR has integrated programmable MPC functionalities within its validators.
Maturing Components
Meta Transaction
A meta transaction is a foundational transaction type within the NEAR ecosystem, allowing users to conduct transactions on the NEAR protocol without possessing any gas or tokens. This process involves users creating and authorizing transactions off-chain, while a third party known as a relayer covers the submission and execution fees, thereby simplifying user onboarding onto the NEAR platform.
Meta transactions function exclusively with a relayer, an application layer concept operationalized off-chain. While relayers may initially offer their services for free, long-term sustainability likely requires alternative payment models. Users could potentially compensate relayers through methods external to the NEAR blockchain or by utilizing fungible tokens on the NEAR network.
This feature paves the way for Chain Abstraction, with the introduction of relayers playing a crucial role in supporting this initiative. Sweat is the first protocol to adopt this feature, successfully transitioning its millions of Web2 users into Web3 [6].
Intent Relayer
Building on this infrastructure, NEAR requires a critical component to facilitate user transactions across heterogeneous chains: a relayer network. This network monitors responses from the Multi-Party Computation (MPC) service, handles signed transactions, and submits them to their respective chains to complete the transactions.
The architecture follows an intent-based infrastructure, where NEAR incorporates a sophisticated multi chain intent network. This setup simplifies the integration of AI intent features for ecosystem projects, aligning with the upcoming AI-driven future.
Multichain Gas Relayer
When used in conjunction with Chain Signatures, the multichain gas relayer allows apps and users to avoid dealing with multiple gas tokens across various chains. It efficiently manages gas payments on the respective chains, enabling users to use a single token for all gas transactions [7].
NEAR empowers wallet and application developers to explore diverse options, such as using application tokens for multichain transaction payments, implementing a subscription model with flat fees, or offering discounts to incentivize specific user behaviors.
Moreover, the Sweat Economy protocol has demonstrated its functionality on the testnet, marking a significant milestone in its development.
New Design Space for Cross-Chain Dapps
Currently, applications target only the user base of the single chain on which they are launched. However, one account for using apps on all chains unlocks a range of previously challenging use cases for founders and developers.
Multi-Chain Wallet
Within a NEAR account, users can manage any number of keys, facilitate key rotation for enhanced security, and implement multi-signer patterns. The Multichain Gas Relayer further simplifies the complexities associated with various gas tokens across different chains. Through Chain Signatures, one can effectively “NEAR-ify” any account on different chains, facilitating account abstraction on a multichain scale—from Ethereum and Solana to Bitcoin.
Wallet developers can easily leverage NEAR’s decentralized and composable interfaces to integrate applications across all chains directly within their wallet experience. For instance, the wallet serves as a prime example of such integration.
Wallet developers can easily leverage NEAR’s decentralized and composable interfaces to integrate applications across all chains directly within their wallet experience. For instance, the wallet serves as a prime example of such integration.
Additionally, the Account Abstraction feature offers social recovery possibilities. Suppose there is a social_recovery.near contract that maintains a record of friends associated with a specific account root.near. Initially, the root.near account added a public key that the social_recovery.near account can sign through Chain Signatures. Friends can initiate a recovery process by forwarding a new public key, provided by the user, to social_recovery.near. Upon receiving a sufficient number of such requests, social_recovery.near can proceed to sign a NEAR transaction, adding a new key on behalf of its own remote key with signer root.near. This transaction, upon execution, adds a new key to root.near, enabling the user to recover their account through a social recovery process that they have pre-set for potential account restoration needs.
The Sender Wallet concept promises to revolutionize user experiences by simplifying private key management in several fundamental ways. Primarily, it offers Instant Ethereum Account Generation from Your NEAR Account, streamlining the process for users. Secondly, it facilitates atomic swaps, allowing seamless transactions between NEAR accounts and other chains, thereby enhancing transaction efficiency. Lastly, Sender Wallet enables gas fee payments in preferred tokens, enhancing flexibility in transaction management.
According to DappRadar, Here Wallet is recognized as one of the leading Dapps with the highest number of Unique Active Wallets (UAW) [8].
Initially, Here Wallet introduced a mobile version of their wallet, aiming to offer an exceptional user experience. However, despite its merits, it struggled to gain substantial traction.
The recent transition to a MPC wallet viaTelegramhas transformed this situation entirely. Telegram enjoys a large user base, a considerable proportion of whom are active participants in the crypto realm. This shift implies a natural growth of users for NEAR , leading to authentic user engagement.
In the cryptocurrency sphere, token incentives play a pivotal role, exemplified by Bitcoin’s inception through mining. The HOT mining campaign by Here Wallet has proven highly successful, attracting over 8 million users in just 6 months. While the allure of HOT mining and referral mechanisms initially draws users in, they remain engaged and explore the ecosystem due to Here Wallet’s consistent introduction of new features and applications like MITTE - an NFT marketplace in the HOT appstore
Non-Smart Contract Chain Ecosystem
Chain Signatures enable developers to utilize NEAR as a smart contract “layer” for chains that do not inherently support this functionality.
NEAR smart contracts can function as escrow contracts and manage ownership rights effectively. Building upon this fundamental capability, developers can create swap or lending protocols that accommodate assets from various chains, even those in unique states.
In the Trustless Bitcoin Ordinals Marketplace system operating on NEAR in East Blue, the workflow ensures secure and transparent transactions between sellers and buyers. Sellers set up a deposit account linked to their Bitcoin wallet via the marketplace contract. The marketplace contract exclusively requests MPC signers to carry out transactions on behalf of the Bitcoin account. Sellers have ownership rights over their Bitcoin accounts within the smart contract state, allowing them to deposit and withdraw Ordinals. Upon depositing and listing an Ordinal for 10 USD Coin (USDC), sellers are restricted from withdrawing the Ordinal if an active order is linked to their listing. The marketplace contract safeguards buyers by preventing sellers from making unauthorized withdrawals. Buyers, in turn, deposit USDC into the marketplace contract and proceed to accept the specified 10 USDC listing. The sale is executed only after both parties confirm their consent for the account swap, which is atomically processed in a single block by the marketplace contract [9].
Data Abstraction: NEAR DA
Integral to NEAR's vision of seamless blockchain interoperability is its fast and inexpensive approach to Data Availability (DA). As Layer 2 rollup solutions gain traction, addressing the challenges of efficient and cost-effective data storage has become paramount. NEAR's DA solution presents a comprehensive architecture meticulously designed to leverage the network's inherent high speeds and low costs, providing a robust and scalable storage layer tailored for rollup data.
At the core of NEAR DA lies the Blob Store Contract, a specialized smart contract that enables the decentralized storage of arbitrary DA blobs directly on the NEAR blockchain. By capitalizing on NEAR's consensus and receipt handling mechanisms, this contract ensures efficient and secure storage without overburdening the consensus layer with excessive data. Additional to this innovative storage solution is the Light Client, a trustless off-chain component that facilitates advanced features such as KZG commitments, erasure coding, and storage connectors. This versatile client empowers rollup providers to construct sophisticated proving systems by verifying transaction and receipt inclusion proofs, further enhancing the trustworthiness and transparency of the DA solution. Moreover, the DA RPC Client serves as the primary interface for seamless interaction with NEAR's DA system, offering a consistent and simplified experience across various programming languages. [11]
Liquidity Abstraction: Bridgeless Cross-chain DeFi
One of the most compelling aspects of Chain Signatures is their capability to obviate the requirement for bridging, instead facilitating cross-chain transactions through an MPC signature protocol. Users have a high demand for DeFi platforms that are functional across multiple chains. Some notable use cases include native cross-chain swaps (such as exchanging $XRP on Ripple for an NFT on Solana), the implementation of a cross-chain lending order book (e.g., utilizing X on Optimism as collateral to borrow Y on Arbitrum), and the ability to restake any asset on any chain while managing the associated reward or slashing conditions from NEAR.
This capability is particularly valuable for apps like DapDap, which is developed on NEAR Protocol and allows users to explore and engage with DeFi apps from different layer 2 solutions within a unified interface [10]. While DapDap currently provides the on-chain frontend component for interacting with layer 2 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 desired blockchain?
NEAR Protocol has introduced a novel solution that potentially offers the most cost-effective way to trade assets on-chain without concerns about high transaction fees and latency on legacy chains like Bitcoin and Ethereum. Through a smart contract, users can trade derivative paths, enabling them to trade specific assets deposited in a remote account without involving the entire account in the transaction process. For example, a decentralized exchange (Dex) could maintain path derivations of asset ownership on various chains and facilitate direct asset trading from remote addresses without incurring settlement fees on other blockchains.
Conclusion: Prerequisite to User-Owned AI
NEAR's chain abstraction stack presents a solution to the fragmented blockchain landscape, enabling seamless interactions across all chains. This approach unites Account Abstraction, Frontend Abstraction, Backend Abstraction, Liquidity Abstraction, and Data Abstraction, empowering users to engage with the decentralized ecosystem as seamlessly as they would with their favorite centralized applications.
However, NEAR's vision extends far beyond mere chain interoperability. The ultimate goal is to provide a fully sovereign operating system equipped with a personal AI assistant that optimizes for users' needs without compromising privacy. This platform will empower peer-to-peer interactions and transactions between individual user-owned AIs, while also facilitating the establishment of shared community AIs governed by their respective members [12].
These community AIs will represent the collective knowledge and requirements of their constituents, ranging from small clubs and startups to cities, nation-states, 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 with cryptographic proofs, these community models ensure transparency and verifiability, paving the way for a future where AI is truly owned and controlled by the people.
As the NEAR ecosystem continues to evolve, its focus on harnessing the potential of verifiable, user-owned AI will become increasingly paramount. By leveraging the chain abstraction infrastructure, NEAR is poised to facilitate the development of innovative AI applications that transcend blockchains, empowering individuals and communities to shape the future of the open web.
About the Authors
Cameron Dennis
Cameron Dennis is a Core Contributor to NEAR Protocol, the Founder / CEO of the Banyan Collective, and the Founder / President of the Blockchain Acceleration Foundation (BAF). He previously spent two years working at the NEAR Foundation where he wore many hats in Business Development, Developer Relations, Investor Relations, and Grant Management.
The NEAR Foundation is a Swiss-based nonprofit organization that supports the NEAR Protocol ecosystem. It was established in 2020 to foster the growth and development of the NEAR blockchain, which aims to accelerate the open web and user-owned AI. The Foundation provides resources, funding, and advocacy to help developers and entrepreneurs build decentralized applications on the NEAR Protocol.
F.F from LBank Labs
F.F. is the Research Lead of web3 Infrastructure at LBank Labs and holds a Master’s degree in Economics from Zhejiang University. Previously, F.F. served as a Product Manager and Researcher at Patract Labs. F.F. has been a grantee from organizations such as the Dfinity, Aptos, and Scroll Foundations.
LBank Labs, with its $100M AUM, is renowned for its strategic investments in the blockchain and cryptocurrency space. Its portfolio boasts of companies like Entangle, Puffer Finance, LunarCrush, Navi Protocol, Exabits, Hivello, and significant investments in VC funds such as Collab Currency, SevenX Ventures, IOSG Ventures, Blockchain Builders Fund, and more.
[1] https://lbanklabs.medium.com/chain-abstraction-ii-near-protocol-e55329133f90
[3] https://wiki.near.org/overview/BOS/fast-auth
[4] https://docs.near.org/concepts/protocol/account-model
[5] https://docs.near.org/build/chain-abstraction/chain-signatures
[6] https://medium.com/sweat-economy/chain-abstraction-defi-headaches-begone-eee9fd4dd7cd
[7] https://docs.near.org/develop/relayers/multichain-server
[8] https://twitter.com/here_wallet/status/1757435357598036285
[9] https://pitch.com/v/East-Blue-Deck-mjv9hr/9a5a2999-4ef4-4af3-b333-4b3927f8dccd
[10] https://dapdap.substack.com/p/dapdap-officially-launches-on-mainnet
[11] https://docs.near.org/build/chain-abstraction/data-availability
[12] https://near.org/blog/self-sovereignty-is-near-a-vision-for-our-ecosystem