OneKeyHQ / OneKeyHQ/app-monorepo

Bitcoin signing UI mislabels protocol outputs as “network fee” / “OP_RETURN amount” for Taproot + OP_RETURN transactions

Open
#9,757 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
535
Avg merge
21h 55m
Merged PRs (30d)
497

Description

### Description

I encountered a confusing and potentially misleading UI issue when signing a Bitcoin transaction that includes **Taproot (P2TR) outputs and an OP_RETURN output**.

In the signing screen of the OneKey device/app, the UI displays:

* an **“estimated network fee” with a large fixed BTC amount**, or
* after a firmware update, an **“OP_RETURN amount” with a non-zero BTC value**

However, based on Bitcoin transaction rules and independent verification, this displayed amount **does not correspond to the actual miner fee nor to the OP_RETURN output value**.

---

### Expected behavior

* The **network fee** shown on the signing screen should reflect the actual miner fee
(i.e. `sum(inputs) − sum(outputs)`), typically a small amount in sats.
* **OP_RETURN outputs should always display value = 0 BTC**, as required by Bitcoin consensus.
* If the UI cannot fully represent multiple outputs or protocol-specific Taproot scripts, it should:

* either clearly label the value as *non-fee / protocol-related*, or
* avoid presenting it as a fee or OP_RETURN amount.

---

### Actual behavior

* The signing UI shows a **large BTC amount** labeled as:

* “estimated network fee”, or
* “OP_RETURN amount”
* This amount does **not match the real miner fee**, which is much smaller.
* The OP_RETURN output on-chain has **0 BTC value**, yet the UI shows a non-zero amount.
* This can reasonably lead users to believe they are paying an abnormally high fee or burning BTC.

---

### Why this is problematic

* For advanced Bitcoin transactions (Taproot, protocol registration, OP_RETURN metadata),
**mislabeling outputs as fees introduces unnecessary fear and confusion**.
* Hardware wallets are trusted specifically for **accurate transaction review before signing**.
* Even if the transaction itself is correct, the UI presentation violates the
*“don’t confuse, don’t mislead”* principle.

---

### Suggested improvements

* Clearly distinguish between:

* miner fee
* protocol-related outputs
* OP_RETURN metadata (always 0 BTC)
* If multiple outputs cannot be fully displayed, add an explicit warning such as:

> “This transaction contains protocol-specific outputs. Displayed amounts are not miner fees.”
* Avoid showing any non-fee amount under labels like **“network fee”** or **“OP_RETURN value”**.

---

### Notes

* This issue is reproducible with **Taproot-based protocol transactions** that include OP_RETURN data.
* The underlying Bitcoin transaction is valid and correct; the issue appears to be **UI parsing / labeling**, not transaction construction.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the signing screen with a Taproot transaction containing an OP_RETURN output, then trace the UI parsing and labeling for the displayed amount. Done means the miner fee reflects sum(inputs) − sum(outputs), OP_RETURN displays 0 BTC, and any protocol-specific value is clearly distinguished from a fee.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
blockchain, frontend, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.