Open shuijian-xu opened 4 years ago
Bloom filter consists of:
The size of the bit field
The hash function used (and how we converted that to a number)
The bit field, which indicates the bucket we’re interested in
A Bloom filter is a filter for all possible transactions. Full nodes run transactions through a Bloom filter and send merkleblock commands for transactions that make it through.
Suppose there are 50 total transactions. There is one transaction a light client is interested in. The light client wants to “hide” the transaction among a group of five transactions. This requires a function that groups the 50 transactions into 10 different buckets, and the full node can then send a single bucket of transactions, in a manner of speaking. This grouping would have to be deterministic—that is, be the same each time.
A Bloom filter can be optimized by,
changing the number of hash functions and
bit field size to get a desirable false-positive rate.