Near Account model
Interaction of users with blockchain technologies has been a continuous hurdle until the emergence of the Near protocol .
Near protocol uses an account model for users that requires no technical knowledge or any stressful process .
What merits does near accounts pose over other account model🤔?
- Human-readable Accounts : this form of account makes remembering addresses easy and very reliable . i.e accounts can be named your personal name.
- Permissions based on access keys : near provides a rare but very secured form of access keys , that is an account can have multiple access keys bestowed to the smart contracts, this access keys have a varied form of permissions which makes the account very secured and impenetrable.
- Simple to develop smart contracts : the account model aids the development and deployment of smart contracts.
Feature comparison between account models
Feature | Near accounts | Other account model |
Public identifier | Public key (64 bit identifier) | Accountid (named or implicit) |
Secret key | Private key | Multiple access keys with varied permissions |
Security | Private key gives absolute access without further checks | Access keys help to vary permissions to interactors |
What is the near account id ?
An account in near has two parts , an account id and multiple access keys .
An account id also called. An address is a public identifier for the user account on near , it's analogous to a cashapp tag or an account number .
Account id can either be :
- Named : these accounts are identified by human readable names . Moreover, named account can create sub account on itself. i.e let Johannn be a named account ,Johann.near can create sub account like cash.johann.near which can also create sub account like app.cash.johann .
- Implicit : these are like the normal long string of characters to identify an account i.e. BGCCDDHfysuuVnaNVtEhhqeT4k9Muyem3Kpgq2U1m9HX .
Note : a named account has an implicit identifier under the hood and these names must follow a particular set of rules.
Named account on the testnet are designated with .testnet e.g bridget.testnet while account on the mainnet are designated with .near e.g mahmud.near .
Rules for named account
- The absolute creator of top level accounts is the near registrar ,it only can create top level accounts ranging from 1 - 32 characters .
- Anyone can create top level accounts greater than 32 characters .
- A created account can only create sub account of itself ,it cannot create sub account of its sub account nor does it have control over its sub account .
What is meant by access keys 😌?
Blockchain transactions require private Keys to sign ,this use of private key by most mainstream blockchain is very unsecured and can easily be exploited .
Near protocol uses a rare form transaction signing using access keys . An account can have numerous access keys mapped to it ,these access keys have their own set of permissions .
These access keys help to grant limited accessibility over accounts to third party .
Near access keys types
The near protocol implements two access keys types :
- Fullaccess : this type of access grants the receiver the permission to perform any action on the account e.g transfer near, add sub account, delete account e.t.c.
- Functioncall : this grants non-payable method calls on the account.
What merits do these access keys promote ?
- Usage of dapps: in the modern web3 world , dapps continually requires signing of transactions with private keys , in near you can create keys specifically for a dapp to limit its access over the account
- Key replacement : unlike traditional private keys , in situations of fear of compromise of access keys ,they can just be replaced without jeopardizing the security of the account.