question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SegWit inputs in PSBT must provide full UTXO

See original GitHub issue

A security issue* in the design of BIP-143 allows an attacker to lie about segwit input amounts and get the user to pay an unexpectedly high transaction fee. The problem affects all HWW vendors.

For Trezor, we are fixing this by requiring the full UTXO for all types of inputs, so we can validate that the input amount is correct.

To facilitate that, we need BTCPay to provide full UTXOs for all input types. This goes against the recommendation in BIP-174, saying that NON_WITNESS_UTXO should not be provided for SegWit inputs. Nevertheless, the resulting PSBT is still valid AFAICT.

Without this modification, it will be impossible to sign SegWit transactions on Trezor firmwares starting with 1.9.1 and 2.3.1. Also, an issue in HWI must be fixed first: https://github.com/bitcoin-core/HWI/issues/338

*) Details in our blogpost: https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:23 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
NicolasDoriercommented, Jun 4, 2020

@AvivMilner that said, I don’t know Ledger stance on it. I don’t think they will fix it as it breaks lot’s of thing, but I may be wrong.

This is a difficult decision for hardware wallets. I personally think that the pill is worse than the disease.

2reactions
Kukkscommented, Jun 4, 2020

But when Wasabi in btcpay? Keep everything in one place.

Thank you for your answers.

An issue for another day that I’m already looking into.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BIP 0174 - Bitcoin Wiki
The Signer must only accept a PSBT. The Signer must only use the UTXOs provided in the PSBT to produce signatures for inputs....
Read more >
Partially Signed Bitcoin Transactions
The first step for every transaction that is constructed using a PSBT flow is to select inputs (UTXOs) to fund the desired output...
Read more >
Hardware Wallet Vulnerability Fix - Verifying Input Value
I thought the value was already required to sign a raw segwit transaction... Since the change to segwit the full value of the...
Read more >
UTXO Consolidation (3 inputs, 1 output) - Legacy P2PKH
Let's do UTXO consolidation, also called an aggregating transaction. ... P2PKH UTXOs (referencing each of them with three inputs) to one Segwit P2WPKH...
Read more >
psbt
This requires provision of a full transaction (which is the source of the corresponding prevOut), and the input index. If addition of this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found