NEAR is a Layer 1, sharded, proof-of-stake blockchain network founded in 2017 by Illia Polosukhin and Alexander Skidanov. NEAR was founded with a mission to develop a highly scalable network that could build upon previous innovations but take it one step further in terms of performance and overall scalability.
NEAR uses human-readable account names such as
bob.near instead of a public hash such as
These accounts also have the permission to create subaccounts such as
example2.bob.near. It's important to know that only the root account can create the subaccount. So only
alice.near can create
nft.alice.near and only
nft.alice.near can create
example.nft.alice.near. Note that
alice.near does not have permission to create
example.nft.alice.near. Only the direct parent account has permission to create a subaccount.
On NEAR, each account can have many key pairs associated with them which we call "Access Keys". There are two types of "Access Keys":
- Full Access (Grants full control to the account)
- Function Call (Allows for only non-monetary transaction signing)
Full access keys allow for full control of the account. You can send funds, create sub-accounts, delete the account, and more. Function call keys only allow for calling certain methods on a specific smart contract that do not allow the transferring of funds. These keys can be used by dApp developers to allow users to sign simple transactions that mutate state on the blockchain without having to constantly re-direct to the user's wallet to prompt for authorization. They can be widely or narrowly scoped depending on the use case.
For each account, only one smart contract can be deployed and active at any given moment. All smart contracts on NEAR must be compiled to WebAssemly and currently, AssemblyScript and Rust are the supported languages used. Smart contracts that have been deployed can be updated at any time but not removed. This is where sub-accounts can come in handy. NEAR allows users to organize and create a hierarchy for their accounts.
As an example, benji could have the root account
benji.near. He then stores all his NFT contracts as sub-accounts of
nft.benji.near. For example, he worked on a cool lazy minting contract deployed to
lazy.nft.benji.near. This not only allows for better organization but it allows developers to easily delete and re-create accounts in order to clear state.
Any information that is stored on NEAR is accounted for using a mechanism called storage staking. In short, an account must maintain a certain balance that is locked in order to cover the cost of storage. If that storage is released, the funds become available once again. This is why named account IDs on NEAR cost an initial deposit to create. If you attempt to store state on-chain without having the necessary balance in your account to cover the cost, an error will be thrown which will tell you to add more NEAR to your account.
The NEAR Foundation was created in 2019 to help steward and develop the NEAR ecosystem. They describe themselves by saying "Our purpose is to enable community-driven innovation to benefit people around the world.”