> For the complete documentation index, see [llms.txt](https://docs.hiveauth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hiveauth.com/has-for-wallets-pksa/account-registration.md).

# Account registration

The **PKSA** can register one or more accounts and do it either by issuing one command with multiple accounts or by issuing one command per account.

The **PKSA** sends the following message to the **HAS**:

### register\_req

```js
{
    cmd: "register_req",
    app: string,
    accounts: [ 
        {
            name: string
            pok: string
        }
        {{,...}}
    ]
}
```

{% tabs %}
{% tab title="Properties" %}

* **`app`**: can contain any value identifying the **PKSA**
* **`accounts`** an array that can contain one or more `account` objects
  * **`name`**: the Hive account name
  * **`pok`**: the current [UNIX time](https://en.wikipedia.org/wiki/Unix_time) encrypted using the account private key and the HAS server public key (see [Proof of Key](/has-for-wallets-pksa/proof-of-key.md))
    {% endtab %}
    {% endtabs %}

The [Proof Of Key](/has-for-wallets-pksa/proof-of-key.md) sent to the **HAS** for each account enables it to verify that the **PKSA** has access to the private keys of the account it wants to register.&#x20;

This prevents malicious actors from creating a **PKSA**, registering accounts for which they do not have private keys, and sniffing requests relayed by the **HAS**.

{% hint style="info" %}
The `register_req` command can be issued multiple times. If an account is already registered, the command will be ignored.
{% endhint %}

{% hint style="danger" %}
When multiple accounts are registered at the same time, the HAS server will check that **ALL** provided accounts exist on the Hive blockchain and return an error if **any** of them does not exist and cannot be registered.
{% endhint %}

For each successfully registered account, the **HAS** server will reply with the following message:

### register\_ack

```
{
    cmd: "register_ack",
    account: string
}
```

{% tabs %}
{% tab title="Properties" %}

* **`account`**: the account that has been successfully registered
  {% endtab %}
  {% endtabs %}

**Timing**

The account registration can be performed before or after the HIVE applications will issue related authentication or transaction requests.

a) If the **PKSA** registration occurred before the requests are issued, it will receive those requests immediately.

b) If no **PKSA** is registered when the **HAS** receives authentication or transaction requests, it will queue them, waiting for a **PKSA** to register. If no **PKSA** registers before they expire, requests are discarded.

In both cases, (a) and (b), the **APP** will be notified of the requests' pending or expired status.
