> For the complete documentation index, see [llms.txt](https://docs.blockchainsecurity.asia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockchainsecurity.asia/documentation/investigation/bitcoin.md).

# Bitcoin 找零地址偵測

偵測一筆 Bitcoin 交易中的找零地址，協助判斷哪些輸出可能為付款方找零、哪些輸出可能為收款方地址，進一步推定該筆交易的資金流向。成功回應扣除 5 credits，結果以 { data, meta } 信封回傳。

## 找零地址偵測

```bash
curl -X POST "https://api.blockchainsecurity.asia/v1/btc/change-address" \
  -H "X-API-Key: ak_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "txid": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16"
  }'
```

請求 body：

| 欄位     | 必填 | 說明                  |
| ------ | -- | ------------------- |
| `txid` | 是  | Bitcoin 交易 ID（txid） |

```json
{
  "data": {
    "txid": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
    "change_address": "12cbQLTHMqcyjg2b7ZdvD8gnF5jPbE2yz",
    "change_index": 1,
    "confidence": 0.82,
    "reasons": ["address_reuse", "round_number_payment"]
  },
  "meta": { "request_id": "..." }
}
```

| 欄位               | 說明                                                                                      |
| ---------------- | --------------------------------------------------------------------------------------- |
| `change_address` | 推定為找零的輸出地址；無法判斷時可能為 `null`                                                              |
| `change_index`   | 找零輸出在交易 outputs 中的索引                                                                    |
| `confidence`     | 判定信心分數，範圍 0–1                                                                           |
| `reasons`        | 判定依據，例如 `address_reuse`、`script_type_match`、`round_number_payment`、`new_output_address` |

> 找零偵測屬啟發式判定，confidence 代表本次推定的可信度；當交易結構過於複雜或證據不足時，change\_address 可能回傳 null。

## 端點與計費

| Method | 路徑                       | 說明             | Credit |
| ------ | ------------------------ | -------------- | ------ |
| `POST` | `/v1/btc/change-address` | Bitcoin 找零地址偵測 | 5      |
