How NEAR Works in Layperson’s Terms

Rim Berjack
NEAR Protocol
Published in
7 min readJul 8, 2021

You may understand a Layer 1 chain like NEAR as a “general purpose platform” for dapps (decentralized applications). Erik Trautman gives a great analogy for NEAR in “The Beginner’s Guide to the NEAR Blockchain”:

A decent analogy is that it’s sort of like Amazon’s AWS platform, which is where most of the applications you know and love host their servers, except the NEAR platform isn’t actually run and controlled by one company, it’s run and controlled by thousands or even millions of people. You can call it a “community-operated cloud” but we usually prefer to simply call it a “decentralized application platform.”

Just like how AWS (Amazon Web Services) is a platform which hosts all the applications we know and use everyday — whether that’s Netflix, Twitch, or Twitter — NEAR is a platform upon which any application can run, from games to finance to marketplaces. This is what a “Layer 1” blockchain protocol is: a base layer offering the infrastructure upon which other applications and functionalities can operate. But unlike AWS, which is a centralized cloud computing service, blockchains like NEAR are decentralized, meaning it is open for anyone to use and build upon. This openness is why we call the new generation of the internet which will be defined by blockchain technology and cryptography the “Open Web” (or, “Web3”).

Instead of having to unpack all the technical jargon of blockchain technology, let’s run through an actual use case on NEAR and get a sense of how things work around here. The example I will use is a little dapp called the “NEAR Tipbot”. This dapp allows you to send and receive tips on Telegram using $NEAR, which is the native currency of NEAR Protocol.

Logo of NEAR Tipbot. White android with the NEAR logo on its chest and smiling eyes.
The friendly face of the NEAR Tipbot

Let’s say you and I are in the same group on Telegram, and so is Tipbot (@nearup_bot). You just told a good joke. Using Tipbot, I can show my appreciation by sending you a small tip:

Screenshot of a Telegram group. Two message boxes. Top message is a reply a message by another user, which reads, “Sir, this is a Wendy’s.” The reply contains the text “/near 0.1” The message below is a confirmation by the NEAR Tipbot saying that 0.1 NEAR was sent to the other user.
Example of sending a tip through Tipbot

Voilà! I just sent you 0.1 NEAR using the Tipbot dapp. I did not have to add you to my contacts or even know your NEAR wallet address. The Tipbot dapp automatically executes this transaction on your behalf on the NEAR chain and connects it to the relevant Telegram accounts. Later, you can withdraw the tips to your NEAR wallet and use it on other dapps. For instance, you can sell your artwork on Paras or Mintbase, earn yield on Berry Club, or place bets on Pulse. (For more on how Tipbot works, see here.)

Screenshot of Telegram chat. Message 1 reads “/myTips”. Message 2 is a reply from Tipbot confirming my balance of 2.3 NEAR. Message 3 is my text reading, “/withdraw”. The last two messages are from Tipbot saying, “Tips of 2.3 NEAR found” and “Withdraw successful!”
Withdrawing the tips I accumulated on Telegram to my NEAR wallet
A screenshot of the transaction record. 2.297 NEAR is now in my NEAR wallet.
The tips are now in my wallet! 0.003NEAR was used as the transaction fee

So that’s what we see on the Telegram interface. Let’s break down what’s happening underneath.

1. The transaction of 0.1 NEAR is happening between two accounts on NEAR: in this case, “rimberjack.near” and “tipbot.app.near”. A NEAR account is your on-chain identity and the locus of all your transactions. Your NEAR account comes with a human-readable ID (xxxx.near), and this is the address with which you make every transaction. Every on-chain transaction is essentially an interaction between accounts, which can be another user or a dapp.

2. The Tipbot dapp is a smart contract on the NEAR blockchain. A smart contract is a set of code which programs certain actions to be executed automatically. This is why smart contracts are often described as “vending machines”: a smart contract performs “if A, then B”-type actions as determined by the code. Chains like NEAR can be general-purpose platforms precisely because they have smart contract functionality.

By inputting “/near [amount]” on Telegram, I trigger the action, “send_tip_to_telegram” in the Tipbot smart contract. The Tipbot is configured to connect the designated amount of $NEAR to the specific Telegram account.

Screenshot of screen with a black box which contains two lines of code reading, ““telegram_account”: 834909451" and “amount: 100000000000000000000000”
You can see the action in the transaction record

3. This action is then executed and published in a block. When we say that a blockchain is decentralized, we mean that it is not hosted on a central server but that its servers are distributed: a community of servers, which can be anywhere in the world, maintain the network. Every “block” which makes up the blockchain is produced by one of these servers. On Bitcoin, these servers are the miners. On NEAR, they are called validators because they verify the validity of each transaction when they create a block. (The difference between “mining” and “validating” comes down to the difference in the consensus mechanism. For more technical information, see here.)

My transaction has been validated and published as a part of block #39964106:

Screenshot of metadata of block #39964106 on the NEAR explorer
Block information on NEAR Explorer

4. The transaction and all the details concerning it are now public information and this record is immutable. Each and any on-chain transaction can be searched and viewed on the NEAR Explorer with its unique transaction hash. Mine, for instance, looks like this:

Screenshot of metadata concerning my Tipbot transaction
My transaction hash and metadata

5. Here, we can see that there is a transaction fee. This is the compensation for the work the validator does in executing this block. “Gas used” indicates the computing power it took to process the transaction, which is then reflected in the transaction fee.

6. This particular transaction took mere seconds to finalize and cost only 0.00173NEAR, which at the time of writing is about $0.00519. Basically, the cost of transaction is negligible on NEAR.

This is one of NEAR’s biggest strengths: because NEAR is a sharded chain, it is able to scale (infinitely in theory!); and because it can scale, the network is not bogged down by high costs or slow speed. This is how a dapp like Tipbot, where you send small amounts of money to users instantaneously, would be feasible at all. On a chain like Ethereum, whose throughput is significantly lower, transaction fees can vary anywhere from a couple of dollars to hundreds depending on network conditions. Furthermore, the transaction can take anywhere from a few minutes to many hours to finalize. But even a few dollars and several minutes are way too much when you want to send someone a tip of a few cents or a dollar. NEAR Tipbot exemplifies the cost and speed which make NEAR one of the most usable and accessible chains in the cryptosphere.

Tipbot is a relatively simple dapp, and other programs — which can be anything from an NFT marketplace to a financial service or even a governance tool — will have differing levels of complexity, consisting of multiple smart contracts. But at the very base it is the same process: from your account, you call a function on a smart contract; the action you take is executed by a validator and published as a block, for which you pay a small fee in $NEAR. Once a block is created, it is immutable and open for all to see forever (or for as long as the chain survives).

Did this get your creative bones kicking? Perhaps you are already a web developer who has built applications before, and you may be interested in turning them into dapps (as this would have benefits such as eliminating third party intermediaries, reducing hidden costs, increasing transparency, automation, global accessibility…). Maybe you just want to learn more about the Open Web and NEAR without complicating things too much.

In that case, you should try out NEAR Academy! NEAR Academy is an interactive education program which introduces the basic concepts of the Open Web and the development tools to start building your very own dapp on NEAR.

I promise you, there are very few chains that do it all without cutting any corners: innovative, scalable, usable, approachable, decentralized, community-oriented, and builder-friendly. But don’t just take my word for it. Try out NEAR Academy and see for yourself.

Rim Berjack is a writer for 4NTS Guild. You can check out their Medium for more content or follow them on Twitter.

--

--

Rim Berjack
NEAR Protocol

Bringing you NEAR-er to Web3 and the future of finance.