SPV (Simplified Payment Verification)
Also called: SPV, Simplified Payment Verification, SPV wallet, light client, lightweight wallet.
SPV (Simplified Payment Verification) is how light wallets check payments using only block headers and Merkle proofs, without downloading full blocks.
SPV, or Simplified Payment Verification, is a way to check that a transaction is in the blockchain without downloading and validating every block. It is described in section 8 of the Bitcoin whitepaper. An SPV client, or light client, keeps only the chain of block headers (80 bytes each) and checks their proof of work.
How SPV works
- Download all block headers and follow the chain with the most work.
- For a transaction of interest, get a Merkle proof: the hashes linking its txid to the Merkle tree root in a block header.
- Count confirmations by how many headers have been built on top.
A proof is small, about log2(n) hashes for a block of n transactions, so even a phone can verify payments cheaply.
Finding relevant transactions
The client also has to learn which transactions are its own. BIP 37 Bloom filters asked full nodes to filter for it, at a cost to privacy. BIP 157 and BIP 158 compact block filters let the client do the matching itself.
SPV's security assumption
An SPV client doesn't check the consensus rules; it assumes the chain with the most work is valid. That holds while most hash power is honest, but the client can't detect, say, a block that creates too many coins. BIP 141 discusses fraud proofs as a possible improvement, BIP 180 proposed one for oversized blocks, and BIP 54 proposes banning 64-byte transactions, which can be used to forge an SPV inclusion proof. Running a full node remains the way to verify everything yourself.