[BIP Proposal] Mempool Validation and Relay Policies via User-Defined Scripts

Posted by /dev /fd0

Sep 28, 2025/01:22 UTC

In recent discussions among developers regarding enhancements to transaction validation processes, a straightforward yet untested solution has been proposed. The essence of this proposal involves the introduction of a new configuration option named txnotify, which draws inspiration from the existing blocknotify feature. This new option is designed to trigger the execution of user-specified commands or scripts upon the receipt of a new transaction from a peer.

The implementation details include the development of a function, ExecuteTxNotify(), which is tasked with running the script provided by the user. The outcome of this script dictates whether a transaction should be accepted or rejected, based on its return values 'accept' or 'reject', respectively. This functionality allows for a more dynamic interaction with incoming transactions, where the script's verdict directly influences the acceptance of transactions into the memory pool.

To integrate this feature effectively within the transaction processing workflow, it is suggested to invoke ExecuteTxNotify() within the AcceptToMemoryPool() function. This strategic placement ensures that transactions deemed unworthy by the user-defined script are preemptively filtered out, preventing their entry into the mempool. Such an approach not only enhances the control over transaction validation but also introduces a layer of customization, enabling users to tailor the validation process according to specific needs or criteria.

For more detailed information on the topic, refer to the discussion in the Bitcoin Development Mailing List at transaction validation.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback