Install the NEAR CLI before starting. The examples below use testnet.
Create an implicit account
Creating an implicit account takes two steps: generate a key pair locally, then send a transfer to its derived address.Generate a key pair
The simplest way to obtain a public / private key pair is using the NEAR CLI:near-seed-phrase library:
Fund the account
Send NEAR to the derived address from a wallet or an existing funded account:Create a named account
Named accounts are created through thetop level accounts near in mainnet, and testnet in testnet. Both accounts possess smart contracts that expose the create_account.
Call the parent account’s contract
To createalice.testnet with 0.1 NEAR, call create_account on testnet using an existing account such as funding-account.testnet:
ed25519:<data> with the public key generated above. The contract creates and funds alice.testnet and adds the new_public_key as a full-access key to the account.
If you are not going through an intermediary such as a wallet, you can generate an implicit account, fund it, and call
create_account on near / testnet.Create a direct sub-account
If you controlalice.testnet, you can trigger the CreateAccount action yourself to create a direct sub-account:
--initialBalance <amount in NEAR> to set its initial balance.
A parent account has no control over its sub-accounts after creation. Control depends on the access keys and contract installed on each account.
Use the testnet faucet
A faucet can create and fund a named testnet account for you, so you don’t need an existing funded account. Choose an available.testnet name and run: