{"id":3781,"date":"2023-09-06T15:37:47","date_gmt":"2023-09-06T15:37:47","guid":{"rendered":"http:\/\/ci02c8b56300002578"},"modified":"2023-09-06T15:37:47","modified_gmt":"2023-09-06T15:37:47","slug":"waiting-for-confirmation-bitcoin-optechs-series-on-mempool-and-policy","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/technical\/waiting-for-confirmation-bitcoin-optechs-series-on-mempool-and-policy","title":{"rendered":"Waiting For Confirmation: Bitcoin Optech\u2019s Series On Mempool And Policy"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p>Much of the discussion about Bitcoin technology lately revolves around various soft-fork consensus changes to the Bitcoin protocol including new opcodes or sighashes or around layer 2 technologies like Lightning. Discussion of mempool or policy (the non-consensus rules around Bitcoin nodes communicating with one another) often falls to the background. However, with recent high transaction volume and launch of various NFT and token projects\/platforms and the accompanying <a href=\"https:\/\/bitcoinmagazine.com\/technical\/bitcoins-high-fees-create-controversy-and-challenges\">feerate spike<\/a>, mempool and policy came to the forefront.<\/p>\n<p>User of Inscriptions and other protocols ran into issues with standardness policy rules, leading many to question their purpose and look for ways to remove or subvert them. Regular Bitcoin users ran into issues with fees or bumping fees. In an effort to educate and engage the community, Bitcoin developers <a href=\"https:\/\/twitter.com\/glozow\" target=\"_blank\" rel=\"noopener\">Gloria Zhao<\/a> and <a href=\"https:\/\/twitter.com\/murchandamus\" target=\"_blank\" rel=\"noopener\">Murch<\/a> authored a 10-week series about mempool and relay policy called \u2018<a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/\" target=\"_blank\" rel=\"noopener\">Waiting for confirmation<\/a>\u2019 on the <a href=\"https:\/\/bitcoinops.org\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Optech<\/a> website.<\/p>\n<p>The series starts with an overview of what this cache of unconfirmed transactions we call a mempool is and <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#why-do-we-have-a-mempool\" target=\"_blank\" rel=\"noopener\">why we have one<\/a>. Having a mempool of unconfirmed transactions allows better fee estimation for wallets, faster downloading of new blocks, and supports a decentralized transaction and block relay network.<\/p>\n<p>However, Bitcoin miners are under no obligation to include these unconfirmed transactions in a block. As block space is limited, miners select transactions with the highest feerate by transaction weight to maximize their profits. The post on <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#incentives\" target=\"_blank\" rel=\"noopener\">incentives<\/a> details some nuances around feerates including the fact that onchain fees are paid not in proportion to the transaction amount but by the size of the transaction and complications that arise with relationships between different transactions.<\/p>\n<p>But what should a transaction\u2019s feerate be? That is the goal of <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#feerate-estimation\" target=\"_blank\" rel=\"noopener\">feerate estimation<\/a>: to translate a user\u2019s urgency into a minimal feerate a transaction should pay. Transactions in the mempool and transactions in recent blocks can help provide a good start for estimating transaction fees.<\/p>\n<p>In \u2018<a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#bidding-for-block-space\" target=\"_blank\" rel=\"noopener\">Bidding for block space<\/a>\u2019 Gloria and Murch discuss practical strategies to get the most for your transaction fees. When creating a transaction, consider <a href=\"https:\/\/bitcoinops.org\/en\/topics\/coin-selection\/\" target=\"_blank\" rel=\"noopener\">coin selection<\/a>, using newer output types like taproot\u2019s P2TR that allow for fee savings, or <a href=\"https:\/\/bitcoinops.org\/en\/payment-batching\/\" target=\"_blank\" rel=\"noopener\">batching<\/a>. After broadcasting a transaction, techniques like Child Pays For Parent (<a href=\"https:\/\/bitcoinops.org\/en\/topics\/cpfp\/\" target=\"_blank\" rel=\"noopener\">CPFP<\/a>) and Replace By Fee (<a href=\"https:\/\/bitcoinops.org\/en\/topics\/replace-by-fee\/\" target=\"_blank\" rel=\"noopener\">RBF<\/a>) can be used to increase the feerate of a transaction that is taking too long to confirm.<\/p>\n<p>With the goal of a robust and decentralized network of Bitcoin nodes in mind, we want it to be as cheap and accessible as possible for anyone to run a node. Not only that, but a node\u2019s resources must be protected from DoS attacks. Transaction policy rules that are more restrictive than Bitcoin\u2019s consensus rules help <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#policy-for-protection-of-node-resources\" target=\"_blank\" rel=\"noopener\">protect node<\/a> resources (including memory, computational resources, and bandwidth) by enforcing limits on its untrusted peers on the Bitcoin P2P network.<\/p>\n<p>Likewise, <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#network-resources\" target=\"_blank\" rel=\"noopener\">network-wide resources<\/a> including the UTXO set, protocol upgrade hooks, the size of the block chain and the computational effort required to process it, also need to be protected. A series of other policy rules, including limits on arbitrary data publishing to the block chain, minimum feerates, and limits on low value outputs all help safeguard these network resources.<\/p>\n<p>While policy is optional, Bitcoin Core doesn&#8217;t offer many ways to configure them. In \u2018<a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#policy-consistency\" target=\"_blank\" rel=\"noopener\">Policy Consistency<\/a>\u2019 Gloria and Murch outline potential ramifications of altering some of the default policies and why Bitcoin Core has historically been conservative with the configurability of policies.<\/p>\n<p>It is not just individuals running nodes that should be aware of transaction policy rules. Wallets, services, and layer 2 protocols that broadcast transactions must be designed with <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#policy-as-an-interface\" target=\"_blank\" rel=\"noopener\">policy rules in mind<\/a> to avoid creating transactions that are rejected and to ensure they can get confirmed, even during times of fluctuating feerates. For example, different types of <a href=\"https:\/\/bitcoinops.org\/en\/topics\/transaction-pinning\/\" target=\"_blank\" rel=\"noopener\">pinning attacks<\/a> are possible on L2 settlement transactions like Lightning that take advantage of limitations in mempool policy to prevent incentive-compatible transactions from entering mempools or getting confirmed.<\/p>\n<p>Just as policy rules have been changed or added in the past, there are a series of <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#policy-proposals\" target=\"_blank\" rel=\"noopener\">proposals to improve policy<\/a> as well. <a href=\"https:\/\/bitcoinops.org\/en\/topics\/package-relay\/\" target=\"_blank\" rel=\"noopener\">Package relay<\/a>, <a href=\"https:\/\/bitcoinops.org\/en\/topics\/cluster-mempool\/\" target=\"_blank\" rel=\"noopener\">cluster mempool<\/a>, <a href=\"https:\/\/bitcoinops.org\/en\/topics\/version-3-transaction-relay\/\" target=\"_blank\" rel=\"noopener\">version 3 transaction relay<\/a>, and <a href=\"https:\/\/bitcoinops.org\/en\/topics\/ephemeral-anchors\/\" target=\"_blank\" rel=\"noopener\">ephemeral anchors<\/a> are a few that are under development currently.<\/p>\n<p>However, since transaction relay policy changes to Bitcoin Core can impact many ecosystem participants, they require collaboration, socialization, feedback, and testing from the wider Bitcoin community prior to consideration. The authors note: \u201cDecentralized decision-making is a challenging process, but necessary to support the diverse ecosystem of protocols and applications that use Bitcoin\u2019s transaction relay network.\u201d <\/p>\n<p>Readers should consider <a href=\"https:\/\/bitcoinops.org\/en\/blog\/waiting-for-confirmation\/#get-involved\" target=\"_blank\" rel=\"noopener\">getting involved<\/a> in the different avenues of discussion and participation.<\/p>\n<p>Bitcoin Optech\u2019s also has a <a href=\"https:\/\/bitcoinops.org\/en\/podcast\/2023\/09\/waiting-for-confirmation\/\" target=\"_blank\" rel=\"noopener\">podcast special<\/a> that highlights all of the 10 weeks of our discussion with Murch and Gloria, including comments by guest speakers and questions from the audience.<\/p>\n<p>Thank you to <a href=\"https:\/\/twitter.com\/glozow\" target=\"_blank\" rel=\"noopener\">Gloria Zhao<\/a> and <a href=\"https:\/\/twitter.com\/murchandamus\" target=\"_blank\" rel=\"noopener\">Mark \u201cMurch\u201d Erhardt<\/a> for authoring the series as well as explaining each weekly article on the <a href=\"https:\/\/bitcoinops.org\/en\/podcast\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Optech Podcast<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A summary of the 10 part Bitcoin Optech series describing the inner workings of Bitcoin nodes&#8217; mempools and the rules and incentives that govern them.<\/p>\n","protected":false},"author":2709,"featured_media":3782,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[422,1039],"class_list":{"0":"post-3781","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technical","8":"tag-feature","9":"tag-mempool"},"author_data":{"id":2709,"name":"Mike Schmidt","nicename":"mike-schmidt","avatar_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/12\/mike-schmidt-96x96.png"},"featured_image_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/bitcoin-mempool.png","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/3781","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\/2709"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/comments?post=3781"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/3781\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/3782"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=3781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=3781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=3781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}