0

The SPV system (as described in the Bitcoin whitepaper) allows: "It is possible to verify payments without running a full network node." You only need the headers for the entire valid blockchain (a small amount of data, growing linearly over time) (and of course you need peers to get inclusion proofs from).

I'm pretty sure that by "payment" here it means a transaction (outputting to an address you're interested in) that has already been included in a valid block.

But this scheme by itself cannot be used to validate a new transaction. That can be done with the blockchain headers plus the UTXO set. That's more data (today, 2021-10-02, the UTXO set is ~4¼GB, significantly more than the 53½MB blockchain header set, though much more reasonable for today's machines than it was back at the beginning of Bitcoin).

So if you (e.g., a merchant) wants a "light wallet" - lighter than a full node! - to validate that a proposed payment is good (not including already spent inputs) that's what you'd need.

How is this done?

  • Is it possible to query the Bitcoin network for the UTXOs you need?
  • Do you keep your own UTXO set by listening for new blocks and validating them and updating your UTXO set then throwing the blocks away (keeping the header) - after first bootstrapping your UTXO set somehow without having to fetch the entire blockchain?
  • Simply accept Satoshi's suggestion (from whitepaper): "Businesses that receive frequent payments will probably still want to run their own nodes for more independent security and quicker verification."
  • Something else?
  • My beliefs as stated above are wrong?

(I'm interested in solutions where you validate these things yourself, not where you call on a 3rd party to do it, similar in philosophy to SPV itself. Plus, I know that above where I'm talking about "validation" it's really "provisional validation" subject to the race condition that one or more of the inputs might get spent by a transaction on the blockchain before this proposed transaction gets into a block.)

Bonus question: What would this kind of wallet be called? (Somewhere between an SPV-only "light" wallet and a full node.)

2nd Bonus question: Is there any wallet software doing this that you could point me to that I could look at?

2

A SPV wallet simply can not validate unconfirmed transactions in any capacity. As you've correctly noted, the absence of having a validated UTXO means that the absolute best a SPV wallet can establish is that there might be a transaction available to confirm, but it can not determine anything about it.

Is it possible to query the Bitcoin network for the UTXOs you need?

You can not ask for an untrusted third party for this information because they can always lie by omission, as merkle proofs only prove that a UTXO has existed, not that it still exists (has not been spent in any block since).

Do you keep your own UTXO set by listening for new blocks and validating them and updating your UTXO set then throwing the blocks away (keeping the header)

You can't validate new blocks because you can't determine the validity of transactions in it without their prior references. You can however just run a pruned node, which keeps only the validated UTXO and a handful of blocks around, rather than the entire history.

Something else?

The only correct way to trustlessly accept payments in Bitcoin is to run a fully validating node. It's worth mentioning that the description of SPV as in Satoshi's white paper doesn't really work. There is a suggestion that nodes can alert SPV clients of potential fraud and cause them to download and validate a specific block, but this is very much impossible. By definition they have no verified UTXO and can not validate blocks in isolation.

1
  • Thanks for that final paragraph to clarify the description of SPV in the white paper.
    – davidbak
    Oct 3 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.