Components of Decentralized Software
Delegates, contracts, and user interfaces (UIs) each serve distinct roles in the Freenet ecosystem.
Contracts control public data, or “shared state”.
Delegates act as the user’s agent and can store private data on the
user’s behalf, while User Interfaces provide an interface between these and
the user through a web browser. UIs are distributed through the P2P network via contracts.

Freenet Core
The Freenet Core is the software that enables a user’s computer to connect to the Freenet network.
Its primary functions are:
Freenet is essentially a global decentralized key-value store where keys are WebAssembly code called
Contracts. Contracts are stored in the network, along with their data or “state”. The contract
controls what state is permitted and how it can be modified, and also how to efficiently synchronize
state between peers.
A contract’s state is just a block of bytes, and can be anything from a simple number to a complex
data structure. The contract’s code defines the state’s formatting. Even the serialization format is
up to the contract, so it can be anything from JSON to Bincode, or a custom binary format.
When you use an application that handles private keys (a wallet, a messaging app, anything with cryptographic identity), you’re trusting that application with your secrets. Every library it imports, every dependency, every line of code has access to the same memory where your keys live. A single vulnerability anywhere in that stack can expose everything.
Delegates change this equation. A delegate holds your secrets and performs sensitive operations on your behalf, but the application itself never sees the secrets. The app asks the delegate to sign a message; the delegate returns a signature. The private key never crosses the boundary.
On the normal web, a user might visit https://gmail.com/, their browser will download the Gmail
user interface which then runs in their browser and connects back to the Gmail servers.
On Freenet the user interface is downloaded from a Freenet contract, and it
interacts with contracts and delegates by sending messages through
the Freenet core.

These UIs are built using web technologies such as HTML, CSS, and JavaScript, and are distributed
over Freenet and run in a web browser. UIs can create, retrieve, and update contracts through a
WebSocket connection to the local Freenet peer, as well as communicate with delegates.