Suppose that your SPV client receives an incoming transaction. How can it tell whether it spends a real outpoint? If you knew the block, you could add the txid to filterload and request the block again, but I'm at a loss for how to implement it otherwise.

  • It does seem like it would be useful to have a way to get the block hash for a particular txid in the bitcoin protocol. – morsecoder Sep 3 '15 at 14:23

You don't! The SPV client security model depends on miner confirmations for security. From the Thin Client Security page of the Bitcoin Wiki:

As Satoshi writes, "[the thin client] can't check the transaction for himself, but by linking it to a place in the chain, he can see that a network node has accepted it, and blocks added after it further confirm the network has accepted it." If we take "X" to be the "number of blocks added after it", then SPV essentially trusts that a transaction X blocks deep will be costly to forge.

So, surprisingly, SPV clients don't even need to run an interpreter for scripts. They just see transactions addressed to them and wait to see if they get confirmed.

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.