Hot answers tagged

40

Simplified Payment Verification: A Bitcoin implementation that does not verify everything, but instead relies on either connecting to a trusted node, or puts its faith in high difficulty as a proxy for proof of validity. BitCoinJ is an implementation of this mode. http://en.bitcoin.it/wiki/Scalability#Simplified_payment_verification Also read: ...


19

You are right that SPV as described in the Bitcoin paper does not explain how to discover payments to yourself, without downloading full blocks. My guess is that Satoshi either planned to develop this later, or that he assumed you'd just be told about payments to yourself (pay-to-IP, as existed next to pay-to-pubkeyhash as is used now). Practical ...


6

If it helps https://gist.github.com/TOMOAKI12345/7e0aa1c6b8ace4a70ca6 Breadwallet source code is really good source to learn about the network protocol of SPV wallet.


6

Generally speaking, BIP37 bloom filtering SPV has atrocious scaling though it is hard to say exactly how poor it is in the real works. Every peer must sync the entire block chain from the last they had contact with the network, in the worst case this is approximately 50GB. The node must load every single block from disk, filter it to the clients ...


6

No. bitcoind does not have a SPV mode at all. Pruning is not the same thing as SPV because a pruned node still downloads and verifies the blockchain. Just instead of storing all of the blocks in the blockchain, it discards blocks when they become deep enough in the blockchain. This reduces disk usage but does not effect security, bandwidth usage, or ...


5

Electrum: No protection, the server you are connected to knows every address you own and will own in the future. If you use Tor your IP address is hidden, but the addresses are still associated. Bloom filters are not in use for this client. MultiBit In theory the bloom filter can be modified to include junk data to hide your addresses with loads of fake ...


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 ...


5

Bloom filters are probabilistic, each attempted match you make with it has a specific chance of being a false positive. The rate of false positives is determined by the construction of the filter (how wide it is and how many elements have been added to it). A transaction either probably matches, or certainly doesn't match a given bloom filter. BIP37 does ...


5

In a bitcoin transaction, A's address is not scanned for spendable Unspent Transaction Outputs (UTXOs). Full nodes simply check if the inputs of the transaction are really unspent. There is no scanning of addresses involved. UTXOs are stored as the transaction id (txid) and the output index of the transaction that created them. You cannot reference the ...


5

In Bitcoin, inner nodes of the merkle tree are constructed by concatenating two 32 byte SHA256d hashes together. The resulting 64 byte value is hashed to get the next node in the tree. The leaf nodes are the transactions themselves. Merkle trees are used to prove that a transaction is part of a block as the merkle root is placed in the block header for the ...


5

There is no known way to do this with the current consensus rules nor does it seem likely except via computationally expensive general ZKP. The normal way to make compact proofs of non-membership is to have a hash tree which is ordered by the key you're looking to prove non-membership on. The proof is just the two neighbors that are greater and lesser than ...


4

This is what I do: Connect to peer Set bloom filter Send 'getblocks' message Send 'getdata' message with MSG_FILTERED_BLOCK set for any new blocks Note that 'getblocks' returns a list of block chain hashes from the specified starting point, not the blocks themselves. Then 'getdata' returns 'merkleblock' messages instead of full blocks. The peer follows ...


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 ...


4

Does the current release of BitcoinJ add both a public key and its hash value to its Bloom filters? If not, which release stopped it from occuring? Yes. The following code implements it: /** Inserts the given key and equivalent hashed form (for the address). */ public synchronized void insert(ECKey key) { insert(key.getPubKey()); insert(key....


4

The main bottleneck of committing to a UTXO merkle root is that it's I/O and CPU heavy to create and verify. As of today the serialized UTXO set is around 1GB and it contains almost 34000000 entries and it keeps growing. This means that a naive implementation would have to hash at least that amount of data per block plus the intermediate nodes to construct a ...


4

Yes, bitcoind with pruning is similar to bitcoind, though some RPCs are disabled (naturally, because of pruning). bitcoind in pruning mode does not store the whole blockchain, and can reduce your space usage to 2GB instead of 85GB. See the release notes here and here. Update: There is also a Full Block SPV wallet PR by Jonas Schnelli. Which is even ...


4

As Alin explained today the lightest version is pruned mode. However there are pull requests for an even lighter version, called full block downloading SPV mode, or full-SPV mode. Keep an eye on these two pull requests. You are also free to contribute: Complete hybrid full block SPV mode Add simple light-client mode (RPC only)


4

You can read the bip37 specification for all of the gritty details. how does the full node find this transaction (or the UTXOs) in the blockchain? The client builds a filter which contains what they're interested in, be it output script (addresses), public keys, or TXID. They then send this to the node they are connected to. When they request data for a ...


4

I can imagine that an SPV node encodes the transaction(s) it's interested in, into a BF and sends it to full node. What I don't understand is that what does the full node do after that? The full node goes through every transaction on the blockchain. (Or, at least, every transaction that happened after the wallet was created.) It checks the following things ...


4

The whitepaper said that SPV clients would avoid accepting a rules violating block by being altered to the violation, downloading the block, and checking for themselves. This is not realistically possible in the protocol as it exists today because the commitment structure means that for many rules the smallest amount of data you must download to tell if a ...


4

This answer is a slight modification on the description used in Bitcoin Optech Newsletter #43. Full credit and thanks to Dave Harding! BIP158 introduces Compact block filters, which are are based on an efficient method for encoding a list of equally-sized items. In the case of the "basic" block filters described in the BIP, this is a list of all the ...


3

See this paper for a good discussion: On the Privacy Provisions of Bloom Filters in Lightweight Bitcoin Clients


3

BreadWallet for iOS is open source, has a permissive license, and uses SPV https://github.com/voisine/breadwallet/blob/78d67870cdb887bab69ffeab8d808a3cb24d3759/BreadWallet/BRPeer.m


3

Block fetching requests are also filtered, so the client requests every single block they missed out on seeing since the last time they were last online, sequentially. The client downloads all block headers from genesis up to the current head using getheaders, sets a filter on their peer with filterload, and then downloads filtered blocks with getdata until ...


3

SPV nodes usually only look at block headers, and then will download some of the actual block data of blocks which other peers have told them contain transactions relevant to them. SPV nodes are relying on at least one of their peers to be honest and report when a transaction appears on the network that is relevant to them. But how do other peers know ...


3

Just found something in bitcoinj sourcecode: /** * The "getheaders" command is structurally identical to "getblocks", but has different meaning. On receiving this * message a Bitcoin node returns matching blocks up to the limit, but without the bodies. It is useful as an * optimization: when your wallet does not contain any keys created before a ...


3

From my experience, your solution is the MultiBit Wallet software - it should satisfy all your requirements: https://multibit.org/index.html I use it on a regular basis and found it satisfying, and also have the possibility of storing more than one wallet, you should give it a try. Cheers.


3

Reclaiming disk space describes what is nowadays called pruning. After downloading the entire block chain, you can safely throw most of it away because old spent transaction outputs are never needed again. This is not yet fully supported in Bitcoin Core, but it probably will be possible in the next major release. From the paper (my emphasis): Once the ...


3

The SPV uses the Merkle Root in the header to verify transaction information full nodes provide. As a header refers to the previous block by hash, an SPV wallet can be somewhat sure that it has real blockchain information. To hear about transactions relevant to it, an SPV requests to get information about any transactions involving a provided set of public ...


3

If you assume you are not being attacked, in the sense that your internet connection is not being restricted in a way that it allows you to only connect to an attacker's nodes without you noticing (Sybil attack). And note that that's actually an assumption that doesn't always hold and you can't really prove you're NOT being attacked, so it is certainly a ...


Only top voted, non community-wiki answers of a minimum length are eligible