Users
External parties called “Users” can connect to HotPocket nodes using WebSockets. Each HotPocket node keeps track of users connected to that node. All nodes share the connected user information with each other, which is then used to form a picture of all users connected to all the nodes. In essence, if a user connects to a HotPocket node, conceptually, it is as if the user is connected to the cluster. Practically, the node that the user connects to acts as the user’s doorway to the cluster.
HotPocket uniquely identifies a user by the ed22519 public key presented by the user upon establishing a WebSocket connection with HotPocket. This is cryptographically verified by HotPocket and it is assumed that all subsequent data exchanged via this established connection belongs to the user represented by that public key.
User inputs
Users can send arbitrary binary data to HotPocket nodes, to be interpreted by the DApp associated with each HotPocket node. Each HotPocket node shares all user inputs it receives with the other nodes in the cluster. After the consensus process is finished, every node feeds the consensed inputs into the DApp. This ensures the copy of the DApp on each HotPocket node gets fed the same set of user inputs as the other nodes. The DApp can interpret the user inputs as it deems necessary and act upon this information.
User outputs
The HotPocket DApp, based on its logic, can generate arbitrary binary data to be sent to specific users (i.e. user outputs) connected to the cluster. Each HotPocket node captures the user outputs generated by the DApp and subjects them to consensus. Consensus helps ensure that a majority of HotPocket nodes agree on the generated set of user outputs. The consensed outputs are then sent back to their intended recipient users via the HotPocket node that each user is connected to.