> For the complete documentation index, see [llms.txt](https://www.0x1.academy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.0x1.academy/dai-bi-jing-ji-xue/tong/hang/zao.md).

# 鑄造

### 「鑄造」這個詞來自實體貨幣——把金屬變成硬幣。在區塊鏈世界，鑄造是把數位資產「生」出來的過程。無論是代幣還是 NFT，都需要經過鑄造才能存在。

***

## 什麼是鑄造？

| 概念 | 說明             |
| -- | -------------- |
| 英文 | Mint / Minting |
| 定義 | 在區塊鏈上創建新資產     |
| 對象 | 代幣、NFT         |
| 結果 | 資產被記錄在鏈上       |

***

## 鑄造的類型

### 代幣鑄造

```
代幣鑄造的方式：

1. 創世鑄造
   - 項目啟動時一次性鑄造
   - 例：ERC-20 代幣部署時

2. 挖礦鑄造
   - 透過挖礦產生新幣
   - 例：比特幣的區塊獎勵

3. 質押鑄造
   - 透過質押獲得新幣
   - 例：PoS 網路的驗證獎勵

4. 動態鑄造
   - 根據需求鑄造
   - 例：穩定幣的增發
```

### NFT 鑄造

| 步驟     | 說明          |
| ------ | ----------- |
| 上傳內容   | 圖片、影片等      |
| 設定屬性   | 名稱、描述、稀有度   |
| 支付 Gas | 支付鑄造費用      |
| 上鏈     | NFT 被記錄在區塊鏈 |

{% hint style="info" %}
**鑄造 ≠ 上傳**

鑄造不只是上傳檔案，而是在區塊鏈上創建一個獨特的代幣，記錄你的所有權。這個過程需要支付 Gas 費，且不可逆。
{% endhint %}

***

## 技術原理

### ERC-20 代幣鑄造

```solidity
// 簡化的代幣鑄造函數
function mint(address to, uint256 amount) public onlyOwner {
    _totalSupply += amount;
    _balances[to] += amount;
    emit Transfer(address(0), to, amount);
}

// address(0) 表示「從無到有」
// 新代幣憑空產生，發送給指定地址
```

### ERC-721 NFT 鑄造

```solidity
// 簡化的 NFT 鑄造函數
function mint(address to, uint256 tokenId) public {
    _owners[tokenId] = to;
    _balances[to] += 1;
    emit Transfer(address(0), to, tokenId);
}

// 每個 tokenId 都是獨一無二的
```

***

## NFT 鑄造方式

### 常見模式

| 模式    | 說明               |
| ----- | ---------------- |
| 公開鑄造  | 任何人都可以鑄造         |
| 白名單鑄造 | 只有白名單可以          |
| 荷蘭拍賣  | 價格遞減拍賣           |
| 自由鑄造  | Free Mint        |
| 懶惰鑄造  | Lazy Mint，購買時才鑄造 |

### 鑄造成本

```
NFT 鑄造成本構成：

以太坊：
- Gas 費：視網路擁堵而定
- 可能從幾美元到幾百美元
- 高峰期曾超過 $500

其他鏈：
- Polygon：接近 0
- Solana：約 $0.01
- 各鏈成本差異大

考量：
- Gas 費波動大
- 選擇低擁堵時段
- 或選擇 L2 / 其他鏈
```

***

## 鑄造與經濟

### 通膨與通縮

| 機制 | 說明        |
| -- | --------- |
| 鑄造 | 增加供應量（通膨） |
| 銷毀 | 減少供應量（通縮） |
| 平衡 | 健康的代幣經濟   |

### 鑄造權限

| 模式   | 說明       |
| ---- | -------- |
| 中心化  | 項目方控制鑄造  |
| 去中心化 | 協議或演算法控制 |
| 混合   | 治理投票決定   |

{% hint style="warning" %}
**無限鑄造風險**

如果代幣可以無限鑄造，價值就會稀釋。檢查代幣是否有總量上限，以及誰有權鑄造新幣。
{% endhint %}

***

## 鑄造平台

### NFT 鑄造平台

| 平台         | 特色        |
| ---------- | --------- |
| OpenSea    | 最大，支援多鏈   |
| Rarible    | 去中心化      |
| Foundation | 藝術導向      |
| Magic Eden | Solana 主流 |

### 代幣鑄造

| 方式    | 適合對象  |
| ----- | ----- |
| 無代碼平台 | 非技術人員 |
| 智能合約  | 開發者   |
| 代幣工廠  | 快速部署  |

***

## 延伸閱讀

* [銷毀](/dai-bi-jing-ji-xue/tong/hang/undefined-1.md) — 代幣銷毀
* [總流通量](/dai-bi-jing-ji-xue/tong/hang/liu-tong-liang.md) — 供應量概念
* [代幣發行](/dai-bi-jing-ji-xue/tong/hang.md) — 發行方式

***

#### 參考資料

* ERC-20 標準
* ERC-721 標準


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/dai-bi-jing-ji-xue/tong/hang/zao.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.
