Research/Education/Near/How NEAR Protocol Works: Shards, Chunks, Receipts, and Accounts

How NEAR Protocol Works: Shards, Chunks, Receipts, and Accounts

BloFin Academy11/12/2026

When you send coins from one wallet to another on a non-sharded blockchain, every validator computer on the network has to check and run that transfer in a single shared queue. When two popular apps launch at the same time, that queue backs up and fees rise for everyone.

Sharded blockchains avoid that traffic jam by splitting the network into parallel lanes called shards. On NEAR Protocol, each shard runs its own batch of transfers in parallel while one main chain keeps every shard in sync (source: NEAR Docs, NEAR Data Flow).

Because accounts and contracts are spread across several shards, NEAR cannot always finish a transaction in one step. Instead, it splits its engine into a blockchain layer and a runtime layer. NEAR turns each signed transaction into internal messages that travel between shards, and it produces a new block about every second.

What is the NEAR architecture?

NEAR Protocol splits its core software into two separate parts: a blockchain layer that manages network consensus and shard messages, and a runtime layer that runs account rules and smart contracts. Keeping the two layers apart lets each one do its work without slowing the other down (source: NEAR Docs, Architecture).

The blockchain layer handles how computers on the network talk to one another and agree on the ledger. It builds blocks, groups shard batches into chunks, and runs validator consensus. It also syncs state across nodes and routes internal messages to the right shard (source: NEAR Docs, Architecture).

The runtime layer handles the rules for accounts, balances, and smart contracts. It takes in a batch of user requests and updates account balances and contract data. It also works out gas fees and pays validator rewards. Because the two layers are separate, the runtime does not know how many shards exist on the chain or how blocks are built. In theory, the blockchain layer could even support a runtime with a different virtual machine, such as RISC-V, without changing how blocks work (source: NEAR Docs, Architecture).

Protocol layerWhat it managesWhat stays hidden from it
Blockchain layerSharding, block and chunk creation, validator consensus, state sync, and message routingSmart contract code, token transfer rules, and internal gas fee math
Runtime layerAccount balances, access keys, smart contract execution, gas fees, and reward payoutsNetwork layout, number of active shards, and block consensus rules

For holders and traders, this two-layer design explains why the NEAR token settles transfers in about a second with tiny, steady fees. On BloFin, you can buy the coin itself on NEAR/USDT Spot to withdraw to a wallet and use on-chain. You can also trade price moves with margin on the NEARUSDT Perpetual (10 NEAR per contract, up to 75x leverage). If you want coins for on-chain apps, here is how to buy NEAR.

Before placing a spot or futures order, you can compare maker and taker fee tiers on the BloFin fee schedule.

Why each NEAR account lives on one shard

Every account on NEAR belongs to one shard, and all of the on-chain data tied to that account stays on that same shard. Keeping an account's data in one place means NEAR never has to look on another shard when you use that account (source: NEAR Docs, Architecture).

Specifically, a shard holds five pieces of data for each account assigned to it.

  1. Liquid token balance: The spendable NEAR balance held by the account for transfers and gas fees.
  2. Locked staking balance: Any NEAR staked by that account to back network validators.
  3. Smart contract code: The compiled Rust or JavaScript program deployed to the account, if it holds a contract.
  4. Contract key-value storage: All saved app data belonging to that smart contract.
  5. Access keys: All full-access and function-call keys allowed to sign calls for that account (source: NEAR Docs, Architecture).

One NEAR account can hold both your funds and a smart contract (see NEAR named accounts and access keys), so keeping all five items on one shard keeps things fast. When you use a contract, NEAR reads and writes only that contract's data. Thousands of other accounts may sit on the same shard. Even so, the runtime never touches their data during that call (source: NEAR Docs, Architecture).

As a result, you can treat every account as if it had a shard of its own. There is no speed gain from placing two accounts on the same shard by hand. NEAR routes messages between accounts automatically, whether they are on the same shard or not (source: NEAR Docs, Architecture). See Nightshade sharding on NEAR for how the shards are split.

How transactions turn into cross-shard messages

When you sign and send a transaction on NEAR, the network does not finish a cross-shard transfer in one single step. Instead, your shard checks your signed transaction right away and turns it into an internal message called a receipt, which carries the work to other shards (source: NEAR Docs, NEAR Data Flow).

Every transaction you sign carries a few pieces of information, which your wallet fills in for you.

  • Sender and recipient: The account signing the transaction and the one account it acts on.
  • Actions: What the transaction does, such as sending NEAR, using an app, creating an account, uploading a contract, adding or removing a key, or staking.
  • Public key: The public key of the access key used to sign the request so nodes can check the signature.
  • Nonce: A number that goes up by one with every transaction from that key, so the same signed transaction cannot run twice.
  • Block hash: The hash of a recent block, which caps how long a signed transaction stays valid if it does not run right away (source: NEAR Docs, Transaction Anatomy).

Say you send NEAR to a friend on a different shard (see how to send and receive NEAR for the steps). First, your shard runs the transaction right away and takes the prepaid gas fee from your account. It then creates an internal cross-shard message for your friend's account. Because that internal message must run on the recipient's shard no earlier than the next block, the blockchain layer routes it over to your friend's shard (source: NEAR Docs, Token Transfer Flow).

In the next block, your friend's shard runs the incoming message and adds the coins to their balance. NEAR refunds any unused gas attached to a call. Because of that rule, finishing your friend's step creates a second internal message from the system account back to your account. That refund message moves back to your shard in the following block and puts the unused gas back into your balance (source: NEAR Docs, Token Transfer Flow). A block explorer shows each of those steps in order (see how to track NEAR transactions).

How asynchronous cross-contract calls work

A transaction that touches one account finishes all at once. One that touches several contracts runs over several blocks. A single transaction can bundle several actions on one recipient account, whereas calls between two different smart contracts run across blocks through internal messages (source: NEAR Docs, Transaction Anatomy).

When all actions inside a transaction target the same recipient account, the runtime runs those actions in order as an all-or-nothing batch. For example, you can send one transaction that creates a new sub-account and sends 5 NEAR to it. The same transaction can also upload the contract's code and set it up. If any one of those four actions fails, the runtime drops the whole transaction and none of the actions take effect (source: NEAR Docs, Transaction Anatomy).

Calls between two different smart contracts work differently because those contracts may live on different shards. When you swap tokens or add funds to a lending pool on a NEAR app (see NEAR dApps), one contract cannot pause the chain to wait for another. It cannot read Contract B's state inside the same block. Instead, Contract A finishes its local step and sends a cross-shard message to Contract B's shard for the next block. A callback message then brings back the result (source: NEAR Docs, Architecture).

Because each cross-contract hop is a separate internal message that runs in a later chunk, a multi-contract call is not all-or-nothing by default. Say one contract calls two others, and the first succeeds while the second fails. The failed call is refunded, but the coins sent through the successful one stay where they went (source: NEAR Docs, Token Loss). That is why well-built NEAR apps check each step and undo the others if one fails. Is NEAR safe? covers how to protect yourself against these failures.

Execution typeTarget accountsHow actions runWhat happens if step 2 fails
Bundled actions in one transactionOne single recipient accountRun in order inside the same chunkThe whole transaction is canceled
Cross-contract call across accountsTwo or more accounts (one contract calling two others)Sent as separate cross-shard messages across blocksThe failed call is refunded; the successful one stays

How NEAR stores account data across shards

NEAR is a stateful blockchain, meaning every account and smart contract keeps saved data on the ledger that user calls update over time. Both layers keep that data in a structure called a trie, which lets nodes find any account's data quickly (source: NEAR Docs, Architecture).

Instead of forcing every node to keep one giant lookup tree for the whole network, the blockchain layer splits that storage tree into partitions across the active shards. It syncs each shard's partition across nodes. It then uses consensus to make sure every validator agrees on the state after each block (source: NEAR Docs, Architecture).

In August 2024, the Nightshade 2.0 upgrade introduced stateless validation, which changed how validators check each shard's data (see NEAR stateless validation). Rather than keeping a full copy of a shard's storage tree on local disks, chunk validators receive a small proof called a state witness with each chunk. The state witness holds only the slices of account and contract data touched by that chunk, so validators can check the update in memory. At the time NEAR ran 6 shards and aimed for 10 (source: NEAR Blog, Nightshade 2.0 Mainnet); mainnet runs 10 shards today (source: GitHub, nearcore 2.13.0).

The runtime layer sets what storage and gas cost (see NEAR gas and storage staking). Opening a new named account burns 0.007 NEAR to pay for its first 770 bytes of storage (source: NEAR Docs, Gas Fees). Beyond that starting space, an account must lock 1 NEAR for every 100 KB of on-chain data it stores (350 NEAR for a contract storing 35 million bytes). Deleting saved data frees that locked NEAR back to the owner's spendable balance (source: NEAR Docs, Storage Staking).

Gas fees work differently (see NEAR fee burn and contract rebate). When a user calls a smart contract, 30% of the contract gas fee goes to the called contract and 70% is burned by the network (source: NEAR Docs, Gas Fees).

How blocks, chunks, and epochs fit together

Think of NEAR's shards as lanes on a highway, all moving at the same speed. Each shard produces a batch of work called a chunk at a fixed interval, one chunk per block, even when nobody is sending anything (source: NEAR Docs, NEAR Data Flow).

A block on the NEAR blockchain is a collection of the latest chunks from all active shards, linked to the prior block in the chain (source: NEAR Docs, NEAR Data Flow). On mainnet and testnet, blocks arrive roughly every 0.6 seconds (~600 milliseconds) (source: NEAR Docs, Epoch).

Two groups of validators keep blocks and chunks moving (see NEAR thresholded proof-of-stake).

  • Block and chunk producers (top 100 validators): The 100 highest-staked validators build the main blocks and create the chunks for their assigned shards.
  • Chunk validators (validators outside the top 100): The remaining active validators do not store shard state on disk; they check and sign the chunks built by the top 100 nodes (source: NEAR Docs, Validators).

To join the active validator set, a node must clear the minimum stake required. The minimum stake is 1/62,500 of all staked NEAR, about 9,600 NEAR today (source: NearBlocks, Validators). Smaller holders take part by staking their NEAR with a validator (see NEAR staking).

The active validator set stays fixed during each network epoch, which lasts 43,200 blocks, or roughly 7.2 hours at 0.6 seconds per block (source: NEAR Docs, Epoch). At the end of each 43,200-block epoch, the protocol pays out validation rewards targeting 2.5% of total supply per year (source: NEAR Docs, Validators). It also removes any block or chunk producer that built fewer than 80% of its assigned blocks or chunks, and any chunk validator that endorsed fewer than 70% of its assigned chunks (source: NEAR Protocol Specification, Economics). These rules have changed since launch, as NEAR history and upgrades describes.

How NEAR compares with Ethereum

On Ethereum, every node processes every transaction in one shared state, with a new slot every 12 seconds (source: Ethereum.org, Proof-of-Stake). See how Ethereum works. Because every Ethereum contract shares that single state, one transaction can call several DeFi contracts inside the same 12-second block, though users bid priority tips against one another when blocks fill up (source: Ethereum.org, Gas and fees).

NEAR makes the opposite design choice. It gives up the ability to call several contracts in one block, and gets parallel shards, faster blocks, and built-in account features in return (source: NEAR Docs, Account Model). For a full comparison, see NEAR versus Ethereum, and for the wider design choice, sharded versus monolithic blockchains.

Looking to trade NEAR tokens on BloFin? To get started, you'll need to first create a BloFin account, fund your account with cryptocurrency, and navigate to the NEAR/USDT Spot trading page or the NEARUSDT Perpetual page.

Frequently asked questions

How does NEAR stop a transaction from running twice?

Every access key on NEAR keeps its own nonce counter that must go up with each new transaction signed by that key. When you add a new key, NEAR gives it a starting nonce based on the current block. A new transaction is accepted only if its nonce is higher than the last one used. Gas keys can also keep several nonce counters at once, so bots can send many transactions side by side (source: NEAR Docs, Transaction Anatomy).

Why can a single NEAR transaction only target one receiver account?

Because NEAR assigns every account to a shard and runs account changes locally on that shard, a signed transaction can only name one recipient account. All bundled actions inside that transaction run in order on that single recipient account. If an action needs to interact with a second account, the runtime creates an internal cross-shard message. The blockchain layer then routes that message to the second account's shard (source: NEAR Docs, Transaction Anatomy).

Can many apps share one NEAR contract?

Standard smart contracts on NEAR must lock 1 NEAR per 100 KB of code stored inside the contract's own account. So that many accounts can use the same code without each paying to store it, NEAR lets a contract be registered once as a global contract. An app can register its contract code once on-chain, and other accounts can then use that global contract by its code hash or account ID (source: NEAR Docs, Transaction Anatomy).

What happens if an account is deleted before a gas refund message returns?

When a transaction leaves unused gas, or a transfer fails because the recipient does not exist, NEAR sends the NEAR back to the sender in a refund message. Sometimes the sender account is deleted, or emptied and removed by the network's automatic cleanup of zero-balance accounts, while that refund message is still in flight. When that happens, the returned NEAR is split among active validators based on their stake in that epoch (source: NEAR Docs, Token Loss).

How long do regular NEAR validator nodes keep historical block data?

Regular validating nodes on NEAR mainnet and testnet do not keep every old block since genesis on their local disks. Instead, standard nodes clear old block data after 5 epochs (about 1.5 days) to keep validator disk needs low. Full historical transactions, cross-shard messages, and account state changes from genesis are kept by archival nodes, RPC providers, and indexing services. Those archival services power block explorers like NearBlocks (source: NEAR Docs, Epoch).

Why is the NEAR runtime layer kept separate from sharding and consensus?

Keeping the two layers apart lets NEAR change its shards or consensus without changing how smart contracts work. When NEAR upgrades its consensus rules or adds new shards, smart contracts deployed on the runtime layer continue running without code changes (source: NEAR Docs, Architecture).


Researched and written by the BloFin Academy editorial team with AI-assisted drafting. Primary sources include the NEAR Protocol documentation on architecture, data flow, token transfer flow, transaction anatomy, account model, gas fees, storage staking, epochs, validators, and token loss, the NEAR Protocol Specification on economics (nomicon.io), the NEAR blog post on Nightshade 2.0 stateless validation, the nearcore 2.13.0 release notes, NearBlocks validator statistics, and the ethereum.org documentation on proof-of-stake and gas fees. All facts independently verified against cited documentation current as of October 2026.

This article is for informational and educational purposes only. It is not financial, investment, trading, or legal advice. Cryptocurrency can lose value. Interacting with smart contracts, cross-shard calls, and digital assets on NEAR Protocol carries technical, key-management, and market risks. Spot NEAR/USDT buys the token. A NEARUSDT Perpetual is a contract on the price. Do your own research. Consider your circumstances before using any protocol or trading any asset.