
Function-Call Keys
Function-Call keys can only sign transactions calling a specific contract, and do not allow to attach NEAR tokens to the call.
They are defined by three attributes:
receiver_id: The only contract which the key allows to call, no other contract can be called with this keymethod_names(Optional): The contract’s methods the key allows to call. If omitted, all contract’s methods can be calledallowance(Optional): The amount of NEAR allowed to be spent on gas. If omitted, the key can consume unlimited gas
Function Call Keys are meant to be shared with applications, so third-parties can make contract calls in your name. This is useful in multiple scenarios as we will see below.
Full-Access Keys
As the name suggests,Full-Access keys have full control of an account, meaning they can be used to sign transactions doing any action in your account’s behalf:
- Transfer NEAR Ⓝ
- Delete your account or create sub-accounts of it
- Add or remove Access Keys
- Deploy a smart contract in the account
- Call methods on any contract
Full-Access, otherwise you are giving total control over the account.
Signature Schemes
Independently of its permission level, every access key is a cryptographic key pair belonging to one of NEAR’s supported signature schemes. A public key is written as<scheme>:<base58-data>, where the prefix identifies the scheme — for example ed25519:CQLP1o1F3Jbdttek3GoRJYhzfT....
ed25519 is the most used scheme in NEAR wallets and tooling, since it can be used to derive implicit accounts.
secp256k1 is used mainly for chain signatures and Ethereum-compatible flows.
ml-dsa-65 is a post-quantum signature scheme, standardized by NIST as FIPS 204. It is designed to resist attacks from quantum computers, which - if sufficiently powerful - could derive private keys from ed25519 or secp256k1 public keys.
🧑💻 Technical: How post-quantum keys are stored
🧑💻 Technical: How post-quantum keys are stored
An To recognize one of your own post-quantum keys in such a list, derive the same handle from your public key: it is the SHA3-256 hash of the domain-separation tag
ml-dsa-65 public key is large — 1952 bytes, versus 32 for ed25519 — and its signatures are 3309 bytes. To keep accounts cheap to store, NEAR does not keep the full public key on-chain; instead it stores a 32-byte SHA3-256 hash of it — the same size as an ed25519 public key — which keeps the per-key storage cost close to that of a classical key.Because only the hash is stored, listing an account’s keys returns the hash, not the full key, for ml-dsa-65 entries. When you query an account’s keys (for example with view_access_key_list), ml-dsa-65 keys appear with an ml-dsa-65-hash: prefix instead of ml-dsa-65::near:ml-dsa-65-pubkey-hash:v1 followed by the raw 1952-byte public key. Hashing the key without that prefix will not match the returned value. To look up a specific key directly with view_access_key, pass the full ml-dsa-65: public key and the network hashes it for you.Limited Access Key Caveats
Function-call keys restrict what applications can do, but relying on them alone can leave an account unable to manage its keys or assets.Using Only Function-Call Keys
If an account has no full-access keys and only function-call keys, it becomes effectively restricted:- It cannot transfer NEAR, delete itself, or manage its own keys
- It can only perform the specific contract calls defined by the key’s
receiver_idandmethod_names
Allowance Exhaustion
Theallowance field defines how much NEAR the key can spend on gas fees:
- If set to a specific amount and fully consumed → the key becomes unusable and no new transactions can be signed
- If omitted (
null) → unlimited allowance (the key has no gas budget restriction) - If set to
0in anAddKeyaction → a zero budget, so every transaction signed with the key fails withNotEnoughAllowance