Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ Chia学院的课程页面经过精心设计,以增强学生的学习体验。

所有适用的课程都提供了Chialisp和clvm的可运行插件。 花些时间熟悉这些工具,并学习如何在整个课程中最好地利用它们。 每个插件都有一系列组件:

**语言:** 插件的语言(Chialisp或clvm)位于右上角。
**解决方案(Solution):** 顶部部分是输入或解决方案。
**谜题(Puzzle):** 底部部分是谜题。
**运行:** 每个插件在语言标识符右侧都有一个播放/运行按钮。
**语言:** 插件的语言(Chialisp或clvm)位于右上角。
**解决方案(Solution):** 顶部部分是输入或解决方案。
**谜题(Puzzle):** 底部部分是谜题。
**运行:** 每个插件在语言标识符右侧都有一个播放/运行按钮。
**结果:** 单击运行后,谜题的结果将出现在谜题下方。

:::info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ import Runnable from '@site/src/components/Runnable.tsx';

### 可运行的Chialisp和clvm插件

有关使用这些插件的信息,请参阅[学院概述](/academy-overview#可运行的chialisp和clvm插件)。
有关使用这些插件的信息,请参阅[学院概述](/academy-overview#runnable-chialisp-and-clvm-plugins)。

#### Chialisp 插件

Expand All @@ -149,7 +149,7 @@ import Runnable from '@site/src/components/Runnable.tsx';

### 链接

- [Chialisp基本概念](https://chialisp.com/chialisp-concepts/):包括柯里化(currying)、内部谜题(inner puzzles)和条件变换(morphing conditions)的概述。
- General [chialisp concepts](https://chialisp.com/chialisp-concepts/): overviews of currying, inner puzzles, and morphing conditions.
- 指导性的[Chialisp演练](https://docs.chia.net/guides/):安装、创建智能币和使用BLS签名的指南。
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ So let's get started, the first thing you'll want to do is make sure you have th
## 常见问题

- **run vs brun:** `run` 用于序列化并运行 Chialisp 谜题,而 `brun` 用于运行 clvm 序列化的谜题,通常用于传递参数。
- **括号(Parentheses):**Chialisp 是完全括号前缀表示法编程语言家族的一部分,可以[追溯](<https://en.wikipedia.org/wiki/Lisp_(programming_language)>)到上世纪 50 年代的 LISP 1。 这些语言的一个显而易见的特点是它们使用括号来表示列表(lists)。 建议在编写这些语言时使用具有适当语法高亮功能的集成开发环境,以确保所有括号都处于正确的位置。 为了帮助解决这个问题,这里有一个适用于 Visual Studio 的 [Chialisp 语言服务器扩展](https://marketplace.visualstudio.com/items?itemName=ChiaNetwork.chialisp)。
- **括号(Parentheses):**Chialisp 是完全括号前缀表示法编程语言家族的一部分,可以[追溯](https://en.wikipedia.org/wiki/Lisp_(programming_language))到上世纪 50 年代的 LISP 1。 这些语言的一个显而易见的特点是它们使用括号来表示列表(lists)。 建议在编写这些语言时使用具有适当语法高亮功能的集成开发环境,以确保所有括号都处于正确的位置。 为了帮助解决这个问题,这里有一个适用于 Visual Studio 的 [Chialisp 语言服务器扩展](https://marketplace.visualstudio.com/items?itemName=ChiaNetwork.chialisp)。
- **前缀表示法:**Chialisp 作为 LISP 家族的一部分,使用前缀表示法。 这意味着函数或运算符首先出现,其参数紧随其后。

---
Expand Down Expand Up @@ -180,7 +180,7 @@ So let's get started, the first thing you'll want to do is make sure you have th

### 可运行的Chialisp和clvm插件

有关如何使用这些插件的信息,请参阅[学院概述](/academy-overview#可运行的chialisp和clvm插件)
有关如何使用这些插件的信息,请参阅[学院概述](/academy-overview#runnable-chialisp-and-clvm-plugins)

#### Chialisp 插件

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ import Runnable from '@site/src/components/Runnable.tsx';

### 可运行的Chialisp和clvm插件

有关使用这些插件的信息,请参阅[学院概述](/academy-overview#可运行的chialisp和clvm插件)。
有关使用这些插件的信息,请参阅[学院概述](/academy-overview#runnable-chialisp-and-clvm-plugins)。

#### Chialisp 插件

Expand All @@ -168,7 +168,7 @@ import Runnable from '@site/src/components/Runnable.tsx';

### 链接

- [Chialisp基本概念](https://chialisp.com/chialisp-concepts/):包括柯里化(currying)、内部谜题(inner puzzles)和条件变换(morphing conditions)的概述。
- General [chialisp concepts](https://chialisp.com/chialisp-concepts/): overviews of currying, inner puzzles, and morphing conditions.
- 指导性的[Chialisp演练](https://docs.chia.net/guides/):安装、创建智能币和使用BLS签名的指南。
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ True

### 可运行的Chialisp和clvm插件

有关使用这些插件的信息,请参阅[学院概述](/academy-overview#可运行的chialisp和clvm插件)。
有关使用这些插件的信息,请参阅[学院概述](/academy-overview#runnable-chialisp-and-clvm-plugins)。

#### Chialisp 插件

Expand All @@ -221,7 +221,7 @@ True

### 链接

- [Chialisp基本概念](https://chialisp.com/chialisp-concepts/):包括柯里化(currying)、内部谜题(inner puzzles)和条件变换(morphing conditions)的概述。
- General [chialisp concepts](https://chialisp.com/chialisp-concepts/): overviews of currying, inner puzzles, and morphing conditions.
- 指导性的[Chialisp演练](https://docs.chia.net/guides/):安装、创建智能币和使用BLS签名的指南。
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ slug: /challenges-plot-filters

### 链接

- 更多的[耕种基础知识](https://docs.chia.net/reference-client/farming/farming-basics):绘图、矿池和奖励的概述。
- 详细的[架构概述](https://docs.chia.net/chia-blockchain/architecture/architecture-overview):描述农民、收割机、钱包等之间的交互。
- More [farming basics](https://docs.chia.net/reference-client/farming/farming-basics): overviews of plotting, pooling, and rewards.
- In depth [architecture overview](https://docs.chia.net/chia-blockchain/architecture/architecture-overview): describing the interactions between Farmers, Harvesters, Wallets, etc.
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ k32

### 链接

- 更多的[耕种基础知识](https://docs.chia.net/reference-client/farming/farming-basics):绘图、矿池和奖励的概述。
- 详细的[架构概述](https://docs.chia.net/chia-blockchain/architecture/architecture-overview):描述农民、收割机、钱包等之间的交互。
- More [farming basics](https://docs.chia.net/reference-client/farming/farming-basics): overviews of plotting, pooling, and rewards.
- In depth [architecture overview](https://docs.chia.net/chia-blockchain/architecture/architecture-overview): describing the interactions between Farmers, Harvesters, Wallets, etc.
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ slug: /first-plot

### 链接

- 更多的[耕种基础知识](https://docs.chia.net/reference-client/farming/farming-basics):绘图、矿池和奖励的概述。
- 详细的[架构概述](https://docs.chia.net/chia-blockchain/architecture/architecture-overview):描述农民、收割机、钱包等之间的交互。
- More [farming basics](https://docs.chia.net/reference-client/farming/farming-basics): overviews of plotting, pooling, and rewards.
- In depth [architecture overview](https://docs.chia.net/chia-blockchain/architecture/architecture-overview): describing the interactions between Farmers, Harvesters, Wallets, etc.
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ slug: /pools

### 链接

- 更多的[耕种基础知识](https://docs.chia.net/reference-client/farming/farming-basics):绘图、矿池和奖励的概述。
- 详细的[架构概述](https://docs.chia.net/chia-blockchain/architecture/architecture-overview):描述农民、收割机、钱包等之间的交互。
- More [farming basics](https://docs.chia.net/reference-client/farming/farming-basics): overviews of plotting, pooling, and rewards.
- In depth [architecture overview](https://docs.chia.net/chia-blockchain/architecture/architecture-overview): describing the interactions between Farmers, Harvesters, Wallets, etc.
- Chialisp[详细文档](https://chialisp.com/):提供有关Chialisp各个方面的详细信息。
- Support [in discord](https://discord.gg/chia): for further support join our discord server and ask in the #chialisp or #support channels.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: 架构概览
slug: /chia-blockchain/architecture/architecture-overview
---

![chia-architecture](/img/chia-network-architecture.png)

上图展示了 Chia 的网络架构。 一台机器可以运行其中一个以上的过程。 事实上,默认配置是同时运行四个过程:耕种、全节点、收割和钱包。 许多农民还会选择运行电子图形用户界面和矿池。 此外,少数农民,特别是拥有较多硬盘(PiB)农场的农民,会选择运行Timelord(时间领主)。

让我们逐个讨论这些进程,以及连接它们的协议。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: 耕种
slug: /chia-blockchain/architecture/farmers
---

Chia的农民与比特币矿工相似。 他们通过在其储存的地块中找到有效的空间证明来获得区块奖励和费用。 耕种进程并不会保留一个区块链的副本,而由他们信任的一个完整节点来提供更新。 完整节点和耕种进程使用耕种协议相互沟通。

耕种机通过收割协议与收割机交流(收割机是一台单独的机器,包括实际储存地块的耕种机在内)。

耕种机运行时要等待全节点的更新, 大约每9秒钟给他们新的标点(相当于抽签获奖号)。 然后,耕种机向每个收割机发送标点,以检查其是否赢得了空间证明。 如果收割机找到了有效证明,就会将其发给耕种机,证明分为两类:

- 完整证明必须符合或超过网络难度水平所要求的质量。 这些证明将发送到完整节点,然后创建一个新的区块。
- 部分证明是用于矿池来估算节点的总存储量。

耕种机也有一个私钥,这个私钥既用于当发现完整获胜证明时签署区块,也用于签署部分证明,这些证明随后被送到矿池。
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: 全节点
slug: /chia-blockchain/architecture/full-nodes
---

Chia点对点系统的核心由全节点组成。 全节点有以下几项责任:

1. 保留一个区块链的副本。
2. 验证区块链。
3. 使用点对点协议通过网络广播新区块、交易和验证。
4. (可选) 通过钱包协议提供轻量客户端(钱包)。
5. (可选) 与农民通信。
6. (可选) 与时间领主通信。

农民通常会在进行耕种进程的同时进行一个全节点进程。 全节点不赚取报酬或费用,但是它们对于保持共识规则和系统安全非常重要。 运行一个全节点可以让用户对区块链的完整状态有信心,并且避免信任他人。

全节点总是随机连接到网络中的其他全节点。 全节点定期向对等节点传送自己的信息(IP地址和端口)。 这样整个网络就知道它们仍在运行。 全节点还将所有新区块和交易广播给他们的对等节点, 这样网络中的所有节点共同保存了一个完整的区块链副本。
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: 收割机
slug: /chia-blockchain/architecture/harvesters
---

收割机是一些独立的机器,由农民控制。 在大规模耕作活动中,农民可能与许多收割机连接在一起。

收割机通过从磁盘检索质量或证明来控制实际的绘图文件。 最小容量的图(也是最常见的) 是 k32,大约相当于100 GiB。 每次递增一个k值,绘图大小大约加倍,所以一块k33地块大约为200 GiB,k34大约为400 GiB等。

每4608个区块,难度水平会自动调整,为每两个信标点选择一个空间证明——在整个网络空间上。 这是目标平均值——每个信标点也可以有零或多个证明。 这导致大约每24小时会进行难度调整。

在一个指定地块,收割机必须执行两项任务才能找到有效的证明:

1. 获取初始质量 — 这需要进行大约7次随机磁盘扫描,在慢速HDD上就是70毫秒。
2. (仅在初始质量足够高的情况下执行) 获取完整的证明——这需要大约64次磁盘扫描,在慢速HDD上就是 640 毫秒。

就大多数挑战而言,质量 ( 步骤1) 很低,所以没有必要获取全部证明(步骤2)。 一个节点有28秒的时间返回一个证明,所以磁盘I/O 不会是一个限制因素, 即使证明存储在慢速HDD上。

:::note
Tape drives are too slow for farming. The protocol was designed to support hard disks, but nothing slower. It is possible to use tape for long-term plot storage, only transferring the plots to disks for occasional farming, but this is likely a very rare use case.
:::

Finally, harvesters also maintain a private key for each plot. The blocks are signed with these keys, which is an important concept in Chia. It means that even when a farmer is a member of a pool, the farmer still controls the contents of a block. This is quite different from other blockchains' pooling protocols, where the pool operators are the ones signing the blocks.

:::info
The harvester algorithm is discussed in greater detail in the [Harvester Algorithm page](/chia-blockchain/consensus/chains/harvester-algorithm).
:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Light Clients
slug: /chia-blockchain/architecture/light-clients
---

Light client support is another benefit of Proof of Space and Time (PoST) when compared with Proof of Stake (PoS). In PoST, all proofs can be verified objectively and cryptographically, while maintaining the requirement to control an actual resource at a certain point in time. With Chia's consensus, a candidate chain can be compared to an alternate chain objectively for weight, even after being offline for a long time, without relying on a central authority.

For light clients that want to sync up quickly to the chain (for example, mobile wallets), a full node can create a small-sized proof that can convince the light client that the weight of a chain is close to some value. This is called a proof of weight.

Naively, the light client could download every single block and all the required proofs and verify them. But, with a large number of blocks, this would require a lot of bandwidth and CPU.

A more efficient method relies on a protocol similar to [Flyclient](https://eprint.iacr.org/2019/226.pdf). The node (Prover) sends all the sub-epoch summaries from the fork point, including difficulty resets, to the light client.

There is only one sub-epoch every 384 blocks, so the summaries will only reach a few MB of data.

The node also deterministically samples several sub-epochs based on the challenge of the last block. Sub-epochs have a chance to be chosen proportional to the difficulty during that sub-epoch. For the chosen sub-epoch, the light client downloads one of the challenge chain blocks (which are approximately 1/32 of all blocks), and computes the average infusion iterations of all challenge blocks in that sub-epoch. Based on this time, the light client can extrapolate how many blocks the reward chain contains.

For example, if the challenge blocks all occur with very small iterations (close to the beginning of the sub-slot), there are likely many blocks in that sub-slot. Conversely, if the iterations are close to the middle of the sub-slot, there is likely only one block per sub-slot. This allows the light client to only download 1/32 of the blocks in each sub-slot, but still get a good estimate of the total weight.

Furthermore, the last few sub-epochs should be downloaded in full for the light client.
This adds a small amount of data, but prevents attackers from creating small forks at the end of the chain.

The main difference between this protocol and Flyclient is that blocks are not committed to using a Merkle mountain range, but instead the light client downloads the entire list of sub-epoch hashes from genesis, guaranteeing that the queried sub-epochs are included in the chain. Another difference is that entire sections are downloaded, as opposed to individual blocks.

As of December 2021, more analysis needs to be done on how many sub-epochs should be downloaded and what the bounds are for what the proof of weight implies.

## Obtaining Transactions

Light clients can fetch the transactions that they are interested in, without having to download every single block or block header. Two wallet protocols are available for this, a less efficient one that maintains better privacy, and a super efficient one that has a privacy tradeoff, namely that the wallet must ask a node for payments made to certain addresses. Both of these protocols are currently supported in the Wallet API.
Loading