Would anyone object to adding a dlopen message hook system?



Summary:

The writer proposes the idea of adding module extensions to the core client, allowing modules hooks to be called with message data when messages are received. These hooks could handle, mark peers invalid, push messages to peers or pass through an alternate command. Additionally, modules could have their own private commands prefixed by "x:". The goal is to support using lightning network micropayments to allow people to pay for better node access and create a market for node services. The writer suggests that this should not be "baked in" to core or be a "patch," but rather a linked-in module that can be optionally compiled and added to bitcoin conf, then loaded via dlopen(). Modules should be robust to Bitcoin versions changing out from under them, but not if the network layer is changed. In general, the writer believes that the core reference would benefit from the ability to create subnetworks within the Bitcoin ecosystem. The proposed MessageHookIn, MessageHookOut, and MessageHook classes illustrate how such a module/hook system could be implemented.


Updated on: 2023-06-12T14:52:41.225381+00:00