At the core of Unchained there are two main concepts: Datagrams and Functions. This section will explain what they are and how they work.
A Datagram is a piece of data that is sent from one computer to another. It is the basic unit of communication in Unchained. Datagrams can be of any size and can contain any type of data. However, there is still a structure to how they're made.
Datagrams must be send by an authenticated user. The user must first send a HELLO message to the network to authenticate. The HELLO message contains the user's name, EVM address, public key, and short public key. The user is then challenged by the network to prove that they have the private key that corresponds to the public key. The user must then fulfill the challenge by sending a KOSK message to the network. The KOSK message contains the challenge and a signature of the challenge:
After authentication, the user can send Datagrams to the network. The below chart shows how a Datagram is structured:
All packets must be signed by the user who sends them. The signature is the Sia binary representation of the packet's contents, signed by the user's BLS12-381 private key. The signature is then verified by the recipient using the user's public key. The following DST should be used for the signature:
Users can subscribe to topics to receive Datagrams. The below chart shows how users can subscribe to topics:
A Function is a piece of code that is executed on a computer. It is the basic unit of computation in Unchained. Functions can be of any size and can contain any type of code. Functions are added to the network by users, through worker plugins.
Workers need to register the Functions they can execute. Workers need to authenticate with the network before they can register Functions. The below chart shows how the registeration process works:
Once a Function is registered, it can be executed by any user on the network. To run a Function, a user sends an Execution request to the network. The below chart shows how the execution process works:
Pl. de l'Industrie 2, 1180 Rolle, Switzerland