If 30% of the network are malicious, how many nodes would an SPV need to connect to, to be sure?


If we assume that 30% of the network is malicious and colluding together to trick an SPV client, by telling him wrong information.

How many random connections would the SPV client, need to connect to before the probability that he has only connected to malicious nodes is negligible?

In other words:

If we assume that the SPV does not know that 30% of the network is bad. What is the probability that he randomly connects to 5 bad nodes in a row?

Kyle Graham

Posted 2018-04-23T22:55:06.510

Reputation: 542



Under the assumption that the total node count is large enough that we don't have to care about the reduction of the ratio by only connecting to nodes we haven't connected to, yet:

The chance to connect to five bad nodes in a row is 0.35 = 0.00243 = 0.243%. AFAIK, many SPV nodes only connect to 4 nodes, though. The probability then is 0.81%.


Posted 2018-04-23T22:55:06.510

Reputation: 51 063

Is spv scalable? I thought it connects to one node, the quickest one? – Kyle Graham – 2018-04-24T03:36:31.280

No, SPV nodes can be lied to by omission. Therefore, SPV nodes must connect to multiple nodes to have good odds of receiving the information they're requesting. According to this (old and potentially unreliable) wiki entry, four connections are common for SPV nodes: https://en.bitcoin.it/wiki/Clearing_Up_Misconceptions_About_Full_Nodes#Very_roughly_estimating_the_total_node_count

– Murch – 2018-04-24T03:46:07.163

Makes sense, thanks for the link. Do people care about their mobile wallet being SPV? Connecting to multiple APIs seems faster and easier. What are your thoughts on SPV, Murch? I can imagine that with 10 different cryptocurrencies, SPV becomes more troublesome to scale In terms of storage and bandwidth – Kyle Graham – 2018-04-24T03:57:20.510

Generally, the tradeoffs of thin clients are reasonably good that they can be used for smaller amounts. I'd recommend to wait for a few confirmations before relying on payments. Thin clients usually only check and store the block headers which is actually not all that much storage and bandwidth. In fact, their biggest cost is that of introducing computational load on the full nodes that serve them which need to filter their blockchain data with the requested bloomfilters. This is improved, though, by advances like roasbeef's Neutrino client which uses Compact Client Side Filtering. – Murch – 2018-04-24T04:07:20.770

That’s a great response. – Kyle Graham – 2018-04-24T04:12:01.883

With HD Wallets, having 1000 addresses would be slow to requery in case someone sends to a previous address. I think I have a bad perception of SPV from using BreadWallet, which is for the most part slow – Kyle Graham – 2018-04-24T04:16:06.357

If you're interested in scalability of thin clients, I can recommend Jameson's comprehensive essay: https://www.coindesk.com/spv-support-billion-bitcoin-users-sizing-scaling-claim/ If you have a follow-up question, it might be better to start another topic. ;)

– Murch – 2018-04-24T04:17:17.587

Thanks for the link. Haha I do have more questions based off of that article, I will ponder them for now. Thanks again Murch! – Kyle Graham – 2018-04-24T04:44:13.587