DEV Community

Den
Den

Posted on

Everything You Should Know about Accounts on Near

I’ve gathered all the key information about Near accounts in one place, so you don’t have to spend time digging through scattered resources to understand how they work.

In this article, we’re going to break down how accounts on Near work. We’ll cover:

  • The different types of accounts

  • What makes up a Near account under the hood

  • Unique features like sub-accounts, account deletion, and Ethereum compatibility

By the end, you’ll have a clear, complete picture of Near's account model and how to confidently use it in your projects

What Makes Up a Near Account

Here’s what you need to know first.

Every Near account has a total balance, which consists of two parts:

  • Available Balance: This is the balance you can use freely at any time to pay transaction fees, transfer tokens, stake, or perform other operations.

  • Locked Balance: These are tokens that are currently staked to a validator, whether you’re staking to your own validator or someone else’s. Locked funds don’t unlock instantly - it takes a little time, typically 4 epochs (20 hours).

Contracts

A smart contract is a WebAssembly (WASM) program that can be deployed to an account. When you first create an account, it doesn’t have a contract by default. What makes NEAR flexible is that you can deploy, update, and even remove contracts from an account later. This means you can fully upgrade the code over time, something that’s not always possible on other blockchains. Once deployed, your contract can be called by anyone, and it has access to the account’s storage.

Storage

Every NEAR account has its own persistent storage, built as a key-value store. It can only be read and modified by the contract deployed on that same account, other contracts can’t directly access your storage, neither for read nor for write.

The data stored on your account is publicly visible. Anyone can read it through RPC calls — just something to keep in mind.

Storage on Near isn’t free. There’s a storage staking rule - you must hold 1 NEAR per 100 KB of storage used. This covers the account itself, contract code, stored data, and access keys.

The cool thing is, when you delete data from your storage, the NEAR tokens tied to that storage are automatically released back to your available balance. So you’re not permanently spending tokens, you’re simply locking them as long as you use the storage.

Access Keys

This is one of Near's most unique features. Unlike many blockchains where each account is tied to a single key, Near accounts can have multiple keys at the same time, each with its own permissions.

There are two types of access keys:

  • Full Access: Gives complete control over the account.

  • Function Call: Can only be used to call specific contract methods, usually with limited permissions. This key can only call non-payable methods—methods that don’t require a deposit. If you try to use it for a payable method, the transaction will simply fail.

Accounts can have as many keys as you like, you can add/remove them anytime. You can even remove all keys from an account, which effectively locks it. Once locked, the account can’t perform any actions anymore, unless the smart contract deployed on it was specifically designed to handle interactions without relying on access keys (you’ll see an example of this later in the article when we talk about the Wallet Contract).

Types of Accounts

On Near, not all accounts are the same — there are a few distinct types, each with its own purpose and behavior. But before we dive into the details, let’s quickly look at the general rules that apply to all accounts.

Every account, no matter the type, follows a simple set of naming rules:

  • Length: Account names must be at least 2 characters long and can go up to 64 characters.
  • Allowed characters: You can use lowercase letters (a-z), digits (0-9), and separators, including dots (.), dashes (-) and underscores (_).
  • Separator Rules
    • An account name can’t start or end with a separator - no _alice. or .bob.near-.
    • Separators can’t follow each other - no .., --, __, or mixed combinations like .- or _..

john.doe.near, root, or user_123.near are valid account names.

Named Accounts

As the name suggests, named accounts come with a human-readable name, which makes life on Near a lot easier, especially when it comes to branding and user experience. You don’t have to memorize long, random strings of characters anymore.

Creating a named account is simple, but not entirely free. You need to send a transaction to register the account on the blockchain. If you choose, you can also send some NEAR tokens along with the transaction to pre-fund the account. Like any transaction on Near, you need to cover the network fee. The good news is, fees on Near are low, especially compared to other blockchains. In fact, some wallets or applications might even cover this fee for you using a relayer (a service that pays the transaction fee on your behalf). That said, not every wallet offers this, so in many cases, you’ll still need to pay this small fee yourself.

Sub-Accounts

You’ve probably noticed examples like child.user.near and might be wondering - can anyone create that account? Actually, no. Near uses a hierarchical account structure and accounts are separated by dots to indicate their level. For example, only user.near can create child.user.near, and if you try to create child.user.near directly, your transaction will simply fail. The account user.near must send the transaction to itself to create child.user.near. No one else can do it.

Here's an important nuance - once a sub-account is created, it's fully independent. It has its own access keys, assets, etc. It doesn't belong to the parent account in any operational sense. The only thing the parent controls is the ability to create the sub-account in the first place. After that, the two accounts are completely separate.

If only user.near can create child.user.near, who created user.near?

If you said near, that’s exactly right. This brings us to the next section.

Top-Level Accounts

The near part isn’t just a label, it’s actually an account itself. In fact, it’s a special type of account called a top-level Account.

Top-level accounts on Near are, in many ways, just like the named accounts we’ve already discussed. The key difference is that you can’t create a top-level account yourself.

These accounts are predefined at the protocol level. They usually don’t have any Full Access keys attached, which means they can’t be deleted, and they technically belong to no one. They simply exist.

What makes top-level accounts so useful is that they can also have a smart contract deployed on them, and in most cases, they do. For example, the near account has a contract deployed on it that exposes the create_account method. Anyone can call it to create sub-accounts under the top-level account, which are the regular named accounts like user.near. It’s as simple as that.

You can check out the smart contract source code right here. Though, this contract does more than just create accounts, it’s actually a broader tool with additional functionality called Linkdrop. But we won’t dive into those details in this article.

It’s also worth noting that near isn’t the only top-level account. For example, the tg top-level account was introduced at the beginning of 2024 to support the HERE Wallet on Telegram. They needed a dedicated top-level account because their use case required a custom smart contract deployed specifically to handle batch account creation and other custom features.

I don’t know the exact requirements for getting a custom top-level account, but I guess that if your use case ever grows to the point where supporting millions of users would truly benefit from having a dedicated top-level account, there’s a chance you could request one.

Implicit Accounts

Implicit accounts on Near work a little differently from the named accounts we’ve talked about so far. You won’t find a human-readable name here. Instead, the account ID is simply the hexadecimal representation of a public key.

The public key generated from Ed25519 is exactly 32 bytes long, and when you convert it to a hexadecimal string, you get a 64-character account ID.

You don’t need to send any transaction or pay any deposit to create an implicit account. You can generate it completely off-chain by simply creating a key pair and calculating the hex representation of the public key. That’s it. You can start using the address right away.

When you first generate an implicit account, Near Protocol knows nothing about it yet. It officially comes into existence the moment someone sends NEAR. At that moment, the blockchain registers the account with the exact public key you originally generated. This makes implicit accounts perfect for lightweight onboarding. You can start using the blockchain right away — no need to sign any transactions, no need to pay upfront fees. You simply generate a key pair and you’re good to go. If possible, you’re recommended to upgrade to a named account later.

Also, it’s important to note that implicit accounts can’t have sub-accounts. Their account ID is already 64 characters long (the maximum allowed on Near), so there’s simply no room to add anything else.

Simple Example

Imagine someone wants to send you USDT on Near, but you don’t have an account yet.
With a named account, you’d first need to register it by sending a transaction, which costs a small fee. If you skip this step and give them a name like user.near that hasn’t been created yet, you’re putting the funds at risk.
Why? Because anyone can create a named account that doesn’t exist yet. If you delay, someone else could create that same account before you and take the funds.

But with implicit accounts, it’s different.
When you generate an implicit account, the account address is derived from your public key.
The only way someone else could take over that account is by generating the exact same key pair, which is practically impossible.

Ethereum Accounts

Ethereum accounts on Near use the same familiar address format you’ll see in native EVM networks - a 20-byte hexadecimal string. If you’ve worked with Ethereum before, this format will feel instantly familiar.

These accounts were introduced to support smooth integration with Ethereum tools, especially wallets. The goal is to let users sign transactions using their Ethereum keys and execute them directly on Near.

When you create an Ethereum account on Near, a special Wallet Contract is automatically deployed on it. One of its core methods is rlp_execute(target: AccountId, tx_bytes_b64: Vec<u8>). This function takes an Ethereum transaction, verifies the signature using your Ethereum key, checks the nonce to ensure the transaction is in the correct order, and then executes it directly on Near.

It’s worth noting that Ethereum accounts on Near have limited capabilities, you can transfer NEAR tokens, call functions on other smart contracts, and add or delete FunctionCall keys, but you cannot add Full Access keys or delete the account.

Deleting Accounts

We’ve talked about how accounts can be created, but here’s something that makes Near stand out compared to many other blockchains - accounts on Near can also be fully deleted, and even recreated later, as many times as you need. This is not something you usually see on other chains, where account addresses are typically permanent.

Account deletion is done via a special transaction, and when you delete an account, its remaining available Near balance is automatically transferred to a beneficiary account of your choice. The account itself is completely removed from the blockchain’s state.

This feature gives you flexibility, but it also comes with a real risk of losing assets if you don’t handle the process carefully. When you delete an account, only the native NEAR tokens are automatically transferred. Any other assets like FTs, or NFTs, won't be transferred automatically. If you forget to move those assets before deletion, you will lose them permanently.


If you spot anything incorrect or notice something important I missed, please feel free to correct me or add your thoughts in the comments. I’d appreciate it!

Otherwise, I hope this article helped you build a clear, practical understanding of Near accounts and gave you the confidence to work with them without second-guessing.
Thanks for reading and have a great day!

Top comments (0)