# 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.
