• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

What can a read-only PSBT inspector trust when it prints the fee from witnessUtxo?

Moussa by Moussa
November 16, 2026
in Bitcoin
0
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I am adding a read-only sign command to an open-source, signet/testnet-only self-custody toolkit (btcguardianshq). This step only decodes a base64 PSBT and prints inputs, outputs and the fee. It does not load keys and it does not sign. Signing is planned as a later step.

Related articles

Under BIP-361 Phase B, would ECDSA checks inside script (as in QSB/PQSB) still be valid?

December 6, 2026

Trump Media’s $200M bitcoin loan: title transfer, no margin call

December 6, 2026

The inspector currently:

  • refuses --network mainnet / bitcoin
  • requires the file to start with cHNidP8
  • requires every input to have witnessUtxo and takes the amount from there
  • computes fee = sum(inputs) - sum(outputs), rejects a negative fee, and warns if the fee is over 50,000 sats

The amount check looks like this (from vault/psbt-sign.js on main):

if (!inp.witnessUtxo) throw new Error(`Input ${i} has no witnessUtxo; cannot check amount.`);
const v = BigInt(inp.witnessUtxo.value);
inTotal += v;
// ...
const fee = inTotal - outTotal;
if (fee < 0n) throw new Error('Outputs exceed inputs: invalid PSBT.');
if (fee > 50000n) console.log('WARNING: fee is over 50,000 sats. Check carefully.');

Two things I am unsure about before I grow this into an actual signer.

1. The displayed fee can be a lie, and nothing is being signed yet.

witnessUtxo.value is just data the creator put in the PSBT. For a hardware signer, BIP143 commits to the amount, so a faked value makes that signature invalid (with the known multi-input caveat where a host can collect valid signatures across two signing attempts). A read-only inspector never signs, so that defence does not apply. If someone later signs what they just saw, they may have approved a fee that only existed in the PSBT fields.

Should a read-only inspector require nonWitnessUtxo (the full previous transaction) even for segwit inputs, hash it, and check that the txid matches the input outpoint before it prints a fee? If only witnessUtxo is present, should it refuse to print a fee and warn instead? I also currently reject a perfectly valid legacy input that only has nonWitnessUtxo and no witnessUtxo, which feels wrong.

2. A PSBT has no network field.

The tool is meant to stay on signet/testnet and uses bitcoin.networks.testnet for both, because signet and testnet share tb1 addresses. Refusing the --network mainnet flag is easy, but that does not stop someone passing a mainnet-crafted PSBT while the flag is still signet. The scripts themselves do not carry a network, so a mainnet P2WPKH input would be shown as a tb1 address.

What, if anything, can an inspector reliably use to refuse a mainnet PSBT? I realise signet and testnet cannot be told apart from addresses alone (Why doesn’t signet use a unique bech32 prefix?). Global xpubs (xpub vs tpub) are only present sometimes. Is "trust the user-supplied network, show addresses for that network, and say so clearly" the honest limit here?

I have read the threads on PSBT signing safety checks, the fee-overpayment issue for hardware signers (here and here), and Testnet vs Mainnet PSBTs. Those are mostly about what a signer should verify, or whether test vectors transfer across networks. I am asking what a viewer that does not sign yet should refuse to display, or should display only with a warning.

A later check I also want to add is verifying a change output by re-deriving it from bip32Derivation (and a known xpub) rather than trusting the address string. I will treat that as a follow-up unless it belongs in the same "minimum inspector checks" list.



Source link

Share76Tweet47

Related Posts

Under BIP-361 Phase B, would ECDSA checks inside script (as in QSB/PQSB) still be valid?

by Moussa
December 6, 2026
0

BIP-361 (draft) proposes that after Phase B, spends relying on legacy ECDSA/Schnorr signatures become invalid, with a rescue path still...

Trump Media’s $200M bitcoin loan: title transfer, no margin call

by Moussa
December 6, 2026
0

Trump Media & Technology Group (DJT) took out a $200 million bitcoin-backed loan from Blockchain.com on November 30 on terms...

Robert Kiyosaki Says He’s 100% Out Of Crypto Over AI Fears

Robert Kiyosaki Says He’s 100% Out Of Crypto Over AI Fears

by Moussa
December 6, 2026
0

Robert Kiyosaki, the author of “Rich Dad Poor Dad” and one of bitcoin’s loudest celebrity backers, said Saturday night that...

Bitcoin’s Mayer Multiple Revisits 2022 Terra-Luna Crisis Levels

Bitcoin’s Mayer Multiple Revisits 2022 Terra-Luna Crisis Levels

by Moussa
December 6, 2026
0

Key TakeawaysBitcoin’s Mayer Multiple of 0.607 reflects a 39.32% discount to its 200-day moving average.Readings below 0.65 have historically accompanied...

I bought £250 worth of bitcoin many years ago but I can’t find anything at home, is there a way that someone could help me please?

by Moussa
December 6, 2026
0

my name is Rory Culton and I believe that I am the only Rory Culton in the world and I...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTNDaW5wdXQlMjB0eXBlJTNEJTIyaGlkZGVuJTIyJTIwbmFtZSUzRCUyMm5sYW5nJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1maXJzdG5hbWUlMjIlM0UlM0NsYWJlbCUyMGZvciUzRCUyMnRucC0xJTIyJTNFRmlyc3QlMjBuYW1lJTIwb3IlMjBmdWxsJTIwbmFtZSUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQ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lMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News