Compact Client Side Filtering for Light Clients (Neutrino server-side support) #11863

issue Sjors openend this issue on December 11, 2017
  1. Sjors commented at 1:57 pm on December 11, 2017: member

    @Roasbeef, @martelletto and @aakselrod implemented server-side support for this protocol in the btcd client, and the lnd Lightning client is able to use this.

    Are there any prerequisites for implementing server-side support for this protocol in Bitcoin Core, at least as a proof of concept?

  2. TheBlueMatt commented at 2:02 pm on December 11, 2017: member

    Personally I think the protocol has a little ways to go in terms of being well-specified and KISS, but as for proof of concept: a) until things settle, use a testing service bit and not the final one, and b) I believe @jimpo was looking into doing it cleanly, so maybe follow up with him.

    On December 11, 2017 8:57:08 AM EST, Sjors Provoost notifications@github.com wrote:

    @Roasbeef, @martelletto and @aakselrod implemented server-side support for this protocol in the btcd client, and the lnd Lightning client is able to use this.

    Are there any prerequisites for implementing server-side support for this protocol in Bitcoin Core, at least as a proof of concept?

    – You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/bitcoin/bitcoin/issues/11863

  3. jonasschnelli commented at 7:01 pm on December 11, 2017: contributor
    @Sjors: the SPV concept PR #9483 (needs rebasing) could be an initial step for client side filtering. What the PR above does is just fetching all blocks relevant for the wallet(s).
  4. TheBlueMatt commented at 7:16 pm on December 11, 2017: member
    @jonasschnelli I believe the question was about server-side support (ie serving neutrino headers/filters), not client-side SPV support.
  5. Sjors commented at 7:19 pm on December 11, 2017: member
    @TheBlueMatt correct. The other way around should be a separate Github issue if anyone is interested, as it has completely different trade-offs.
  6. fanquake added the label Brainstorming on Dec 11, 2017
  7. Sjors commented at 4:43 pm on December 29, 2017: member
    Note that in the btcd implementation branch the word “neutrino” isn’t used. Look for committed filters and SFNodeCF instead.
  8. jonasschnelli commented at 7:20 am on January 4, 2018: contributor
    Sorry for the confusion. Yes. Server side support should be added to Bitcoin Core. I think the BIP needs to be overhauled and merged first (https://github.com/bitcoin/bips/pull/609).
  9. jonasschnelli commented at 9:04 am on February 9, 2018: contributor
    Related: #12254
  10. ysangkok commented at 10:01 am on April 9, 2018: none
    The replacement pull request of the linked PR (609) was merged and test vectors have been added to BIP 158.
  11. Sjors commented at 1:06 pm on February 19, 2019: member

    #14121 adds an index for these filters

    The step after that is probably implementing p2p messages that use this index if it’s enabled.

  12. Kixunil commented at 8:04 pm on March 12, 2019: none

    I don’t think adding more code to Core is the best design we can have since this can be developed as an external service by fetching blocks from Core. The users that don’t want to provide this service (for security or performance reasons) shouldn’t be forced to have such code compiled-in.

    But maybe I’m missing something?

  13. jimpo commented at 9:19 pm on March 12, 2019: contributor

    @Kixunil I agree that an external service is a valid alternative design choice. However, I believe adding BIP 157 support directly into Core is the better design.

    The security of light clients using the protocol improves with the number of nodes on the network serving filters (at least until filters are committed into block headers if/when that happens). Adding support into Core gives all node operators an easy ability to support light clients with a single configuration flag without having to install/audit/trust a new project. Furthermore, keeping an index of block filters improves rescan speed for full node wallets (by 80+% by my measurements for a 1,000 key wallet). The code is designed to be minimally invasive by using the asynchronous CValidationInterface callbacks and does not modify consensus code or core data structures at all. If you have specific security or performance concerns, please comment on the PR.

    I also think you are underestimating how much work would be involved in creating an external service. Such a service would need to expose the full Bitcoin P2P network interface (or at least a lot of it), which is very non-trivial and arguably much riskier for the network as a whole than Core adding support for a few more requests. Reimplementing the network layer as a proxy node has been discussed before and I’d love to see someone do it, but I’m skeptical that it would reach the same level of stability or support that Core has any time soon.

  14. greenaddress commented at 10:01 pm on March 12, 2019: contributor

    My two cents: I don’t think this should be part of core (but nice rescan perf improvements). In my view it makes more sense as a thin shin in front of core. And if this had to be part of core I think it should be off by default anyway.

    I am not sure if the protocol has to be based on bitcoin p2p but if we assume it has to then something like https://github.com/basil00/PseudoNode or https://github.com/rust-bitcoin/rust-bitcoin may be a good starting point to handle bitcoin p2p messages?

  15. Kixunil commented at 7:02 am on March 13, 2019: none

    @jimpo Thanks for detailed answer!

    TBH, I’d love to see the wallet get removed from Core as well, but since that’s almost certainly not going to happen anytime soon, I consider the argument about increased rescan speed convincing enough to implement block filters. Once they are implemented, it makes a lot of sense to expose them as well (ideally behind configuration flag).

    Installing/trusting other pieces of software is already a problem that people need to solve (e.g. for Btcpay server, HW wallets with ElectrumX/EPS…) Docker, scripts, or manual install (tons of tutorials) are popular methods when it comes to installing. If there’s something missing, maybe making better tools would help the ecosystem overall. When it comes to audit, I wouldn’t object to Core developers also auditing external service and provide their signatures, if they want to.

    I didn’t want to suggest to use the Bitcoin P2P protocol, but some other protocol. Electrum uses the same approach and I don’t see anything wrong with it. But again, I may be missing something.

    Finally, I’m wondering if it’s possible to use block filters with pruned node. It seems possible to me (build filters during sync, keep filters, throw away old blocks). The advantage is obviously being able to rescan quickly and efficiently if it’s needed later. Is this feature implemented/planned/a bad idea?

  16. MarcoFalke commented at 7:43 pm on April 29, 2019: member

    Finally, I’m wondering if it’s possible to use block filters with pruned node.

    Yes, but that needs to be implemented: #15867

  17. MarcoFalke commented at 7:44 pm on April 29, 2019: member
    I am going to close this issue, as it is unclear what is being discussed here exactly.
  18. MarcoFalke closed this on Apr 29, 2019

  19. Sjors commented at 9:32 am on September 1, 2019: member
    #16442 implements this
  20. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me