• 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

Sam Altman ChatGPT AI Predicts a Super Bullish Reversal for BTC

Sam Altman ChatGPT AI Predicts a Super Bullish Reversal for BTC

November 15, 2026
Ether ETFs Approach an Unwanted Record After Seven Weeks of Outflows

Ether ETFs Approach an Unwanted Record After Seven Weeks of Outflows

November 15, 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

Sam Altman ChatGPT AI Predicts a Super Bullish Reversal for BTC

Sam Altman ChatGPT AI Predicts a Super Bullish Reversal for BTC

by Moussa
November 15, 2026
0

Bitcoin is trading near $64,000–$65,500 in mid-November 2026 after a sharp, multi-week decline that erased much of its recent gains...

Ether ETFs Approach an Unwanted Record After Seven Weeks of Outflows

Ether ETFs Approach an Unwanted Record After Seven Weeks of Outflows

by Moussa
November 15, 2026
0

US spot Ether exchange-traded funds are edging toward an uncomfortable milestone. The category has now recorded seven consecutive weeks of...

Tom Lee Predicts Massive Crypto Supercycle Despite Market Crash

Tom Lee Predicts Massive Crypto Supercycle Despite Market Crash

by Moussa
November 15, 2026
0

Key TakeawaysTom Lee dismissed the crypto downturn, arguing that strong tradfi adoption will drive a new supercycle.He linked the weakness...

Strategist Sees Bitcoin Path to $170K Despite Selloff, Says ‘Buy the Fear’

Strategist Sees Bitcoin Path to $170K Despite Selloff, Says ‘Buy the Fear’

by Moussa
November 15, 2026
0

Key TakeawaysThorne targeted $117,000 by mid-2027 before a possible record high.Bitcoin must reclaim $73,000, then clear $87,000 in his scenario.A...

Michael Saylor Hints at Another Strategy Bitcoin Buy as BTC Slides

Michael Saylor Hints at Another Strategy Bitcoin Buy as BTC Slides

by Moussa
November 15, 2026
0

Key TakeawaysSaylor signaled interest in more bitcoin buying during the market decline.Every $1,000 bitcoin move changes Strategy’s holdings’ value by...

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

© 2024 APPROX FOUNDATION - The Crypto Currency News