[NEAR Protocol] BOS & FastAuth

Kim Yevin
EWHA-CHAIN
Published in
11 min readJul 20, 2023

In this article, we will examine the functions of BOS and FastAuth, which were developed by the NEAR protocol, and briefly summarize the experience that developers and users can expect in terms of Web3 accessibility.

TL; DR —

  1. BOS is a blockchain protocol for developing and deploying decentralized front-ends and has the composability to build fragmented blockchain services in component units.
  2. FastAuth has solved the entry barrier to the Web3 ecosystem, which was the method of creating encrypted accounts, by using an authentication method familiar to Web2 users.
  3. By applying FastAuth to BOS, all component services can be utilized in one space with a single login, creating a consistent user experience.

Introduction

In early 2023, the NEAR Protocol announced the Blockchain Operating System (BOS).

[Source] https://docs.near.org/bos/overview

As the name suggests, BOS is touted as the “operating system of blockchain”.

  • Operating System (OS): Software that enables users to run specific programs between hardware and users.

This can be seen as NEAR’s desire to connect users and blockchain resources, aiming for improved accessibility.

Meanwhile, FastAuth has also been developed as a means to achieve this goal.

FastAuth is a function that makes it easy and fast to create accounts that can be used in distributed applications or sites.

near.org — Capture of Creating Account

Just simple INPUT(Email & Account ID) allows you to create an account that can be used on near.org.

As FastAuth can be integrated with dApps of BOS, it is an essential element in attracting existing Web2 users to the Web3 ecosystem.

In this article, we will discuss how the NEAR Protocol has improved accessibility for dApps in terms of development and usage, with a focus on BOS and FastAuth.

BOS(Blockchain Operating System)

BOS is a blockchain-based protocol designed to develop and deploy a distributed front-end, which aims to make the process of interacting with dApps more accessible.

Until now, most decentralized applications(dApps) have been able to interact with users through centralized front-end services.

In this case, even if it’s a Web3 service, there is front-end code that exists off-chain, making it difficult for users to know how the service is running. Additionally, the fact that users don’t always know what code is running creates the potential for security issues.

The idea of “decentralization,” which is a big part of the appeal of Web3, is that it’s incomplete in the traditional sense.

However, BOS allows dApps to be deployed as “on-chain front-end” code.

In BOS, since the code of each component that makes up the front end is always on the chain, so you can search and view it in Explorer.

This means that anyone can deploy their dApps, and they are open-sourced and accessible to everyone, allowing them to collaborate and share code for their purposes.

So, how does this Web3-appealing BOS improve user accessibility?

Another feature of BOS is that it has “composability” by componentizing various fragmented blockchain services.

Composability” refers to the degree to which you can combine existing elements to create a new product.

In other words, BOS makes it easier for developers to reuse and recombine Components to create new applications.

Let’s take a closer look at the components of the BOS.

In BOS, each front-end component is stored entirely on-chain (NEAR) in the HTML/CSS/JS that developers are familiar with, so the component can call *any* function on the blockchain. It is currently supported on all EVM blockchains, including Polygon and zkSync.

  • The NEAR protocol uses Gateways built on layer 1. Gateway is a specially designed virtual machine that loads and executes the front-end for the protocol and in BOS, users can run distributed frontends, such as components, locally through this Gateway.
  • Components can interact with the blockchain, processing local data through the BOS API and fetching data from external websites.

Here is the code for building a simple component in BOS:

let greeting = "Have a great day";

return (
<>
<div class="container border border-info p-3 text-center min-vw-100">
<h1>Hello</h1>
<p> {greeting} </p>
</div>
</>
);

By returning HTML code using the return statement, you can build components.

So, what if you want to include these external components in your current front-end development?

const user = "gagdiez.near";
const props = { name: "Anna" };

return (
<>
<div class="container min-vw-100">
<h5> Components can be composed </h5>
<hr />
<Widget src={`${user}/widget/Greetings`} props={props} />
</div>
</>
);

When you want to use a pre-defined component, you can freely configure it in your front end by entering the user name and component name of the component you want to use along with the <Widget/> tag.

As you can see, BOS’s “composability” is obtained through this Widget tag.

[Source] https://docs.near.org/bos/components/home | This image breaks down the near.social application into components.

On a single Homepage front-end screen, each element for each function such as LikeButton, CommentButton, Markdown, Post function, etc. is separated.

In BOS, the front end is structured by building small applications called components for each of these elements. The idea is that by including predefined, simple components in your code, you can create more complex components as well.

For example.

When you want to include a chart element that shows how many active accounts there are every month on the front-end page you are developing, you can create it through the following process.

1. Search for the desired component in the component search bar.

https://near.org/mob.near/widget/WidgetSource?src=y3k.near/widget/MonthlyActiveAccounts

2. Check the user who created the component and the name of it.

y3k.near/widget/MonthlyActiveAccounts

3. Simply configure it in your front end with the Widget tag.

<Widget src={"y3k.near/widget/MonthlyActiveAccounts"} />

In this way, if a component is on the on-chain in the BOS ecosystem, it can be embedded in your front-end environment as a Web3 base without any separate linkage process or fork. With thousands of components available to build your own front-end experience, you can create an infinite number of different experiences depending on how you implement them.

Additionally, BOS can bridge the gap between Web2 and Web3.

In the existing Web3 space, it was difficult to explore and discover fragmented blockchain projects and services (DeFi, DEX, dApp) on different chains or even on the same chain. Therefore, developers had to promote their projects themselves or rely on being discovered.

However, BOS provides a common layer to explore and discover such services. The goal is simple: to ensure that any project that can provide real value to users gets picked up.

Furthermore, BOS also provides various built-in components for a development environment similar to the existing Web2.

[List of built-in components provided by the NEAR Protocol]

Now you understand that the composability of BOS can enhance accessibility in the development process.

However, there is also a significant advantage from a user perspective.

You can utilize all components with a just single login, as long as you’re on the same network.

It allows you to consistently utilize different services organized in the same space.

const childSrc =
context.networkId === "mainnet"
? "near/src/Foobar"
: "preview.testnet/src/Foobar";

let user_account = context.accountId;

As you can see in the code, environment variables like context.networkId, and context.accountId allow us to get information about the network the current user is running on and the account the user is logged into. This means that we can easily retrieve information about the user’s execution environment and apply it to the components uniformly.

Some may have security concerns, given that it uses the user’s execution environment. However, as mentioned earlier, the component runs locally in the gateway, which is a virtual machine specified by the user, and thus cannot access local storage or cookies.

This feature can be maximized by combining it with the NEAR protocol’s FastAuth.

FastAuth

This method is very familiar to us because we can log in using SNS accounts such as Google. Most people are familiar with this approach, as they log in through their social media accounts like Google or Twitter instead.

What if you could use Web3 applications through this SSO method?
In the first part of the article, you saw that you can easily create a BOS account by email using FastAuth. FastAuth can make it easy and fast for users to create accounts for all websites or applications integrated with BOS.

In the existing Web3, users had to go through complicated processes to use decentralized applications. Most users are used to centralized authentication methods, so this “crypto” method has created an entry barrier for Web3.

However, FastAuth allows users to create secure accounts with all permissions in just a few seconds, without installing any specialized software or applications.

The following is a screenshot of the actual account creation process.

After verifying via the authentication link sent by email, the account was created.
After verifying via the authentication link sent by email, the account was created.

As you can see, after going through biometric authentication from email and mobile phones, you can confirm that an encrypted account that can be used in BOS is created.

Let’s take a look at the workflow for this process in a little more detail.

[Source] https://wiki.near.org/overview/BOS/fast-auth | Account creation workflow

Once the user enters an email and account name that can be utilized for SSO, the user will be verified through authentication prompts provided by the user’s device. Through this process, a Near.org account is created using “the Private Key” stored in the device itself as the PassKey and a Full Access Key that can be accessed through the device’s Passkey is created while verifying the entered email once again.

[Source] https://wiki.near.org/overview/BOS/fast-auth | Full Access Key Request Workflow

After that, when the user needs a Full Access Key, the user can authenticate through the authentication prompt provided by the device in the same way and generate a Full Access Key with the Private Key stored in the device.

The created account can be used consistently for any component services of BOS by its “operating components” method.

In addition, the recovery process can be easily carried out in a way familiar to existing Web2 users through the email used for account creation. This process is also secure because it is distributed through multi-party computation and does not grant full access to a single administrator.

FastAuth also utilizes Meta Transactions and Zero Balance Accounts (ZBAs) to provide enhanced usability for users. Before we get into this, let’s briefly explain what Meta transactions and Zero Balance Accounts are.

A meta transaction is a transaction that is not paid for by the actual user but is processed by including the actual transaction information as a parameter in the transaction being paid for. For example, to execute a transaction on the Ethereum network, Ether (ETH) is required to pay the transaction fee, but this process allows you to pay the relay with a different token and execute the desired transaction on the Ethereum network.

In addition, ZBA (Zero Balance Account) is a term that refers to an account that maintains a balance of 0, and the amount that needs to be paid from ZBA is automatically paid from a different account that is specified separately.

All of these concepts can be used by developers to provide gas fees and money for new users entering initial interactions.

For example, on Near.org, users can create and register accounts for free and interact with social features without having to purchase $NEAR.

Data was posted on near.org without additional cost.

Data was posted on near.org without additional cost.

I tried out the social feature of near.org with a simple account created through FastAuth. I was able to interact with various posts without paying additional costs, and even save directly written markdown-format posts on NEAR Chain.

FastAuth has a great advantage in lowering the high entry barrier that traditional dApps have because it allows users to interact with Web3 without a high level of understanding of the blockchain.

Although these Relay and FastAuth methods are currently only available on near.org, NEAR says they are making efforts to expand additional Gateways.

Above all, since FastAuth is expected to be released as an open source by componentizing it as an SDK, we can also expect dApps with FastAuth to be developed. The onboarding project will also provide a simple and easy user experience, while also improving accessibility for new users.

Conclusion & Future Directions

The BOS; Blockchain Operating System (OS) built by the NEAR Protocol allows developers to develop in familiar languages across all chains and eliminates the complex process of dApp development by using many pre-defined components. BOS can be seen as an attractive option for not only Web3-Developers but also for existing Web2-Developers as a “decentralized service

FastAuth solves the difficulties of Web3 by providing an easy, single identity to use in all experiences instead of complex cryptographic accounts. For end users, having a mobile-friendly login method without the need to activate crypto wallets is a great way to recognize the benefits of “decentralized services” without any understanding of blockchain technology.

Many projects have realized these benefits and are developing with BOS.

  • Keypom: Provides seamless onboarding through a one-click wallet connection. The SDK component can be combined with other projects. Another project, Harmonic Guild is developing a gateway for minting NFTs/FTs and has combined the Keypom BOS component to simplify the onboarding process.
  • Near Task: A gig economy platform where you can earn $NEAR by completing simple tasks. It aims to implement online reputation systems, task distribution, task verification, and payment methods.
  • Near.social: Integrating BOS dashboards and social components for various DAOs to manage social data.
  • Mintbase: Developing BOS components for NFT marketplaces and a Gateway for NFT marketplaces.

“BOS is both a development environment and a social network where users can deploy and discover new applications.”

in Near.org Overview of BOS

NEAR has built an open-source blockchain community with BOS, not just a simple technological innovation. They hope that fully decentralized Web3 will become the mainstream of the digital world, instead of the current centralized model where a few large corporations still control large parts of the web, limiting access, diversity, and creativity.

According to NEAR, the next goal of BOS is to make building multi-chain experiences quick and easy. I look forward to NEAR becoming more than just another Layer-1 network.

Reference

--

--

Kim Yevin
EWHA-CHAIN

Ewha Woman University | Ewha-chain | Computer Science & Engineering