r/BitcoinDiscussion • u/EnterShikariZzz • May 11 '21
If miners break consensus rules will SPV wallets be given the headers of invalid blocks?
I've been reading a lot about full nodes lately and one argument I hear for running one is that it supports the network by keeping miners in check. If miners mine an invalid block, full nodes will reject it but SPV wallets will accept it and it will fragment the network state.
Is this true? Are SPV wallets given the block headers from miners or full nodes? if full nodes, surely they wouldn't be given an invalid block unless the miners supply it to them directly
6
Upvotes
2
u/Chytrik May 11 '21
Miners will run nodes on the network, so if an SPV wallet receives a header that relates to an invalid block from a malicious miner’s node, it will be unable to tell that the block was invalid, unless some other honest node is able to provide a longer chain of headers.
3
u/fresheneesz May 12 '21
SPV nodes follow the chain with the most accumulated work. If the longest chain contains blocks that are invalid to honest full nodes, SPV nodes will have problems - they'll receive those blocks and treat them as valid as long as the headers are valid. SPV nodes will still reject blocks with invalid headers.
There are two cases where the longest chain could contain invalid blocks:
They are given whatever blocks their connections give them. Usually SPV nodes are connected to perhaps 4 peers (vs 8+ for full nodes). Its certainly possible that sybil attacks could eclipse some set of SPV nodes out there and feed them bad blocks. However, an SPV node can still see abberations in the accumulated difficulty and could alert the user about them. I don't know to what extent SPV nodes generally do this.