<p>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.</p>
<blockquote>
<p>Is it possible to query the Bitcoin network for the UTXOs you need?</p>
</blockquote>
<p>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).</p>
<blockquote>
<p>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)</p>
</blockquote>
<p>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.</p>
<blockquote>
<p>Something else?</p>
</blockquote>
<p>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.</p>

CC BY-SA 4.0
2021-10-03T01:17:35.760Z
Thanks for that final paragraph to clarify the description of SPV in the white paper.
davidbak
CC BY-SA 4.0
2021-10-02T18:05:03.727Z
2021-10-03T01:18:40.463Z
2021-10-03T01:18:40.463Z
Claris
<p>The SPV system (as described in the Bitcoin whitepaper) allows: &quot;It is possible to verify payments without running a full network node.&quot;  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).</p>
<p>I'm pretty sure that by &quot;payment&quot; here it means a transaction (outputting to an address you're interested in) that has already been included in a valid block.</p>
<p>But this scheme by itself cannot be used to <em>validate</em> a new transaction.  That can be done with the blockchain headers <em>plus</em> the UTXO set.  <em>That's</em> 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).</p>
<p>So if you (e.g., a merchant) wants a &quot;light wallet&quot; - lighter than a full node! - to validate that a proposed payment is good (not including already spent inputs) that's what you'd need.</p>
<p>How is this done?</p>
<ul>
<li>Is it possible to query the Bitcoin network for the UTXOs you need?</li>
<li>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?</li>
<li>Simply accept Satoshi's suggestion (from whitepaper): &quot;Businesses that receive frequent payments will probably still want to run their own nodes for more independent security and quicker verification.&quot;</li>
<li>Something else?</li>
<li>My beliefs as stated above are wrong?</li>
</ul>
<p>(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 &quot;validation&quot; it's really &quot;provisional validation&quot; subject to the race condition that one or more of the inputs might get spent by a transaction on the blockchain before this <em>proposed</em> transaction gets into a block.)</p>
<p>Bonus question: What would this kind of wallet be called? (Somewhere between an SPV-only &quot;light&quot; wallet and a full node.)</p>
<p>2nd Bonus question: Is there any wallet software doing this that you could point me to that I could look at?</p>

<wallet><spv>
How to use SPV to validate transactions NOT (yet) on the blockchain?
davidbak
# How to use SPV to validate transactions NOT (yet) on the blockchain?

(Asked by: username_0 on 2021-10-02)

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?

**Tags:** wallet, spv


---

## 1 answers

### Answer by username_1 on 2021-10-02. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: Thanks for that final paragraph to clarify the description of SPV in the white paper.  

---

