# 关于RBF和CPFP

### <mark style="color:orange;">关于RBF</mark> <a href="#id-0" id="id-0"></a>

RBF, 全称为**Replace-by-fee**, 即未确认的transaction, 可以用新的transaction(并给予新tx更高的gas) 来替代掉，它是一种允许交易发送者在交易尚未被 确认时提高交易费用的机制。如果用户发 送了一笔比特币交易，但由于低交易费用 而长时间未被确认，他们可以使用RBF选 项增加交易费用，以提高交易的优先级。 这样可以促使矿工更快地包含交易在区块中，从而加快交易确认速度。

#### RBF 交易类型的区别 <a href="#id-1" id="id-1"></a>

Replace-By-Fee 交易有 3 种不同类型，First-Seen-Safe(FSS) RBF、Full RBF 和 Opt-in RBF。

FSS RBF 要求 RBF 交易包含与其替换的交易相同的输出并消耗相同的输入；

Full RBF 意味着该交易只是另一笔交易的双重支出，但支付的交易费用比它所取代的交易更高；

Opt in RBF 意味着 RBF 交易只能替换已选择加入允许自身被替换的交易。

[<mark style="color:blue;">**参考文章**</mark>](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki)

### <mark style="color:orange;">关于CPFP</mark> <a href="#id-2" id="id-2"></a>

CPFP，全称为Child-Pays-For-Parent。它是一种机制，允许在一个未确认的 交易的情况下通过提高与其相关的子交易 的手续费来加速整个交易集合。如果用户 发送了一笔交易，并该交易的子交易 （通常是找零交易）的手续费不足，用户 可以通过提高子交易的手续费来推动整个 交易集合更快地被矿工确认。


---

# 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://help.tokenpocket.pro/cn/faq/btcwallet/rbf-cpfp.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.
