Skip to content
Retr0 Academy
Web3 Fundamentals

Web3 Fundamentals · 3 min read

Accounts and Named Accounts

NEAR accounts are human-readable names like alice.near, with sub-accounts, implicit accounts, and balances you can read in one RPC call.

On most chains your "account" is a long hex address derived from a key. On NEAR the account is a name. alice.near is not an alias that points somewhere else; it is the account, and it holds a balance, a set of keys, and optionally one smart contract.

Kinds of accounts

KindExampleNotes
Top-level namedalice.near, alice.testnetCreated through the near or testnet registrar.
Sub-accountdiploma.retr0school.testnetOnly retr0school.testnet can create it. Great for organizing apps.
Implicit98793cd9…a8f (64 hex chars)Derived from a public key. Exists as soon as it receives NEAR.
ETH-implicit0x…Lets Ethereum wallets use NEAR directly.

This course runs on testnet, so accounts end in .testnet. The diploma contract you will mint from lives at diploma.retr0school.testnet, a sub-account of retr0school.testnet.

Read an account

Every account's balance and storage use are public. Run the example, then try your own testnet account.

Look up a NEAR account
<h1>NEAR account lookup</h1>
<input id="acc" value="retr0school.testnet">
<button id="go">Look up</button>
<pre id="out">Press Look up.</pre>

Edit this example in the Playground.

Open in Playground

Units

NEAR has 24 decimals. The smallest unit is the yoctoNEAR: 1 NEAR = 10^24 yocto. RPC responses return balances as strings in yocto, which is why the example uses BigInt.

Exercise

Look up demo-learner.retr0school.testnet on the testnet explorer and note its balance. Then explain the difference between that named account and an implicit account made from a public key.