Author: Olaoluwa Osuntokun 2019-02-05 01:42:57
Published on: 2019-02-05T01:42:57+00:00
A potential change to Bitcoin Improvement Proposal (BIP) 157/158 has been discussed on the Bitcoin-dev mailing list. Tamas Blummer suggests that a filter collecting spent output and output scripts would be more useful than the current design, as it allows for a decision on filter correctness by knowing the block only. This filter is just as useful for wallets as one on spent script since they naturally scan the blockchain forward and learn about their coins by the output script before they need to check spends of those outpoints.Blummer's proposal involves implementing an interrogation by downloading blocks at checkpoints since it is much simpler than following multiple possible filter paths. A spent outpoint filter allows for deciding on coin availability based on immutable store without the updated and eventually rolled back UTXO store. False positives can be sorted out with a block download.On the other hand, Jim Posen suggested three possibilities in this regard. The first involves introducing a new P2P message to retrieve all prev-outputs for a given block and verifying the scripts against the block by executing them. The second includes clients tracking multiple possible filter header chains and considering the union of their matches. If any filter received for a particular block header matches, the client downloads the block. The third possibility involves committing the filters into the chain via witness reserved value or coinbase OP_RETURN and giving up on the pre-softfork BIP 157 P2P mode.The discussion indicates the need for more discussion on the client protocol since clients cannot reliably determine the integrity of a block filter in a bandwidth-efficient manner due to the inclusion of input scripts.The proposed change to BIP158 would involve having a base filter which contains exactly the following items for each transaction in a block: spent outpoints and the scriptPubKey of each output, aside from all OP_RETURN output scripts. This change would allow for wallets to recognize payments to their addresses by the filter as output scripts are included, and spends from the wallet would be recognized as a wallet already knows outpoints of its previously received coins, so it can query the filters for them.Interrogation of a filter server would also simplify, as the filter of the block can be checked entirely against the contents of the same block. The decision on filter correctness does not require more bandwidth than the download of a block at the mismatching checkpoint. The client could only be forced at max to download 1/1000th of the blockchain in addition to the filter header history.However, it is important to note that using an alternate reality by a newly connected BIP157 server could lead to a divergence at a checkpoint, meaning that the server disagrees with the client's history at or before the first diverging checkpoint. In this case, the client would request the filter headers between the last matching and first divergent checkpoint, and quickly figure out which block’s filter is the first that does not match previous assumptions and request that filter from the server.
Updated on: 2023-05-20T19:42:34.835133+00:00