# Challenge request

When an **APP** request the **PKSA** to sign a challenge, it will receive the following message:

### challenge\_req

```javascript
{
    cmd: "challenge_req"
    account: string
    data: string
    uuid: string
    expire: number
    token: the authentication token - DEPRECATED since protocol v1
}
```

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

* **`account`**: the Hive account name
* **`data`**: the Base64 representation of an encrypted `challenge_req_data` object
* **`uuid`** {string} the transaction request identifier
* **`expire`** {Number} UNIX time when the request will expire<br>
* **`token`**: the authentication token  - **Deprecated since protocol v1**
  {% endtab %}
  {% endtabs %}

The **PKSA** must decrypt the `challenge_req_data` object using the encryption key previously shared with the **APP** (`auth_key`)

The structure of the `challenge_req_data` is:

### challenge\_req\_data

```javascript
{
    key_type: string,
    challenge: string,
    decrypt: boolean = false // protocol >= 1
    nonce: number
}
```

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

* **`key_type`**: the key type required to sign the transactions. It can be one of `posting`|`active`|`memo`.
* **`challenge`**: a string to be signed
* **decrypt**: (optional - default value is false) indicates if the passed `challenge` must be encrypted (decrypt=false) or decrypted (decrypt=true) before being returned by the **PKSA**
* **`nonce`**: UNIX time of the request
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hiveauth.com/has-for-wallets-pksa/challenge/challenge-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
