--- id: access-keys title: Access Keys --- In all blockchains, users control their accounts by holding a `private key` (a secret only they know) and using it to sign [transactions](./transactions.md).  NEAR accounts present the **unique** feature of being able to hold multiple [Access Keys](https://en.wikipedia.org/wiki/Public-key_cryptography), each with its **own set of permissions**. We distinguish two types of Keys: 1. `Full-Access Keys`: Have full control over the account, and should **never be shared** 2. `Function-Call Keys`: Can sign calls to specific contract, and are **meant to be shared** --- ## Full-Access Keys {#full-access-keys} As the name suggests, `Full-Access` keys have full control of an account, meaning they can be used to sign [transactions](transactions.md) doing any action in your account's behalf: 1. Transfer NEAR Ⓝ 2. Delete your account or create sub-accounts of it 3. Add or remove Access Keys 4. Deploy a smart contract in the account 5. Call methods on any contract You should never share your `Full-Access`, otherwise you are giving **total control over the account**. :::tip The **first** Full-Access Key of an account is added when the account is **created** ::: --- ## Function-Call Keys {#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: 1. `receiver_id`: The **contract** which the key allows to call. No other contract can be called using this key 2. `method_names` (Optional): The contract's **methods** the key allows to call. If omitted, all methods can be called 3. `allowance` (Optional): The **amount of NEAR** allowed to be spent on [gas](gas.md). If omitted, the key can consume **unlimited** as gas Function-Call keys have the main purpose of being shared, so third-parties can make contract calls in your name. This is useful in [multiple scenarios as we will see below](#benefits-of-function-call-keys). :::tip `Function-Call` keys are secure to share, as they only permit calls to a specific contract and prohibit NEAR token transfers. ::: --- ## Benefits of Function-Call Keys `Function Call Keys` allows you to provide **restricted access** to third parties. This key type, unique to NEAR, enables several use-cases worth discussing. ### Enhancing User Experience The most common use case for `Function-Call` keys is to allow an application to sign transactions on the user's behalf. Imagine you are developing a game that records the user's score on a smart contract. On other chains, you would have to disrupt the user's experience to request transaction signatures each time the game needs to update the score. With NEAR, you can request the user to generate a `Function-Call` key for the game's contract and share it with the game. This way, the game can sign transactions in the user's name, eliminating gameplay interruptions. Sharing this key is safe for the user, because even in the case of somebody stealing it, they would only be able to call the score-keeping method, and nothing else.