# 區塊高度

### 區塊高度（Block Height）是區塊在區塊鏈上的序號。創世區塊的高度是 0，之後每產生一個新區塊，高度就加 1。它就像書的頁碼，讓你知道這個區塊是整條鏈上的第幾個。

***

## 區塊高度的概念

```
創世區塊 → 區塊 1 → 區塊 2 → 區塊 3 → ... → 最新區塊
   ↓          ↓        ↓        ↓              ↓
高度 0     高度 1   高度 2   高度 3      高度 N
```

{% hint style="info" %}
**從 0 開始**

和程式設計師一樣，區塊鏈的高度是從 0 開始計算的。比特幣的創世區塊高度是 0，不是 1。
{% endhint %}

***

## 區塊高度的用途

| 用途   | 說明                   |
| ---- | -------------------- |
| 定位區塊 | 「高度 700,000」就能找到特定區塊 |
| 計算進度 | 知道同步到哪裡了             |
| 計時器  | 許多事件以區塊高度為準          |
| 追蹤交易 | 確認交易在哪個區塊            |

***

## 區塊高度 vs 區塊哈希

| 比較  | 區塊高度      | 區塊哈希                    |
| --- | --------- | ----------------------- |
| 格式  | 簡單數字      | 64 位十六進制                |
| 唯一性 | 可能重複（分叉時） | 絕對唯一                    |
| 易讀性 | 人類友好      | 機器友好                    |
| 例子  | 800,000   | 00000000000000000002... |

{% hint style="warning" %}
**高度不保證唯一**

當區塊鏈發生分叉時，可能有兩個不同的區塊擁有相同的高度。但它們的哈希值一定不同。要準確定位區塊，用哈希值更可靠。
{% endhint %}

***

## 著名的區塊高度

### 比特幣

| 高度      | 事件             |
| ------- | -------------- |
| 0       | 創世區塊（2009/1/3） |
| 210,000 | 第一次減半（2012）    |
| 420,000 | 第二次減半（2016）    |
| 630,000 | 第三次減半（2020）    |
| 840,000 | 第四次減半（2024）    |

### 以太坊

| 高度         | 事件               |
| ---------- | ---------------- |
| 0          | 創世區塊（2015/7/30）  |
| 4,370,000  | 拜占庭硬分叉           |
| 12,965,000 | 倫敦升級（EIP-1559）   |
| 15,537,394 | The Merge（轉 PoS） |

***

## 區塊高度與時間的關係

| 區塊鏈    | 平均出塊時間 | 一天約產生       |
| ------ | ------ | ----------- |
| 比特幣    | 10 分鐘  | 144 個區塊     |
| 以太坊    | 12 秒   | 7,200 個區塊   |
| Solana | 0.4 秒  | 216,000 個區塊 |

{% hint style="success" %}
**用區塊高度當計時器**

比特幣減半是「每 210,000 個區塊」發生一次，而不是「每 4 年」。雖然大約是 4 年，但實際時間取決於出塊速度。
{% endhint %}

***

## 如何查詢區塊高度

| 區塊鏈 | 區塊瀏覽器                        |
| --- | ---------------------------- |
| 比特幣 | blockchain.com、mempool.space |
| 以太坊 | etherscan.io                 |
| 幣安鏈 | bscscan.com                  |

在區塊瀏覽器輸入區塊高度，就能看到該區塊的所有資訊：時間、交易數、礦工、獎勵等。

***

## 延伸閱讀

* [打包](/qu-kuai-lian-ru-he-da-cheng-gong-shi/wa/da-bao.md) — 新區塊如何產生
* [哈希值](/qu-kuai-lian-ru-he-da-cheng-gong-shi/wa/ha-xi-zhi.md) — 區塊的另一種識別方式
* [創世區塊](https://github.com/dAAAb/Blockpedia/blob/master/blockchain-intro/genesis-block.md) — 高度 0 的區塊
* [減半](https://github.com/dAAAb/Blockpedia/blob/master/token/btc/jian-ban.md) — 以區塊高度為準的事件

***

#### 參考資料

* [Bitcoin Block Explorer](https://www.blockchain.com/explorer)
* [Ethereum Block Explorer](https://etherscan.io/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.0x1.academy/qu-kuai-lian-ru-he-da-cheng-gong-shi/wa/gao-du.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
