2

MultiBit is a Simplified Payment Verification (SPV) client that uses the merkle root of block headers to validate transactions. I'm wondering however, when an address (private key) is imported into MultiBit, how does it know its balance without going through all the transactions within the blockchain?

marked as duplicate by Nate Eldredge, Dennis Kriechel, Mathias711, Nick ODell, Jozef Sep 22 '14 at 11:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

When MultiBit imports a private key also in the import file is the key birthdate I.e when it was first generated.

From that date it looks up the most recent checkpoint (about every 2000 blocks) in a list of checkpoints it stores.

Then it contacts a bitcoind and says 'give me all the blocks from block (say) 200,000. Here is the bloom filter I want you to use to filter the blocks'.

This is fairly time consuming compared to if you have a blockstore. (Or something like a remote server like Electrum and Mycelium do). The advantage is that it only uses the Bitcoin Network.

It now has all the relevant transactions for that private key and hence can calculate the overall balance.

  • In short: it does go through all blocks in the chain. However, this happens on another machine, it skips parts from before wallet creation, and uses Bloom filters to speed up the communication. – Pieter Wuille Aug 26 '14 at 7:37
  • 1
    But how do you verify the integrity of a block without all of its contents; only with a filtered portion? Couldn't a dishonest bitcoind report incorrect filtered content? Or does the bloom filter simply ask bitcoind "Give me only the blocks where my address appears"? – Luca Matteis Aug 26 '14 at 11:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.