English 中文(简体)
How named accounts works in NEAR
原标题:

It appears that named accounts in NEAR are being managed by the near and register smart contracts. However, this raises the question of whether NEAR natively supports named accounts. it s unclear if the smart contracts simply maintain a mapping between implicit accounts and their corresponding names or if named accounts are natively supported at the blockchain layer. anyone knows how it works?

最佳回答

NEAR Protocol provides a unique approach to account identification. Named accounts in NEAR are natively supported and are a fundamental part of the protocol’s design.

In NEAR, an account ID is a human-readable name, similar to an email address. Account IDs can be hierarchical, meaning they can be subnames of other accounts, akin to subdomains.

For example, if there’s an account with ID “example.near”, you can create a subaccount under this account, like “sub.example.near”. In this hierarchy, only the “example.near” account can create subaccounts that end with “.example.near”.

However, the account IDs are not managed by smart contracts. The NEAR protocol itself handles the creation, deletion, and management of these accounts. Accounts and their associated state (like account balance and contract state) are stored in the NEAR Protocol’s underlying state trie, a merkle tree that is used for storing the blockchain’s state.

The “near” contract you mentioned might be application-specific contracts that work on top of the basic account system.

问题回答

NEAR account has follow features:

  1. Native supported named account. NEAR name is supported by protocol itself, not smart contract. An account can create its immediate sub-account. For example, near can create alice.near, alice.near can create hi.alice.near. Currently we can create .near account because the account near has deployed a contract that allow anybody to create its sub-account. Specially, top-level account registrar is the only account that can create other top-level account with length < 32, registrar doesn t deploy any contract and it is controlled by NEAR Fundation. A implicit account is calculated by a private key, essentially, it is also a top-level account with a length of 64. When you transfer $NEAR to a implicit account, it will auto created if not exists, but if you transfer $NEAR to a named account which is not exists, transfer will failed and refund the $NEAR.

  2. Abstract account. NEAR protocol does not distinguish between contract accounts and regular accounts. You can deploy contract to a exist account.

  3. Multiple key pair model. You can bind multiple public key to an account (including implicit account). There are two permission kind of the key, FullAccess and FunctionCall, you can check here. If you delete all FullAccess public keys from an account, the account will be a locked account, only smart contract deployed on that account can fully control that account.





相关问题
unable to get data from blockchain using thirdweb

I am building a simple crowdfunding app using React and thirdweb , I was able to successfully create a Campaign mean data is pushed successfully , I have read docs everything works fine , but when i ...

How named accounts works in NEAR

It appears that named accounts in NEAR are being managed by the near and register smart contracts. However, this raises the question of whether NEAR natively supports named accounts. it s unclear if ...

ETH sendSignedTransaction

I Try to use @ethereumjs/tx to sign Transaction. I want to send ETH from one address to second address. .... const legacy = require( @ethereumjs/tx/dist/legacyTransaction ); const utils = require( ...

How to set a timer in solidity?

I am launching a game that should close after exactly 3 days/72 hours of initializing & deploying the contract. My current thoughts are: declare a variable, timestamp. in the constructor, set the ...

"code": -32000, "message": "execution reverted"

Hello I am trying to deploy a contract using remix.ethereum.org after linked the metamask account using mumbai network. I receive this error while making the transaction for the contract Gas ...

How to get all accounts from near protocol blockchain?

I am currently working on a program within the Near Protocol to generate user-specific Near token ownership statistics. However, I m not sure how to obtain a list of all user accounts. Is there an ...

热门标签