# 主网与测试网

<div data-with-frame="true"><figure><img src="/files/d0163d350261ef5993864c8e83869f3cc5706c46" alt=""><figcaption></figcaption></figure></div>

Stacks 同时拥有主网和测试网，用于不同目的。主网和测试网是两个完全不同的公共网络，代币不能在二者之间相互转移。

### 主网和测试网技术规格

<table><thead><tr><th width="215.19140625"></th><th width="244.26953125">主网</th><th>测试网</th></tr></thead><tbody><tr><td>链 ID</td><td><code>1</code></td><td><code>2147483648</code></td></tr><tr><td>交易版本</td><td><code>0</code></td><td><code>128</code></td></tr><tr><td>魔数</td><td><code>X2</code></td><td><code>T2</code></td></tr><tr><td>浏览器</td><td><a href="https://explorer.hiro.so/">https://explorer.hiro.so/</a></td><td><a href="https://explorer.hiro.so/?chain=testnet">https://explorer.hiro.so/?chain=testnet</a></td></tr><tr><td>Stacks API 基础 URL</td><td><a href="https://api.hiro.so">https://api.hiro.so</a></td><td><a href="https://api.hiro.so">https://api.testnet.hiro.so</a></td></tr><tr><td>地址格式 / 版本</td><td><strong>SP</strong>3B108...2DNJA0 / <code>22</code></td><td><strong>ST</strong>3B108P...EQEZY5 / <code>26</code></td></tr><tr><td>多签格式 / 版本</td><td><strong>SM</strong>3RWH...5X9DXM / <code>20</code></td><td><strong>SN</strong>8NKFP...2NAQJA / <code>21</code></td></tr><tr><td>创世区块</td><td><a href="https://explorer.hiro.so/block/0x6b2c809627f2fd19991d8eb6ae034cb4cce1e1fc714aa77351506b5af1f8248e?chain=mainnet">区块 #1</a></td><td><a href="https://explorer.hiro.so/block/0xc9938007fe5f8cc312d782349a6cfbaee7598e08acc4f4da31c876a4b16d4153?chain=testnet">区块 #1</a></td></tr><tr><td>sBTC 合约</td><td><a href="https://explorer.hiro.so/token/SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token?chain=mainnet">SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token</a></td><td><a href="https://explorer.hiro.so/txid/ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token?chain=testnet">ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token</a></td></tr></tbody></table>

### 主网

Stacks 主网直接锚定到比特币主网，其网络中的代币具有实际货币价值。这是生产网络，应当按生产环境来对待。

### 测试网

Stacks 测试网是开发者的一个实时公共沙盒，允许他们在一个模拟主网的环境中构建、测试和迭代应用程序与智能合约。它提供了一个无风险的空间，让你在部署到 Stacks 主网之前试验变更或新功能，确保一切都能正常运行而不会有真实的财务损失风险。

#### 测试网水龙头

测试网水龙头会向你提供用于测试的模拟 Stacks（STX）代币。这些测试网 STX 没有价值，也不同于主网上的 STX。获取测试网 STX 有几种不同的方式。

{% tabs %}
{% tab title="平台" %}
你可以从 [平台](https://platform.hiro.so/faucet)获取测试网 STX，这是推荐方式。

要从 Platform 中获取 STX 代币，请导航到顶部的“Faucet”标签页。然后你可以选择测试网 STX 或 sBTC，并粘贴你希望接收的测试网 STX 地址。

<div data-with-frame="true"><figure><img src="/files/f6131a89134325707215b84e930fce07daada5e7" alt=""><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="沙盒" %}
使用 [Explorer Sandbox](https://explorer.hiro.so/sandbox/deploy?chain=testnet) 提供的水龙头是另一种选择。

你首先需要将钱包连接到 Explorer Sandbox，然后点击“Request STX”。在请求之前，请确保你的钱包处于测试网网络。

<div data-with-frame="true"><figure><img src="/files/e4388a76948e06f2919aadb5149f4ebcf06c81c7" alt=""><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="LearnWeb3" %}
或者，你也可以使用 [LearnWeb3 水龙头](https://learnweb3.io/faucets).

<div data-with-frame="true"><figure><img src="/files/b241485f4ab655045fd6306706ed49a5d6aac304" alt=""><figcaption></figcaption></figure></div>
{% endtab %}
{% endtabs %}


---

# 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://docs.stacks.co/learn/zh/network-fundamentals/mainnet-and-testnets.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.
