Skip to main content

8 posts tagged with "plan"

View All Tags

Sichat will be a set of FOSS packages with dual licenses (MIT + Apache2). It is based on a set of FOSS software. The following is list of software that might be used.

  • Self Identity
    • Decentralized Identifiers: A W3C recommendation. We may or may not follow this standard because it is big and lack of implementation details.
    • Decentralized Web Node: "A Decentralized Web Node (DWN) is a data storage and message relay mechanism entities can use to locate public or private permissioned data related to a given Decentralized Identifier (DID)."
    • tbd Web5: Jack Dorsey's Web5 of decentralized web platform. Source code is in Github TBDev.
  • P2P Network
    • rust-libp2p: The Rust implementation of libp2p spec. It has many components to build a decentralized network.
  • Chat
    • The [matrix] is an open standard for secure, decentralized, real-time communication. It includes Instant Messaging (IM), Voice over IP (VoIP) and Internet of Things (IoT) communication.
    • Conduit is a Matrix home server written in Rust.
    • FluffyChat is a Matrix messenger App written in Flutter.
  • Server and Database
    • Fly.io let you deploy your applications and databases in a container in less than a second.
    • SQLite is an in-process library of SQL Database engine. It is very mature and simple to use/manage.
    • Litestream is a replication and backup tool for SQLite.
  • Client Development
    • Flutter is a framework to build Apps for mobile, web and desktop.

Sichat 为主权个人(sovereign individual, 简称 SI)及其组织(sovereign individual organization, 简称 Siorg)提供 Web3 的基础设施和安全的通信功能。与基于区块链和通证的 Web3 系统不同,Sichat 的创新点在于其基本的组成元素和组织方式。

组成元素: 数字时代的 SI 拥有数字资源。 "Bring your own client and server" 让 SI 可以产生自主身份(self identity)并控制其数字资产。在此基础上,SI 以可认证方式发布信息或者搭建网站。

组织方式: 一个完全由 SI 的自有计算机组成的 P2P 网络可以为 Siorg 提供基本的通信功能并由具体应用实现端到端的安全保证。其特别之处在于每一个 Siorg 都有专属的,独立的,去中心化网络。Secure chat 作为 SI 和 Siorg 的第一个应用, 主要提供成员的安全通信。

这些基础设施和安全通信会成为更多 Web3 应用的基础。

Last updated on 09/07/2022.

本文讨论了有关 Web3 的三个话题:概念认知误区,去中心化的理论基础以及 Web3 基础设施的构建视角。

  • 区块链和通证是 Web3 的应用,而不是其基本要素。
  • 密码学的核心理论是任何使用可信任权威的计算都可以不通过可信任权威(去中心化)来执行。
  • Web3 的基础设施构建应该从主权个人(而不是互联网用户)的视角出发。

1 Web3 的一个误区

Ethereum 联合创始人 Gavin Wood 于 2014 年创造了 Web3 这个词来代表下一代的 Internet,但是并没有给出详细的说明。Web3 的目的是让每个人可以掌握自己的数字身份、资产和数据。但是脱胎于区块链的 Web3 概念却有一个很大的误区。比如 Wikipedia 的 Web3 词条 就包含了去中心化,区块链以及通证经济(token-based economics)三个相关概念。

以互联网发展速度而言,时隔多年,区块链和通证的应用仍局限于数字货币及其金融衍生交易,在其他领域乏善可陈。二者都有很大的缺陷:区块链的全体共识机制与数据广播效率很低,有扩展瓶颈。通证则面临实际价值与立法的挑战。这些缺点都是达成 Web3 目标的很大限制。Web3 的开发进展令人失望,2021 年底的二种观点很有代表性:Elon Mask 认为 Web3 不存在,Jack Dorsey 则认为现在的 Web3 尝试都还是受人控制。

The DFINITY FoundationInternet Computer 是很有代表性的一个去中心化应用。作为一个基于区块链和智能合约的通用计算和存储平台,有自己的 Token 用于付费、交易以及治理。从功能上 Internet Computer 可以用于金融交易,DAO, Chat 到 Web Server 的各种应用。实际上由于底层的区块链本身的限制,2022 年 6 月份的数据显示其交易的确认需要 1-3 秒,数据存取速度为 11,500 write/s, 250,000 read/s。这些性能数据及其基于一个强大公司支持的运行模式制约了这类基于区块链和通证系统的去中心化系统的应用场景,会让普通的 Web 使用者望而却步。

2022 年 4 月 Gavin Wood 在 CNBC's "Beyond the Valley" podcast 中给出了 Web3 的解释和澄清:

  • “Web3 is really sort of an alternative vision of the web, where the services that we use are not hosted by a single service provider company, but rather they’re sort of purely algorithmic things that are, in some sense, hosted by everybody. So it’s like, it’s very peer to peer, right? ... The idea being that all participants sort of contribute a small slice of the ultimate service。”
  • ”But I think ... overall, we’re going to start seeing services be delivered without the need to use tokens。“

我们同意这个 Web3 的描述,即 Web 应该是所有参与者提供的细小服务的总集成。去中心化的互联网并不是建立在区块链和通证上。区块链和通证是去中心化的应用特例,而不是下一代互联网的基础设施。

2 去中心化的根本

去中心化的根本在于密码学的核心理论 central theorem in crypto:"That says that any computation you'd like to do, any function F you'd like to compute, that you can compute with a trusted authority, you can also do without a trusted authority. " 密码学使得任何使用可信任权威的计算都可以去中心化(不通过可信任权威)来执行。

Web3 的基础设施包括个人身份,数据安全机制,通信安全机制,自治组织等,都是以去中心化的方式实现。密码学带来的自主个人身份,加密,签名,共识验证等是构建下一代互联网的基础设施的基本要素。其中自主个人身份处于核心地位,它提供了其他所有应用的基础。没有自主个人身份,则去中心化无从谈起。令人欣慰的是上述基本要素经过几十年的发展,基本都有比较成熟的产品可供使用。新的加密技术如零知识证明(Zero Knowledge Proof ZKP)有望带来很好的隐私保护和很多应用的性能提升。

3 Web3 的构建视角

Web3 的基础设施构建应该从主权个人(而不是互联网用户)的视角出发,因为二者有本质差别:一个是主权拥有者,一个是系统的使用者。从后者出发构建的任何系统都很难避免受人控制。上述 Gavin Wood 的观点也明确了参与者是未来互联网服务的提供者,而不仅仅是用户。作为服务提供者需要拥有联网、计算和存储这三个数字时代的基本资源。

The Sovereign Individual: Mastering the Transition to the Information Age 这本书预测主权个人 Sovereign Individual (SI for short) 会在数字时代取代国家成为主要的组织形式。今天的主权个人具有以下特点:

  • owns digital resources including network connection, computers and storage.
  • has necessary mental capital that plays crucial role in digital economy -- where unskilled workers make much less contributions.
  • has self-sovereign identity, or self identity for short.

在上述基础上,主权个人有很大自主性过一种完全不同的生活方式:

  • owns self-sovereign digital assets (bitcoin, NFT, private data).
  • pays tax to autonomous SI organizations.
  • creates and shares narrow-casting (not broadcasting) information.
  • chooses anywhere to live and usually works remotely for self-chosen tasks.

从主权个人的视角出发,其特点和生活方式是 Web3 基础设施构建的出发点。

Last updated on 09/05/2022.

1620 年 11 月 21 日, 五月花号船上的 41 名成年男子在登陆北美的前一天,签署了《五月花号公约》(Mayflower Compact),自愿结成一个自治民事团体,承诺构建一套公正、平等的法律体系并遵守和服从。这份公约创造了一个先例:社会成员可以自由结合,并通过制定对大家都有利的法律来自治。历史证明了这种组织方式的高效率和人类文明进步。

二十一世纪的人们拥有了互联网,正筹划星际旅行,但个人与自治组织受制于低效无能的政府和大公司。基于与《五月花号公约》相似的理念,Sichat 试图为主权个人(sovereign individual, 简称 SI)及其组织(sovereign individual organization, 简称 Siorg)提供一套数字时代的网络基础设施和安全的通信功能。与区块链或有近似理念的 Web3 系统不同,Sichat 的创新点在于其基本的组成元素和组织方式。下面分别从物理层面和应用层面加以阐述。

1 组成元素

SI 通常早已拥有数字时代的三种基本资源:计算能力、存储能力、和联网通信,

1.1 物理层面

数字时代的 SI 拥有联网的 client and server。Client 通常指随身携带的移动通讯设备比如智能手机。Client 为 SI 提供了随时随地的信息访问和通信能力,可以看成是 由本地处理能力的用户界面 UI。Server 通常指云端的计算机,有稳定持续的网络连接,强大的计算能力以及可靠的存储空间。Server 是 SI 的在互联网的数字化替身,提供 24 x 7 的在线处理和存储功能。 bring your own client and server 是整个系统至关重要的前提。具体实现上有很大的灵活性,可以是一部智能手机或一个强大的计算机集群。

1.2 应用层面

SI 拥有的数字资源让其可以产生自主身份(self identity)并对其数字资产有完全控制。自主身份是 SI 主权的根本需求和标志性功能。在此基础上,SI 可以利用现有互联网发布各种信息(比如 microblog, blog)或者搭建网站等。

2 组织方式

SI 的社会属性产生创建自治组织(Siorg)的需求。Siorg 有自己的专属网络。

2.1 物理层面

SI 需要一种基础架构来完成基本的组织创建和安全的通信功能。一个完全由 SI 的自有计算机组成的 P2P 网络 (Orgnet) 可以为 Siorg 提供基本的通信功能。安全性则在 SI 的计算机里由具体应用实现端到端的安全保证。

Sichat 的特别之处在于每一个 Siorg 会有自己的专属 P2P 网络 Orgnet,独立运行并且相互平等。Siorg 对其网络有完全的控制权。所有的 Orgnet 组成了完全的去中心化互联网络 fully decentralized network or Orgnets

初始的 Orgnet 是一种私有网络(private network)或有许可网络 (permissioned network)。具体的许可规则由 Siorg 制定。这样就免掉恶意节点和 DOS 的攻击问题,极大的简化了网络协议和应用层协议。

2.2 应用层面

Secure chat 作为 SI 和 Siorg 的第一个应用, 组织规则可以非常简单,主要功能也只是提供成员的安全通信。

作为基础设施的完全去中心化的 P2P 网络及之上的 Siorg 可以有很多组织方式和应用。比特币和以太坊都是很好的例子。区块链和加密货币的出现让 SI 第一次可以自主参与系统运作、拥有和交易各种数字货币。相比区块链节点和数字货币交易钱包,Sichat 所提供的组织内的安全通信是每个 SI 的基本需求,也为其他协同应用提供基础服务。如同《五月花号公约》的诞生,Sichat 是数字时代的主权个人和及其自治组织的一个开端。

3 与区块链和 Web3 的比较

3.1 与区块链的比较

Sichat 借鉴了比特币和以太坊的核心设计概念,比如自主身份和 P2P 网络。可以认为 Sichat 抽象了区块链系统的基础设施使其适合更多的应用领域。这种抽象带来了二者的关键不同:

  • Sichat 的基础是自主身份,而不仅仅是有个交易账户的概念。自主身份本身就有很多应用,比如签名认证、发布博客、自建网站等。
  • Sichat 对于数字资源有明确的假设,Client 和 Server 的功能区分体现了互联网的现实应用场景。
  • Sichat 的每个组织有专属的独立运行的 Orgnet 网络,每个 SI 会同时参与多个网络。区块链应用通常共享同一网络。
  • Sichat 的网络是私有或有许可的。比特币和以太坊则是无需可的公共网络。

未来如果 Orgnet 支持无许可接入,那么区块链的应用和 secure chat 一样,完全可以看成是一个应用特例。

3.2 与 Web3 的区别

Web3 是一种理念,集中体现在个人的权利和去中心化自治团体 (Decentralized autonomous organization)。这二点都和 Sichat 的理念非常接近。但是在实践中 Web3 有很多具体问题,比较突出的二个是:

  • 过于官僚和复杂。其自主身份 (Decentralized Identity DID)的设计历经多年仍是庞大复杂,难以落实。
  • 和区块链过于紧密。很多的 Web3 实现都基于或靠近区块链。但是区块链的全体共识机制带来性能瓶颈,使其只适合特定需要这种全体共识的应用场景,比如加密货币。其他的应用还在探索中。

Sichat 采用简单可行的自主身份,"bring your own client and sever", 以专属通用的去中心化网络避免了上面的问题。可以说 Web3 是一种理念,Sichat 是为其提供了简单实用的基础设施。

Last updated on 09/03/2022.

Sichat stands for Sovereign Individual (SI) Chat. It provides self identity and secure chat in an internet of P2P networks. The requirements of "bring your own device" and "bring your own server" create a fully decentralized ecosystem that enables many secure and individual-centric applications.

The project's Chinese name is "私信" - 主权个人通信.

1 Motivation

1.1 Sovereign Individual

The main idea of "sovereign individual" came from the book The Sovereign Individual: Mastering the Transition to the Information Age. It predicts that the domainant institution in the digital age is sovereign individual. As was in the case that gunpowder, capital and printing press brought the institution transition from religion/feudalism to nation-state, the information revolution is bringing the institution transition from nation-state to soverign individual(SI). Ideally, an SI is someone who

  • has necessary mental capital that plays crucial role in digital economy -- where unskilled workers make much less contributions.
  • has self-sovereign identity, or self identity for short.
  • owns self-sovereign digital assets (bitcoin, NFT, private data).
  • pays tax to autonomous SI organizations.
  • creates and shares narrow-casting (not broadcasting) information.
  • chooses anywhere to live and usually works remotely for self-chosen tasks.

1.2 SI Organization (Siorg)

The human nature of SI searches for meaning in social life. SIs with a common interest form an SI organization, Siorg for short, that can bring the collective morality, a sense of purpose, and a coherent set of orders, primarily in a digital manner. As Siorg unlocks the potential of SIs and minimize the collaboration cost, it will be much more productive than the nation-state. Siorgs, not information-based aggregators (like Google) will be the dominant institution in digital age. Siorg has the following characteristics:

  • it is formed by SIs who share a common interest for a purpose.
  • its creation and operation are decentralized.
  • its autonomous government is mostly based on transparent software contracts.

The Siorg here is a general term: a family, two persons chit-chatting with each other, and an institution with 1,000,000 SIs working/living together are all examples of Siorg. In a chat application context, the chat Siorg is called a group.

2 Sichat Features

Following the "keep it simple stupid" principle, Sichat provides two essential building blocks and a secure chat application for SI and Siorg. The two building blocks are self identity and an internet of P2P networks. More applications can be built on top of self identity and the P2P networks.

2.1 Self Identity

To truly own and control computation and data, SIs in digital age bring their own devices and servers. Individuals create and control their digital identities and related information in their own computers. The core of a self identity is a pair of randomly generated private and public keys. An individual may have multiple identities used in different interaction contexts. There are many challenges to implement this conceptually simple capability because of its crucial role and two often conflicting requirements - easy to use and safe to use. It has the following functions:

  • id creation and storage
  • authentication
  • lost id recovery
  • stolen id revoke
  • id and alias binding
  • data encryption and decryption
  • message signature and verification

We put authentication, encryption and signature as part of self identity module to let the individual to have full control of the cryptography algorithms used in online interactions.

2.2 Private P2P Network

One SI brings at least one computer to create/join a private P2P network. The network is fully decentralized in the sense that it is a P2P network whose only nodes are SIs' computers. Every SI may join one or more Siorg, and one Siorg owns at least one P2P network. Every P2P network runs independently as an VPN and may or may not communicate with other P2P networks.

The P2P network is an overlay network based on one or more of the following networks:

The direct connections use a device's built-in communication technologies such as Wi-Fi or Bluetooth. It is useful in P2P network creation and situations where Internet and mobile network are not available.

Because the P2P network's applications implement end-to-end (E2E) encryption at the application layer, the network makes no assumptions about the security of the underlying network. Additionally, one P2P network may provide add-on services such as VPN or Tor routing functions to its nodes.

2.3 Secure Chat

Individuals form groups that create and use dedicated P2P networks to sent E2E encrypted chat messages to each other. A distinctive feature of Sichat is that each group owns one dedicated P2P network whose nodes are computers from its members. The group-network binding provides many benefits.

  • each group operates independently and autonomously.
  • the performance and scalability are good for most groups.
  • an SI can use different ids/aliases and other settings in different group.

The downside is that an individual usually have many ids and many networks to manage.

2.4 More Applications

With self identity and private P2P network as the foundation, it is straightforward to provide basic decentralized applications as the following:

  • digital wallet and payment
  • group event/calendar management
  • individual/group microblogs or blogs
  • audio/video channels
  • search and index of individuals and/or groups

Following applications requires more efforts but they are good fits for the self-id and private network.

  • all kinds of decentralized autonomous organization (DAO)
  • Web integration
    • self-hosting email server
    • self-hosting web server
    • e-commerce server
  • Blockchain integration
    • public permanent data in block chain
    • world facts from Oracles
    • name server in block chain
  • app store: more applications can be installed on demand

3 System Design

This is a draft design that may change significantly during prototype and following development.

3.1 guiding principles

  • It is fully decentralized by nature, as the way of SIs' life. No one owns the code and the system.
  • In code we trust. Sichat is open source in both the free beer and free speech meanings. It uses a dual license of MIT + Apache 2.
  • It is an open, modularized, customizable, and extensible system that is permanently built by collective effort of SIs.

3.2 System Architecture

Sichat assumes that An SI has the following digital resources:

  • a computer in hand/home that is at least as capable as iPhone 7 (released on 09/16/2016). This computer is called an SI client or client for short.
  • a more reliable and more powerful cloud computer, called An SI server or server for short.

The assumption of bringing your own client and server plays a crucial role to create a fully decentralized network. The reliable connection, computation and storage are important to many non-trivial applications. It also simplifies the implementation because servers have reliable connection, computation and storage.

In future implementation, we may remove the server requirement because many applications don't need the reliability for every SI. In an extreme case, a P2P network only has clients and the network is still useful when Internet and mobile net are not available, and clients can directly connect to each other.

We use the term node to refer either a client or a server when there is no need to distinguish them. An implementation principle is to treat all nodes as much equally as possible to simplify the development.

When two or more SIs form a group, Sichat creates a P2P network. The network is called an orgnet because a chat group is an specific instance of Siorg.

An SI's clients and server are synchronized as soon as possible. Because an server is more reliable than a client, the server's data is used as the source of truth when there is a conflicting between a client and its server.

4 Prototype Plan

The prototype scope is to implement an orgnet consisting of two FSIs.

  • Two SIs create self identifiers and stored both in client and in servers.
  • Two SIs create a group manually using their clients.
  • They send/receive message routed/stored in their servers.

The closest open-source chat protocol is Matrix Protocol. There are many client and sever implementations. Jobs to be done are:

  • implement the self identity.
  • change Matrix federation network into one decentralized orgnet.
  • combine the Matrix client and server to make it a P2P application.
  • create and setup server in cloud.
  • sync data between client and server.

After some explorations, we decide to use the Rust programming language for the server and flutter+ Rust for client.

We use SQLite in both client and server for its simplicity and maturity.

Let's do it.

Sidao stands for Sovereign Individual Decentralized Autonomous Organization.

1 The Idea

The term "sovereign individual" came from the book The Sovereign Individual: Mastering the Transition to the Information Age. It predicts that the domainant institution in the digital age is sovereign individual. As was in the case that gunpowder, capital and printing press brought the institution transition from religion/feudalism to nation-state, the information revolution is bringing the institution transition from nation-state to soverign individual(SI). SI is who

  • owns mental capital that plays crucial role in digital economy -- where unskilled workers make much less contributions.
  • chooses anywhere to live and usually work remotely for chosen tasks.
  • pays tax to the First Bank of Nowhere.
  • creates and shares narrow-casting (not broadcasting) information.

The human nature of SI still searches for meaning in social life. SIs form DAOs that can bring the collective morality, a sense of purpose, and a coherent set of orders, primarily in a digital manner. As DAO unlocks the potential of SI and minimize the collaboration cost, it will be much more productive than the nation-state. DAOs, not information-based aggregators (like Google or Metaverse) will be the dominant institution in digital age.

The DAO here is a general term: a family is a DAO, two persons chit-chatting with each other form a DAO. An institution with 1,000,000 SIs working/living together is also a DAO.

Sidao is a system that gives SIs the self identities, resources and platforms to create/join, operate and terminate/leave DAOs.

2 The System

2.1 System Features

Sidao is a digital system that has the following features:

  • It is open source in both the free beer and free speech meanings. We use a dual license of MIT + Apache 2.
  • It is an open, customizable, and extensible system that is permanently built by collective effort of SIs.
  • It is decentralized by nature, as the way of SIs' life.
  • It is permission-less.
  • SIs have full control of their privacy, data and fair share of responsibilities/rights in DAOs they participant.
  • It is a P2P system in almost every perspective: creation, collaboration, operation, governance and termination.

2.3 System Functions

Sidao has the following functions for both SIs and DAOs, all in a decentralized P2P manner:

  • multiple identifiers for multiple DAOs.
  • basic communication
    • multi-media chat with optional end-to-end encryption.
    • microblog and blog following/unfollowing each other.
    • Web site for any purpose and RSS feed.
  • event organization
  • tokens as right, asset and exchange media.
  • digital wallets and financial transactions
  • DAO governance and operation
  • Searching and indexing
  • Other Web2/Web3 Services Integration
    • private email server and storage
    • public permanent data in block chain
    • world facts from Oracles

For SIs living in a totalitarian country, the P2P network shave have built-in VPN.

3 Implementation

3.1 Digital Resource Assumption

In reality, we assume SIs have the following digital resources:

  • a computer in hand/home that is at least as capable as iPhone 7 (released on 09/16/2016). This computer is called An SI client or client.
  • a "good" connection to Internet. The connection could be on-demand.

We also assume that most SIs have a cloud computer, called SI agent or agent. An SI without An SI agent is called a Limited SI (LSI) and use the SI for those who has an agent. The SI agent is online most of the time. It also has reliable permanent storage that can be purchased from most cloud service providers. The SI clients and agents will form many P2P networks controlled by their owners.

3.2 System Architecture

The SI client provides the UI and local storage for offline access. Due to the size limitation and reliability concerns, the SI client only has minimum functional data and caches recently-used data. The corresponding agent has the full data set and much rich functions.

Clients and agents form many P2P networks on demand.

Last updated on 08/31/2022.

There are three choices of tech stacks for Sidao development. It is a strategic decision that cannot be changed for a few years.

C# and MAUI

At the beginning (before August 2022), I planned to use C# as the full-stack programming language for two simple and very valuable reasons:

  • C# is probably the best and mature OO programming language.
  • MAUI supports cross-platform development.

It might be a good choice for business application development. For crypto or system applications, C# has two drawbacks: lacking of libraries and mediocre performance. The lacking of libraries makes it an impossible choice.

TypeScript and Go

In early August 2022, when the development is centered around Matrix protocol, the choice became easier: Matrix has a Go implementation of server side and two React Native clients. It became nature to use React Native for the client and Go for the backend. Additionally Gun protocol is fully based on JavaScript.

However, during the development of Gun client, it became clear that using TypeScript and React Native is a big challenge: using TypeScript in React Native is a big mess, NPM packages is another big mess, Expo and React Native code is unpleasant to read and write. One can easily loses many days dealing with tricky things in React Native ecosystem.

Flutter and Rust

After briefly reviewing the Flutter development, it became clear that it is easier and cleaner than React Native. It is more popular than React Native since 2021. Why don't give it a try?

On the backend, and possibly for client-side library, Rust seems a good choices for two reasons:

  • it is the most popular language for system or crypto development.
  • it is much faster than Go and C#.

Dark was unveiled in 10/2011. Flutter was initially released in 05/2017. Rust was first appeared in 07/2010. All three are mature enough for production.

Last updated on 08/31/2022.

The project to be developed is named Sidao. It stands for sovereign individual decentralized autonomous organizations. As the name hints, it has two parts:

  • sovereign individual: self identity and privacy.
  • decentralized autonomous organizations: one's social life in a decentralized and autonomous way.

Phase 1

As any ambitious project, it starts with small, achievable steps. The first phase is creating a chat app using the Matrix protocol. The chat app has the following components:

  • Chat app
  • Matrix home server
  • Self identity (may involve changes in both app and backend)

Phase 2

P2P payment in US$.

Phase 3

Event management and payment settlement

Phase 4

Microblog and blog.

Phase 5

SI web site

Phase 6

From group chat to DAO.