To keep the bitcoin protocol running smoothly and protect the network, proof of work is required for security, fraud prevention, and trust-building. Independent data processors (miners) cannot mislead about a transaction because of its security. Proof of work is also used to protect bitcoin’s transaction history while making data changes more difficult over time.
Once all that energy has been burned, transactions are added to the blockchain and cannot be reversed, and to keep track of all of this and ensure miners are working correctly, a decentralised network of thousands of nodes all constantly check the chain against the bitcoin rulesets to ensure there is no funny business.
As long as you play by the rules we agree on, you can broadcast transactions to the network and add new blocks to the chain. Bitcoin wallets and block explorers all connect to full nodes and currently rely full verification process to ensure they remain in consensus. Still, it’s not the only way transactions can be verified.
What is an SPV?
Simple Payment Verification (SPV) is a method that allows a lightweight client to check if a transaction is on the bitcoin blockchain without having to download the entire blockchain. In SPV wallet pulls its data from the block headers, which are significantly smaller than the full blocks, and are all that the SPV client needs to download.
An SPV client requests a Merkle branch as evidence of inclusion to verify that a transaction is included in a block. SPV wallets are not a new concept; in fact, it was mentioned in the original Bitcoin Whitepaper by Satoshi Nakamoto (section 8). In a nutshell, SPV lets you validate your transactions without having to worry about looking at an entire block of everybody else’s transactions.
What is a light client?
Light clients refer to wallets running on low-end systems. An SPV wallet, by definition, is the same as a hot wallet or cold wallet. The only difference is the way it verifies the data that is secured on the active chain. It still ensures your transactions are in a block, and it provides confirmations (proof of work) that additional blocks are being added to the chain.
What are the key features of SPV?
- It is simple and feasible to know the longest chain without becoming a miner.
- A user just needs to preserve a copy of the longest proof-of-work chain’s block headers and retrieve the Merkle branch that connects the transaction to the block it’s timestamped in.
- The user can’t check the transaction for himself, but he can see that it’s been approved by a network node by tying it to a point in the chain, and he can stop it.
- As a result, the verification is reliable as long as the network is controlled by honest nodes, but it becomes susceptible if an attacker gains control of the network.
- While network nodes may independently verify transactions, the simplified approach can be tricked by an attacker’s manufactured transactions for as long as the attacker can maintain network dominance.
- Accepting warnings from network nodes when they identify an incorrect block, forcing the user’s program to download the whole block and notify transactions to validate the discrepancy, is one way to defend against this.
Full vs Simple Payment Verification
Full Payment Verification | Simplified Payment Verification |
Full payment verification wallets require a complete copy of the blockchain. | Simple Payment Verification is a method that allows a lightweight client to check if a transaction without having to download the entire blockchain. |
Wallets run on high-end systems. | Wallets run on low-end systems. |
They can verify that bitcoins used in a transaction originated from a mined block by scanning backwards, transaction by transaction, in the blockchain until their origin is found. | An SPV client requests a Merkle branch as evidence of inclusion to ensure that a transaction is included in a block. |
Running a complete payment verification wallet on laptops and other household devices becomes limited due to resource constraints. | For laptops and other home devices, running a simplified payment verification wallet is convenient. |
Why are SPV proofs so important?
SPV proofs might not seem necessary right now; after all, most of us running full nodes on a simple laptop or raspberry Pi can verify all the bitcoin transactions, so why change it? Why do we want to jump through all these hoops to do the same thing?
While running a full node today doesn’t require that many resources and allows the network to remain easily accessible to everyone, as the blockchain grows, it might start to render certain hardware obsolete.
It also creates a larger barrier to entry for those who cannot access said hardware or don’t have much internet bandwidth. If bitcoin plans to scale to the entire globe, it needs to run non-custodial in the harshest conditions with limited resources.
If we add SPV proofs, the user only needs to know the Merkle root of each block to verify the transactions, so we only have to store 80 bytes per block instead of the much larger size per block required for full nodes. This decrement of over 99.99% makes running the verification inside a low-resource device or a smart contract feasible, a total impossibility if we were to download every single block.
Drawbacks of SPV
SPVs, like everything in bitcoin, have their trade-offs and shortcomings for the efficiency gains you acquire; there are certain limitations where SPV can leave users vulnerable. In the event of a successful 51% attack on bitcoin, the attackers would be able to fool clients relying on SPV proofs into accepting any kind of invalid transaction.
Even with bitcoin being the most secure computing network in the world, It’s possible that a powerful non-economic actor could gather up the resources to exert a 51% attack. While full node users would be able to react quickly and find the right chain that meets consensus and move on, SPV clients would be exposed, breaking a basic security assumption and compromising the whole system.
While a 51% attack is highly unlikely, it still needs to be considered a viable threat, and there’s some research being conducted on systems that could prevent that.
Don’t trust, verify
Running a bitcoin node is like a right of passage and can help immerse you in what the technology is trying to achieve. Once your node is set up, and you’re verifying the chain, once you’ve connected your wallets to verify via your node, you’ll understand the concept of being your own bank because you’re living it.
By removing trust and verifying everything yourself, you eliminate any possible assumptions since you draw straight from the source. If bitcoin is to remain decentralised, the experience needs to be scaled to as many users as possible. Different node implementations and verification methods might be the best way forward.
Are you in consensus?
Do you run a node? Why do you run a node? What node implementation are you using?
Let us know in the comments down below.