> For the complete documentation index, see [llms.txt](https://www.ordinalscn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.ordinalscn.org/xu-shu-li-lun-shou-ce/qi-zhi-yin/7.2-ming-wen.md).

# 7.2铭文

单个 `聪` 可以刻有任意内容，创建可以保存在比特币钱包中并使用比特币交易传输的比特币原生数字人工制品。 铭文与比特币本身一样持久、不变、安全和去中心化。 使用铭文需要一个比特币完整节点，让您了解比特币区块链的当前状态，以及一个可以创建铭文并在构建交易以将铭文发送到另一个钱包时执行 `聪` 控制的钱包。 Bitcoin Core 提供比特币全节点和钱包。 但是，Bitcoin Core 钱包不能创建铭文，不执行 `聪` 控制。 这需要 ord，序数实用程序。 ord 不实现自己的钱包，因此 `ord wallet` 子命令与 Bitcoin Core 钱包交互。

本指南涵盖：

1. 安装 Bitcoin Core
2. 同步比特币区块链
3. 创建 Bitcoin Core 钱包
4. 使用 `ord wallet receive` 命令收取比特币
5. 使用 `ord wallet inscribe 创建铭文`
6. 使用 `ord wallet send 发送铭文`
7. 使用 `ord wallet receive 收取铭文`

### 寻求帮助 <a href="#getting-help" id="getting-help"></a>

如果你遇到困难，可以尝试在 [Ordinals Discord Server](https://discord.com/invite/87cjuz4FYg)寻求帮助, 或者检查 GitHub 上相关的问题和讨论 [issues](https://github.com/casey/ord/issues) and [discussions](https://github.com/casey/ord/discussions).

### 安装Bitcoin Core

可以在 [bitcoincore.org](https://bitcoincore.org/) 中的下载页面 [download page](https://bitcoincore.org/en/download/)下载；

制作铭文需要Bitcoin Core 24 或者更新版本

本指南不包括如何详细安装 Bitcoin Core；当你成功安装Bitcoin Core以后，你应该可以在命令行使用 `bitcoind -version` 命令

### 配置Bitcoin Core <a href="#installing-bitcoin-core" id="installing-bitcoin-core"></a>

`ord` 需要 Bitcoin Core's 交易索引；

配置你的Bitcoin Core阶段去维护一个交易索引，需要在`bitcoin.conf里面添加`:

```
txindex=1
```

或者, 运行命令 :

```
bitcoind -txindex
```

### 比特币区块同步 <a href="#syncing-the-bitcoin-blockchain" id="syncing-the-bitcoin-blockchain"></a>

区块同步运行

```
bitcoind -txindex
```

…直到运行 `getblockcount`:

```
bitcoin-cli getblockcount
```

同意像[the mempool.space block explorer](https://mempool.space/) 一样的对区块计数， `ord` 同 `bitcoind`交互，所以在当你在运行`ord`的时候，需要让 `bitcoind` 在后台运行。

### 安装`ord`

&#x20;`ord` 程序使用 Rust 写成并可以从源码安装 [source](https://github.com/casey/ord). 预建软件可以在 [releases page](https://github.com/casey/ord/releases)  下载，你可以使用命令行安装最新的预建软件；

```sh
curl --proto '=https' --tlsv1.2 -fsLS https://ordinals.com/install.sh | bash -s
```

当 `ord` 安装成功的时候,你可以使用命令

```
ord --version
```

会显示`ord` 的版本信息

### 创建一个Bitcoin Core钱包

`ord` 使用Bitcoin Core管理私钥，签署交易，向比特币网络广播交易

使用`ord`创建一个以 `ord` 为名字的钱包，运行:

```
ord wallet create
```

### 接收聪 <a href="#receiving-sats" id="receiving-sats"></a>

铭文是在单个聪上制作的，使用聪来支付费用的普通比特币交易，因此你的钱包将需要一些 聪（比特币）。

创建一个新地址，运行

```
ord wallet receive
```

向上面地址转帐后，你可以使用以下命令看到交易情况

```
ord wallet transactions
```

一旦交易确认，你应该可以使用 `ord wallet outputs`.看到交易的输出；

### 创建铭文内容

聪上可以刻录任何类型的内容，但ord钱包只支持ord区块浏览器可以显示的内容类型。&#x20;

另外，铭文是包含在交易中的，所以内容越大，铭文交易需要支付的费用就越高。&#x20;

铭文内容包含在交易见证中，获得见证折扣。&#x20;

要计算写入交易将支付的大概费用，请将内容大小除以四，然后乘以费率。 铭文交易必须少于 400,000 个权重计量单位，否则不会被 Bitcoin Core 中继。&#x20;

一个字节的铭文内容需要一个权重计量单位。 由于铭文交易不只是铭文内容，铭文内容限制在400,000权重计量单位以内。 390,000 个权重计量单位应该是安全的。

### 创建铭文 <a href="#creating-inscriptions" id="creating-inscriptions"></a>

`以FILE` 的内容创建一个铭文，需要运行

```
ord wallet inscribe --fee-rate FEE_RATE FILE
```

Ord会输出两个交易ID，一个是`commit`交易，一个是`reveal`交易，还有铭文ID。 铭文 ID 的格式为 `TXIDiN`，其中 `TXID` 是揭示交易的交易 ID，`N` 是揭示交易中铭文的索引。&#x20;

`commit`交易提交到包含铭文内容的 tapscript，`reveal`交易则从该 tapscript 中花费，显示链上的内容并将它们铭刻在`reveal`交易的第一个输出的第一个 sat 上。

在等待`reveal` 交易被矿工挖取的同时，你可以使用 [the mempool.space block explorer](https://mempool.space/).来查询交易状态。

一旦`reveal` 交易被确认后，铭文ID可以使用一下命令输出

```
ord wallet inscriptions
```

或者以`ordinals.com/inscription/INSCRIPTION_ID`的格式访问铭文浏览器 [the ordinals explorer](https://ordinals.com/)

### 发送铭文 <a href="#sending-inscriptions" id="sending-inscriptions"></a>

铭文接收方使用一下命令生成地址

```
ord wallet receive
```

使用命令格式发送铭文：

```
ord wallet send --fee-rate <FEE_RATE> <ADDRESS> <INSCRIPTION_ID>
```

检查交易情况：

```
ord wallet transactions
```

接收方可以使用一下命令查看接收到的铭文

```
ord wallet inscriptions
```

### 接收铭文 <a href="#receiving-inscriptions" id="receiving-inscriptions"></a>

使用一下命令生成钱包地址

```
ord wallet receive
```

发送方使用一下命令发送铭文

```
ord wallet send ADDRESS INSCRIPTION_ID
```

检查交易情况

```
ord wallet transactions
```

使用以下命令检查接收到的铭文

```
ord wallet inscriptions
```
