7

As far as I know, when I use Electrum I'm just choosing servers to trust that hold the blockchain.

But in this recently published article I read this about Multibit:

It uses a slightly weaker trust model than Bitcoin-Qt. In SPV mode, with clients like Multibit and Hive, it still scans the blockchain, and what it assumes is whatever blockchain has the majority of miners on it [is correct]. Instead of verifying the entire contents, it just trusts that the majority of miners are honest. It's still peer to peer.

Does this mean that Multibit's SPV implementation is more "P2P" than Electrum? Does it connect to peers (other thin-client users) instead of servers?

knocte
  • 1,764
  • 1
  • 17
  • 32

2 Answers2

5

MultiBit connects to (typically) four bitcoinds at random at start up. It then picks the best peer (using ping times, advertised blockchain height and the version of the peer to decide) and uses that as the download peer to get the block headers from.

It is thus using one peer to catch up the blockchain from where it previously knew about.

It listens to all four connections to hear about all the new broadcast transactions and uses this to work out a 'transaction confidence'. If four peers tell it a transaction exists, it has more confidence that the transaction is real.

When it sends a transaction, it sends it via the single download peer and then listens on the other peers to hear that transaction 'echo' back from the network. Once it has heard the transaction it just sent come back via other peer(s) it can be confident that the transaction is 'out in the Bitcoin network'.

jim618
  • 3,325
  • 14
  • 16
4

Electrum is not peer-to-peer (P2P). It only connects to electrum-specific servers to broadcast your transactions and to receive transactions. It's very similar to a web-wallet, however you're the one who holds the keys. So the Electrum client signs the transaction with your private key (that you hold), and then sends it to electrum-specific servers that take care of broadcasting it out to other peers.

MultiBit on the other hand does connect to other peers without any proxy server, so it is P2P.

Both Electrum and MultiBit clients download the blockchain headers (not the entire content) so they're considered Simplified Payment Verification (SPV) clients.

Luca Matteis
  • 5,182
  • 17
  • 24
  • wait a sec, are you saying then that MultiBit client **is** P2P, therefore it's less secure? – knocte Nov 13 '13 at 13:46
  • Being P2P doesn't make it less secure. It simply means you connect to several computers instead of one. – Luca Matteis Nov 13 '13 at 13:47
  • if it connects to several computers instead of one, then it is MORE SECURE, because finding N malicious nodes is harder than finding 1 malicious node (therefore Multibit is more secure than Electrum) – knocte Nov 13 '13 at 14:14
  • What? `"finding N malicious nodes is harder than finding 1 malicious node"`. That doesn't really make sense. You have the keys so they cannot do anything with your money. So they're both equally secure. But again, i'd rather stay with P2P clients because, if say Electrum servers go down, you can't really send transactions. But security wise, again, both secure equally. You hold the keys. – Luca Matteis Nov 13 '13 at 14:20
  • 1
    @knocte to complete what you've said: Electrum client connects to multiple Electrum servers in order to retrieve block headers and find the longest chain. This way it can avoid malicious servers. – rdymac Nov 13 '13 at 15:04
  • @rdymac: is that a recent change? – knocte Nov 13 '13 at 15:04
  • @LucaMatteis by insecure I've never meant that the servers could take my money, but that they could give a false blockchain information, therefore I'm downvoting your answer – knocte Nov 13 '13 at 15:05
  • 1
    @knocte it was introduced in 1.9 and some other security improvements https://github.com/spesmilo/electrum/blob/master/RELEASE-NOTES – rdymac Nov 13 '13 at 15:05
  • @rdymac, ok thanks, I've updated my question – knocte Nov 13 '13 at 15:07
  • @knocte they can't. you have the headers (SPV) and you can check their validity by checking their hashes against the target. so they can't give you a "false" blockchain. – Luca Matteis Nov 13 '13 at 15:09
  • against what target? the mathematical proof to check that the blockchain given is correct is just to make sure it's not a random blockchain, but one could still fake one which is correct – knocte Nov 13 '13 at 16:50
  • 1
    @knocte you obviously don't know how Bitcoin works, and you've downvoted me nonetheless. Please inform yourself before assuming something is wrong. I don't feel compelled to explain more in details, so I'll just say that: to generate a valid blockchain yourself you'd need more hashing power than the entire network. So no, nor you nor Electrum can fake it! – Luca Matteis Nov 13 '13 at 16:53
  • I didn't downvoted your comments, but your answer, which still assumes I was referring to "taking my money". You can still remove your answer. And take in account I am not saying that me or Electrum can fake a blockchain, but an **electrum server** (just one), could, and specifically, to an electrum client v1.8 or older (because since 1.9 the client connects to more than one server). – knocte Nov 13 '13 at 16:58