# sBTC 交易操作指南

让我们跟随 1 BTC 在 sBTC 系统中的旅程，从最初存入到最终提取。

## 第 1 部分：存入（BTC → sBTC）

{% stepper %}
{% step %}
**发起**

* Alice 决定将 1 BTC 转换为 sBTC，以参与 Stacks DeFi。
* Alice 在比特币网络上创建一笔存款交易（通常通过 sBTC 桥或 DeFi 应用等 UI 完成）。
* 该交易进入比特币内存池。
  {% endstep %}

{% step %}
**提交证明**

* Alice 将她的存款证明提交给存款 API（通常通过应用的 UI）。
* 存款 API 将存款状态设为 PENDING。
  {% endstep %}

{% step %}
**签名者验证**

sBTC 签名者组：

* 检测到该存款。
* 验证 UTXO 格式。
* 对该存款进行投票。

如果存款被拒绝：

* 签名者将拒绝结果通知 API。
* 存款 API 将状态更新为 FAILED。

如果存款被接受：

* 存款 API 将状态更新为 ACCEPTED。
  {% endstep %}

{% step %}
**比特币交易**

如果被接受，sBTC 签名者组：

* 创建一笔新的比特币交易，消耗 Alice 存入的 BTC。
* 将该交易广播到比特币网络。

如果该交易失败：

* 签名者将失败结果通知 API。
* 存款 API 将状态更新为 FAILED。
  {% endstep %}

{% step %}
**sBTC 铸造**

在比特币交易成功后：

* sBTC 签名者组与 Stacks 区块链交互。
* 他们通过向 Alice 的 Stacks 地址铸造 1 sBTC 来完成该存款。
  {% endstep %}

{% step %}
**确认**

* 存款 API 将存款状态更新为 CONFIRMED。
* Alice 现在在她的 Stacks 钱包中拥有 1 sBTC。
  {% endstep %}
  {% endstepper %}

***

## 第 2 部分：sBTC 使用

Alice 现在可以在 Stacks 生态系统中使用她的 1 sBTC：

* 通过 `sbtc-token` 合约将其转给其他用户（通常通过应用 UI）。
* 参与 DeFi 应用。
* 在任何支持 SIP-010 代币的应用中使用它。

***

## 第 3 部分：提取（sBTC → BTC）

{% stepper %}
{% step %}
**发起**

* Alice 通过与 Stacks 区块链上的 Clarity 合约交互来发起提取。
* 她为提取指定自己的比特币地址。
* 如果成功，合约会锁定她的 sBTC，提取状态设为 PENDING。
* 如果交易失败，则不会发生提取。
  {% endstep %}

{% step %}
**签名者验证**

sBTC 签名者组：

* 检测到提取请求。
* 决定接受还是拒绝该提取。

如果提取被拒绝：

* 签名者解锁 sBTC。
* 提取状态更新为 FAILED。

如果提取被接受：

* 提取状态更新为 ACCEPTED。
* 签名者等待 6 个比特币区块确认（出于安全考虑）。
  {% endstep %}

{% step %}
**比特币交易**

等待期结束后，如果被接受：

* sBTC 签名者组创建一笔新的比特币交易，完成 Alice 的提取。
* 他们将该交易广播到比特币网络。

如果该交易失败：

* 签名者解锁 sBTC。
* 提取状态更新为 FAILED。
  {% endstep %}

{% step %}
**sBTC 销毁与确认**

在比特币交易成功后：

* sBTC 签名者组在 Stacks 区块链上销毁被锁定的 1 sBTC。
* 提取状态更新为 CONFIRMED。
  {% endstep %}

{% step %}
**完成**

* Alice 现在在她指定的比特币地址中收回了 1 BTC。
* 已提取的 sBTC 已被永久移出流通。
  {% endstep %}
  {% endstepper %}


---

# 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/sbtc/walkthroughs/sbtc-transaction-walkthrough.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.
