# Protocol description

**HAS** protocol is an open protocol for connecting applications (**APP**) to wallets (**PKSA**).&#x20;

The Hive Authentication Services (**HAS**) rely on the WebSocket protocol to exchange data between applications (**APP**) and the Private Keys Storage Application (**PKSA**) via persistent connections. The data can be passed in both directions as “payloads”, without breaking the connection and requiring additional HTTP requests.

The **APP** opens a WebSocket connection to the **HAS** endpoint and sends authentication and transactions requests to it.

The **PKSA** opens a WebSocket connection to the **HAS** endpoint, requests an encryption key from the server, registers the account(s) for which it will process requests, and wait for incoming authentication and transactions requests.

The **HAS** will queue requests from the **APP** and forward them to any newly or already connected **PKSA**. it will also relay back approval or refusal of the requests.

The dialogue between the different parties is done by means of JSON structured messages, each containing a `cmd` field that defines the nature of the message.


---

# 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/developer-documentation/protocol-description.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.
