## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Core Architecture

The architecture of Dao OS is not that of a traditional, monolithic operating system. It is a decentralized, layered paradigm designed for sovereignty, resilience, and extensibility. To understand it, one must understand its three fundamental entities: the Meta Unit, the Avatar, and the Dao Implement.

## 1. The `Meta Unit`: The Portable Soul-Code

The `Meta Unit` is the conceptual core of a user's digital existence, but it is not a running program by itself.

- Its Nature: The Meta Unit is a portable library or artifact (e.g., a `.wasm`, `.so`, or `.dll` file). It contains the user's complete, end-to-end encrypted "Second Brain" (all data), core service APIs (identity, P2P networking, AI infrastructure), and the logic for managing them.
- Its Role: It is the passive, unified, and single source of truth for the user's data and core capabilities. Like Java bytecode (`.class` files), it defines what is possible but does not execute on its own. It is the "precise machine" waiting to be activated.

## 2. The `Avatar`: The Runtime Environment

An `Avatar` is the active entity that gives life to the `Meta Unit`.

- Its Nature: An Avatar is any executable program or process whose primary function is to load, host, and execute an instance of the `Meta Unit` library. It is the "power source" that activates the machine.
- Its Role: The Avatar acts as the crucial bridge between the abstract `Meta Unit` and the concrete host platform (iOS, Windows, a web browser, the command line). It provides the `Meta Unit` with access to system resources like CPU, memory, storage, and networking. In the Java analogy, the Avatar is the JVM (Java Virtual Machine).
- The Dao Network: All of a user's running Avatars form a private P2P network, keeping their embedded `Meta Unit` instances constantly and seamlessly in sync.

## 3. `Dao Implements` (`道器`): The Ecosystem of Software

"Dao Implement" is the universal term for any third-party software designed to integrate with the Dao OS ecosystem. They are the applications and services that users interact with. An Implement becomes an Avatar by integrating the `Meta Unit`.

An Implement is composed of different types of components based on its design.

- `Facet Component` (`器`): The part of a Dao Implement that has a user interface. It is the "control panel" for the `Meta Unit`, responsible for presenting information to and capturing input from the user.
- `Core Component` (`核`): The headless, backend logic part of a Dao Implement. It runs as a service, providing specific capabilities that can enhance the Meta Unit or be called by other Implements. It is an "add-on tool" for the machine.

### Application Architecture Freedom

Developers have complete freedom in how they structure their `Dao Implement`:

- They can create a standalone application that is itself an Avatar, bundling the Meta Unit library, a Core component (for logic), and a Facet component (for UI) into one executable.
- They can create a distributed application, where a Facet Implement on one device communicates with a Core Implement on another.
- They can create a pure Core Implement (an "extension") that just provides a new backend capability to the user's entire Dao.
- They can also create a pure Facet Implement that has no custom backend logic (`Core Component`). This type of application's UI directly interacts with the built-in core services of the `Meta Unit` to create a simple utility.

This architecture ensures that Dao OS is not just a platform, but a truly open, composable, and decentralized ecosystem.