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

# Technical Overview

This document provides a high-level overview of the architecture, core technologies, and guiding principles for developers looking to build `Dao Implements`—applications and services that integrate with the Dao OS ecosystem.

## Guiding Technical Principles

- Library, not Framework: Dao OS is not a restrictive framework. The `Meta Unit` is a portable library that you integrate into your own application, empowering it with new capabilities without dictating its internal architecture.
- Openness & Polyglotism: Any application, written in any language, can become an `Avatar` (a runtime for the `Meta Unit`). We achieve this by providing the `Meta Unit` as both a WASM library for web/scripting languages and as a native library (`.so`, `.dll`, `.a`) for system languages.
- API-First: All interactions with the `Meta Unit` are conducted through a stable, versioned, and well-documented API.
- Security-First: The `Meta Unit` is a secure vault. All data is end-to-end encrypted, and all interactions are governed by a strict, user-controlled permission system.

## The Core Integration: How an App Becomes an `Avatar`

The journey of creating a `Dao Implement` begins by integrating the `Meta Unit` library, which instantly transforms the running application process into a sovereign `Avatar` in the user's Dao network. We provide two primary integration paths.

### 1. Web Integration Path (via `dao.js` SDK)

This is the easiest and most accessible path for web developers.

- How it works: A developer can take any new or existing web application. By including our `dao.js` SDK, their web app gains the ability to load the `Meta Unit`'s WASM binary (`dao.wasm`).
- The Transformation: Once the user grants permission, the browser tab running the web app becomes a temporary `Avatar`. The web app's JavaScript can then communicate with the `Meta Unit` via the high-level API exposed by the `dao.js` bridge.
- Best for: Building `Facet Implements` (`器`) quickly, creating data visualization dashboards, and integrating existing PWAs (Progressive Web Apps) into the Dao ecosystem.

### 2. Native Integration Path (via FFI)

This path offers maximum performance and deep system integration for native applications.

- How it works: A developer of a native application (written in Rust, Go, Swift, Kotlin, C++, etc.) can link against the `Meta Unit`'s native library.
- The Transformation: The running native application process becomes a persistent `Avatar`. The application's code communicates with the `Meta Unit`'s services via a Foreign Function Interface (FFI) bridge.
- Best for:
  - Creating powerful, always-on `Core Implements` (`核`) on servers or NAS devices.
  - Building high-performance, native `Facet Implements` (`器`) like our ideal Flutter-based mobile clients.
  - Adapting existing open-source native applications.

## Key Technologies & Protocols

Category | Technology / Protocol | Purpose
--- | --- | ---
Core Library | Rust -> WASM / Native Libs | To create a single, safe, and performant core logic for the `Meta Unit`.
Web Integration | `dao.js` SDK (JavaScript/TypeScript) | The bridge for any web application to become an `Avatar`.
P2P Networking | `libp2p` | Modular peer discovery, transport, and secure channels.
Data Synchronization | CRDTs (Conflict-Free Replicated Data Types) | Ensuring eventual consistency across Avatars.
Identity | DID & VC | Sovereign identity and interoperable, cryptographic trust.
Data Serialization | Protocol Buffers (Protobuf) | Efficient, language-agnostic data structures for APIs.