{"id":16229,"date":"2021-06-02T18:28:43","date_gmt":"2021-06-02T18:28:43","guid":{"rendered":"http:\/\/ci0284a88690002467"},"modified":"2025-10-02T10:07:25","modified_gmt":"2025-10-02T15:07:25","slug":"bitcoin-optech-151-transaction-selection","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/technical\/bitcoin-optech-151-transaction-selection","title":{"rendered":"Bitcoin Optech #151: Transaction Selection"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><em>The Bitcoin Optech newsletter provides readers with a top-level summary of the most important technical news happening in Bitcoin, along with resources that help them learn more. To help our readers stay up-to-date with Bitcoin, we&#8217;re republishing the latest issue of this newsletter below. Remember to subscribe to receive this content straight to your inbox.<\/em><\/p>\n<p>This week\u2019s newsletter describes a proposal to change Bitcoin Core\u2019s transaction selection algorithm for miner block templates to slightly increase miner profitability and give fee bumping users more collective leverage. Also included are our regular sections describing software releases and release candidates, plus notable changes to popular Bitcoin infrastructure software.<\/p>\n<h2>News<\/h2>\n<ul>\n<li><strong>Candidate Set Based (CSB) block template construction:<\/strong> Mark Erhardt <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=a48dfad522&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">posted<\/a> to the Bitcoin-Dev mailing list about an analysis he and Clara Shikhelman performed on an alternative transaction selection algorithm for miners. Bitcoin\u2019s consensus rules enforce that no transaction can be included in a block unless all of its unconfirmed ancestors are also included earlier in that same block. Bitcoin Core addresses this constraint by treating each transaction with unconfirmed ancestors as if it contained both the fees and the size of those ancestors. For example, if transaction B depends on unconfirmed transaction A, then Bitcoin Core adds together the fees paid by both transactions and divides them by the combined size of both transactions. This allows Bitcoin Core to fairly compare all transactions in the mempool based on their effective feerate whether or not those transactions have any ancestors.However, Erhardt and Shikhelman note that a more sophisticated algorithm that may require a bit more CPU can find sets of related transactions that are even more profitable to mine than Bitcoin Core\u2019s existing simple algorithm. The authors tested their algorithm on historic mempool data and found that it would\u2019ve collected slightly more fees than Bitcoin Core\u2019s existing algorithm in almost all recent blocks.If implemented and used by miners, the improved algorithm could allow multiple users who each received an output from a large <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=6218b17dec&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">coinjoin<\/a> or <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=6faf4bf44d&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">batched payment<\/a> to each pay a small part of the total fee necessary to <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=2f69d8cc68&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">CPFP fee bump<\/a> that coinjoin or payment. That would be an improvement over the current case where each user\u2019s CPFP fee bump is considered independently and multiple related fee bumps may not have an aggregate effect on whether an ancestor transaction is mined.<\/li>\n<\/ul>\n<h2>Release And Release Candidates<\/h2>\n<p><em>New releases and release candidates for popular Bitcoin infrastructure projects. Please consider upgrading to new releases or helping to test release candidates.<\/em><\/p>\n<ul>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=775d8f81ba&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">HWI 2.0.2<\/a> is a minor release that adds support for message signing with the BitBox02, always uses <code>h<\/code> instead of <code>'<\/code> to indicated <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=86ad9ec01a&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">BIP32<\/a> paths with hardened derivation, and includes several bug fixes.<\/li>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=75556f71b0&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">LND 0.13.0-beta.rc3<\/a> is a release candidate that adds support for using a pruned Bitcoin full node, allows receiving and sending payments using Atomic MultiPath (<a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=5177af2918&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">AMP<\/a>), and increases its <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=7997ef7962&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">PSBT<\/a> capabilities, among other improvements and bug fixes.<\/li>\n<\/ul>\n<h2>Notable Code And Documentation Changes<\/h2>\n<p><em>Notable changes this week in <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=ba20bc1407&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Bitcoin Core<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=f0d549c74d&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">C-Lightning<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=4acf2e5abf&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Eclair<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=dd6d633863&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">LND<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=1dec72732f&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Rust-Lightning<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=3d913eff51&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">libsecp256k1<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=4a4b7020a8&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Hardware Wallet Interface (HWI)<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=73deae694f&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Rust Bitcoin<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=04a0d0dae4&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">BTCPay Server<\/a>, <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=575b295ee6&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Bitcoin Improvement Proposals (BIPs)<\/a>, and <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=e858c79c44&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Lightning BOLTs<\/a>.<\/em><\/p>\n<ul>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=76b8726853&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Bitcoin Core #20833<\/a> is the first PR in an effort to implement <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=edb3373909&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">mempool package acceptance<\/a> in Bitcoin Core. This change allows the <code>testmempoolaccept<\/code> RPC to accept multiple transactions where later transactions may be descended from earlier transactions. Future PRs may enable testing L2 transaction chains, submitting transaction packages directly to the mempool through RPCs and communicating packages over the P2P network.<\/li>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=beec987df4&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Bitcoin Core #22017<\/a> updates the code signing certificate used for Windows releases after the previous certificate was revoked by its issuer without them providing an explicit reason. Several recent releases of Bitcoin Core might be re-released with slightly different version numbers so that their Windows binaries can use this certificate.<\/li>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=f11a317401&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Bitcoin Core #18418<\/a> increases the maximum number of UTXOs received to the same address that will be spent simultaneously if the <code>avoid_reuse<\/code> wallet flag is set. The more outputs that are spent together, the higher the fee might be relative to a wallet with default flags but, also, the less likely it becomes that third parties will be able to identify the user\u2019s later transactions.<\/li>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=82e9d9fc2b&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">C-Lightning #4501<\/a> adds <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=13f145566a&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">JSON schemas<\/a> for the output of roughly half of C-Lightning\u2019s current commands (with schemas for the other half planned to be added in the future). Output produced during a run of C-Lightning\u2019s test suite is validated against the schemas to ensure consistency. The schemas are also used to automatically generate C-Lightning\u2019s documentation about what output each command produces.<\/li>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=99648b4cf0&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">LND #5025<\/a> adds basic support for using <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=9038fafc0d&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">signet<\/a>. Of the other LN implementations tracked by Optech, C-Lightning also has support for signet (see <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=67939bc9f8&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Newsletter #117<\/a>).<\/li>\n<li><a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=74187ba3c4&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">LND #5155<\/a> adds a configuration option to randomly select which wallet UTXOs to spend in a transaction; this reduces UTXO fragmentation in the wallet over time. By contrast, the default coin selection algorithm in LND spends higher value UTXOs before lower value UTXOs; this minimizes fees in the short term but may result in needing to pay higher fees in the future when all inputs near the size of a transaction, or larger, have already been spent.<\/li>\n<li>BOLTs #672 updates <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=b89293171d&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">BOLT2<\/a> to allow nodes to negotiate a <code>option_shutdown_anysegwit<\/code> option which, if set, allows LN closing transactions to be able to pay any segwit script version, including script types that don\u2019t yet have consensus meaning on the network, such as addresses for <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=7694899d0d&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">taproot<\/a>.<\/li>\n<li>BOLTs #872 updates <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=cbc09dc394&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">BOLT3<\/a>\u2019s use of <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=60c139d5a5&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">BIP69<\/a> to specify in more detail the sort order to use for commitment transaction inputs and outputs. One commentator points out that the use of BIP69 has so far caused three separate problems that may have led to accidental channel closures and small amounts of funds lost to unnecessary onchain fees. The commentator suggests that this is another reason to migrate away from explicit use of BIP69 (for other reasons, see <a href=\"https:\/\/bitcoinops.us18.list-manage.com\/track\/click?u=70c3f85e5d13ffec674f30af8&amp;id=eb401df58a&amp;e=1beccaec05\" target=\"_blank\" rel=\"noopener\">Newsletter #19<\/a>).<\/li>\n<\/ul>\n<p>Find the <a href=\"https:\/\/bitcoinops.org\/en\/newsletters\/\" target=\"_blank\" rel=\"noopener\">original post here.<\/a><\/p>\n<p>Please <a href=\"https:\/\/bitcoinops.org\/en\/newsletters\/\" target=\"_blank\" rel=\"noopener\">subscribe to the Bitcoin Optech newsletter<\/a> directly to receive this content straight to your inbox every month.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s Bitcoin Optech newsletter describes a proposal to change Bitcoin Core\u2019s transaction selection algorithm and more.<\/p>\n","protected":false},"author":3246,"featured_media":10844,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[2887],"class_list":["post-16229","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technical","tag-bitcoin-optech"],"author_data":{"id":3246,"name":"Bitcoin Optech","nicename":"bitcoin-optech","avatar_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/12\/optech-notext-96x96.png"},"featured_image_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/cybersecurity-firm-reports-all-fortune-500-companies-exposed-on-the-dark-web.jpg","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/16229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/users\/3246"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/comments?post=16229"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/16229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/10844"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=16229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=16229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=16229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}