This is my note for a sharing about the NEAR chain account model. Please visit the official website for the details.
There are 2 methods to identify an NEAR account, and you can only pick one between:
Implicit account is just a 64 character long identifier.
Named account works like the DNS, with some restrictions like the top level names less than 32 characters are reserved by the foundation, but you can still create your own top level name if it is more than 32 characters... You can also create any sub accounts from your account name. e.g. demo852.testnet -> sub1.demo852.testnet , sub2.demo852.testnet
Many chains use the public key for the account address and the private key for the update, but NEAR dose it another way. When you create an new account you will also need to assign a public key to it, or the account will be locked. The good thing is you can have multiple keys to access an account, and you can manage the keys anytime.
There are two types of key:
Full Access Key
The key has full access of the account, just like other chains.
FuncationCall key is a key with some restrictions like receiver_id, method_name (of the smart contract) and allowance (the gas fee limit). With FunctionCall key you can limit the risk to certain resources only if the key were stolen.
An account needs some storage to hold the information for the account. A part of the native token will be locked for the storage they used.
The basic information about the account like token balance, block hash, storage used.s
The contracts deployed to an account also take some space, which include the contract binary itself and the data stored by the contract for later use.
You will need these tools:
|Near account model||https://docs.near.org/concepts/basics/accounts/model|
Visit https://wallet.testnet.near.org/create to create an named account. Please remember to save your seed phrase.
Some tokens will be airdropped to your new account. Let's check the balance
Some tokens will be airdropped to your new account. Let's check the balance:
Now we need to import the seed phrase into the near-cli credential:
Then we can create a sub-account
sub1.demo852.testnet with some tokens as initial balance:
The default credential file location is
- can only choose one at account creation
- 64 char string
- DNS-like style
- can create sub account
- top level names < 32 characters are reserved
- multiple keys
- can be added/removed
- can do any thing
- accounts have to pay for the storage used
- token balance
- block hash
- storage used
- contract binary
- contract data (state)