Delivery-date: Sat, 24 Feb 2024 14:54:08 -0800 Received: from mail-yb1-f183.google.com ([209.85.219.183]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1re0uF-00009r-Rw for bitcoindev@gnusha.org; Sat, 24 Feb 2024 14:54:08 -0800 Received: by mail-yb1-f183.google.com with SMTP id 3f1490d57ef6-dced704f17csf3026724276.1 for ; Sat, 24 Feb 2024 14:54:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708815241; cv=pass; d=google.com; s=arc-20160816; b=E9+dULdMGXnBKkO4EmY3+bfZ1/OKS81dX3INWLLGdRGboDFpqFGLWZ7QmQlD8iYa7r uQBnJGmsCe60WQGSyWR2/NF4aLjrHbRgGGPbxd/QfXETfmD9Kb6fCuSX+YRJ3QuOMOOH PiVF0U4bH2pHllO0PrtdK/74iS9pkuopwieb77UXEbqtNeCnpeg2nUhN2S663R7z8R35 JbwJD+CYjqXDgTk+9FwVJ/tvm+MxUg+LglLnzOjGW9MjQM1ssdqQUJ4q5AZnMKJsN7G7 K7u39ufv8AIL5G7yFroJpbkLJuBRCuYE7R4+qpBqRgMeXs4p0E8MxB6jpbWXXTGmD4ER PXIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:sender:dkim-signature; bh=eiffofUFlVr/ve8F+3YjvqbD4fjysnctvW+B268vhAM=; fh=KubeKgl3DuTM/IFxDRrNkR2tsVCkxg7P6skWuOcuA1E=; b=vh5in3IUfOW3aamGk4trpNSkfeRTXEsdWCJcukbzwlUq/h3tYS6YpILvVwNL26pWny XPk7Iufr8X5mWyN89a+ahj20yqx5nAeW344pvbE+2Ybk0langNSqfZCXycQd2GwApcke 1TDF/YUepOLu523IG/+jgKphZW1vOkmoAaUCRnlBCqe6Gk9J9nPS2RnR/APaQ4+rzu35 zvnUjl9HytLDjJrBek/953deiJpVASQpHq4pgtgTOXRPzUQuKWCM+Xqij/6j+8YYtYI5 K0MwIXDUqBIQg2Ymqyp+OYm22gHsYeqct/UwBjFNSAypin2qsogCdRkHpRZKOjBB502R rL1g==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=KxY3Evwe; spf=pass (google.com: domain of pete@petertodd.org designates 103.168.172.158 as permitted sender) smtp.mailfrom=pete@petertodd.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1708815241; x=1709420041; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=eiffofUFlVr/ve8F+3YjvqbD4fjysnctvW+B268vhAM=; b=ZiyGvSa6cND+f+9RqTK+IitPCtHtV5JluOGJOYk2OBVspPcNerCD/BRfhb1XTLSdq5 +PcWWzDeH1sskPBxnddukA48505X3A/4FHVpCBf7gY3PaIApIpH/qKBKJlW0e2nS0WqF 42VlzhZbXK1D3p6dLBlR4yTsLtfKKwpMgb1IlVDWveiYMy34rFSYYKsouhv9sUW7egge lv0Ijvi5BSjX0gp3iPDfL38xqlMfPu3EWGyr2J330rHzOrRYGr+Q7tzVnRYdDOJBS503 AXHnOCQcpQT0+jLR+QKjcOPib3HXa9DbTuqAs/kcKvRWGe3P3MEABQHltnxkcI5xFzYt wnFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708815241; x=1709420041; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=eiffofUFlVr/ve8F+3YjvqbD4fjysnctvW+B268vhAM=; b=VcrvOMu5rqC9bJIaJX5SJ1okCMgEq5nmvL6lmzR8EMpmzeUf7Jep3P7X2BLyk4L/S6 cd2AON3lXhOKLHor49llUVX2X6nSr0lpoIGO08mUqry7FnkrcIpPEIMyWywNYwhyji9H N8yFmmX6NGmJHAFZ9AmpOwkLmC+GpstW8bKsnXM3U81LXl5oSdCqSXt1q+zYG5M5PwGw b5RV2p/A+nRlERH0DAP7r8xLHBN5Vvk66rnLnvaOpoP9UHaDv/N3JCaA8qGZjl3jgTCv axjkPGIuJ6xGiOkd8VDu6z9nv2vQTiyVd+XXI8vj9TI29vlbNpq4LqcFU99rRpxkNpte th+w== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUEKm6S2zOWGuv4zdeK7+VMlFva8sSL57RSwi1AN9+R8uiIgLZKO3JHPdHQpmlNaGAnQ72lxnmlaHl+OXNbNgnR+whrbI8= X-Gm-Message-State: AOJu0Yzj+1C5ScfRyZ7/eTXP34sJ1SH1UcxqLW6j935uz/zQsRu7gndK wbdiA8dOvrBM0uavYShqIVbr1wbmA7dgctFXffgwn+/kkP5sZ4FK X-Google-Smtp-Source: AGHT+IHWX4/qGpAb9VORkswTMThmzybAVHTA/8cCqYyKAAORMejOKTv7TEIs9LVn/b6dpMxMUp5j9Q== X-Received: by 2002:a25:688d:0:b0:dc6:b820:bb45 with SMTP id d135-20020a25688d000000b00dc6b820bb45mr2335273ybc.27.1708815241405; Sat, 24 Feb 2024 14:54:01 -0800 (PST) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:a25:e0d0:0:b0:dcd:a08f:c840 with SMTP id x199-20020a25e0d0000000b00dcda08fc840ls1666391ybg.1.-pod-prod-09-us; Sat, 24 Feb 2024 14:54:00 -0800 (PST) X-Received: by 2002:a81:9187:0:b0:608:d0a4:75ea with SMTP id i129-20020a819187000000b00608d0a475eamr767240ywg.7.1708815240432; Sat, 24 Feb 2024 14:54:00 -0800 (PST) Received: by 2002:a05:690c:fd3:b0:608:91d2:e926 with SMTP id 00721157ae682-608b899f876ms7b3; Sat, 24 Feb 2024 14:26:03 -0800 (PST) X-Received: by 2002:a05:6358:4410:b0:178:6db3:27d0 with SMTP id z16-20020a056358441000b001786db327d0mr4325576rwc.30.1708813562179; Sat, 24 Feb 2024 14:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708813562; cv=none; d=google.com; s=arc-20160816; b=r8goutBcG7JwNEOjBUfzXauBcNU2CxB7ekanqHfCQRVH0+G11qPpZDInSOOWELQ9Q0 WEHb+mNNpDL5CdvdAQtxeRSrEkB62Kw6ukjx7sww4jaVeUp0gx/6c4SHo801HHtQc4V0 fD7M0yUYwktMRzKJBhaVR/Z2D9VOnrwcJ0Q2FhPB4EtMJ3BbvTIy72MurnZfTg6oIOR6 F4Akllw1MzejIMSeuT1wJJwuoNIxO6FOyApQc/dJZeh6Hz+CiL00Thk75nEsI5SjEf8C FaWnsuhN8+i92tp7AbQuBVKRJKCSTl34Ul+KY8N5lUyIkgeTOTIRneTITofC99kFrgVw G/Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:dkim-signature; bh=4sIFB0oIcTyk57ENRcHD8+4f9PZLgmPyF526jjK4W7o=; fh=Zedq5pd0qyqVsmfgG+8/Y9cUOZXbXVTvFM2iZX29U/g=; b=sefTbgU6cuKBXq1ctj4c+pEhXttx7/GZowuaKs3bWlOKFOJYZOnOZ5BcgVXw9jVTIq X/1htpOYVSalruQxjd4FCvSgr8qxICIH4KOSyCu1mhxfSEO9QR+uhpTgUf3to2gYQlQa fna7A7caFqWTJnfL9MT7zcvG+AgIaGhZWBymK9SCg+ISXT37ww7mf2SlMBGPD/cBfLa6 u5zGJbHy8UdGt4anb9+C6gGVz5Mmgf+4WoKrBedBMx5eI74HcSOya9Rb6KkvCOgPPluE ZUPBHRWCbn4znYn1XIFhP8Rwky9GpiQ4nCrN3sf9/87VUizN8A2LRLg5g+d3029o0sPe zdfQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=KxY3Evwe; spf=pass (google.com: domain of pete@petertodd.org designates 103.168.172.158 as permitted sender) smtp.mailfrom=pete@petertodd.org Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com. [103.168.172.158]) by gmr-mx.google.com with ESMTPS id lp5-20020a17090b4a8500b0029933281f04si146047pjb.3.2024.02.24.14.26.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 14:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of pete@petertodd.org designates 103.168.172.158 as permitted sender) client-ip=103.168.172.158; Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 2BD34114008C; Sat, 24 Feb 2024 17:26:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 24 Feb 2024 17:26:01 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeekgdduiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgvthgv rhcuvfhougguuceophgvthgvsehpvghtvghrthhouggurdhorhhgqeenucggtffrrghtth gvrhhnpeelvdellefftddukeduffejgfefjeeuheeileeftdfgteduteeggeevueethfej tdenucffohhmrghinhepphgvthgvrhhtohguugdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvgesphgvthgvrhhtohguugdr ohhrgh X-ME-Proxy: Feedback-ID: i525146e8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 24 Feb 2024 17:26:00 -0500 (EST) Received: by localhost (Postfix, from userid 1000) id 757DA5F87E; Sat, 24 Feb 2024 22:25:56 +0000 (UTC) Date: Sat, 24 Feb 2024 22:25:56 +0000 From: Peter Todd To: Nagaev Boris Cc: bitcoindev@googlegroups.com Subject: Re: [bitcoindev] Over Half of Replace-by-Fee-Rate Replacements Are Mined Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JwyJ8CUR0pks+dDp" Content-Disposition: inline In-Reply-To: X-Original-Sender: pete@petertodd.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=KxY3Evwe; spf=pass (google.com: domain of pete@petertodd.org designates 103.168.172.158 as permitted sender) smtp.mailfrom=pete@petertodd.org Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.8 (/) --JwyJ8CUR0pks+dDp Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline On Sat, Feb 24, 2024 at 05:54:52PM -0300, Nagaev Boris wrote: > > The coefficient is a trade-off between overpaying and DoS attack cost. The > > smaller the coefficient, the more replacements that can be done: > > > > 2^10 = 1024 > > 1.5^10 = 58 > > 1.25^10 = 9.3 > > 1.1^10 = 2.6 > > Very interesting! > > To assess the number of DoS replacements, given RBFR is implemented > with coefficient K, we need to know the following two numbers, > available on mempool.space front page: > > - Purging feerate (P) > - Next block feerate (N) > > For an attacker, to cause the most number of replacements, it is > rational to first introduce a tx with fee rate just above purging > feerate and then increase its feerate by K times until it reaches next > block feerate (N). Note that next block feerate isn't actually the limit in the Libre Relay implementation. It's memoryless, and does not depend on overall mempool conditions, so you can continue to RBFR replace even beyond the next block feerate. Of course, if you do that you're spending a heck of a lot of money that could be used on a cheaper attack. > Another piece of data which would be very valuable are N and R for > historical RBF events. If K is set to median N / R, then RBFR would > cost nothing to the average legitimate user and cost something to an > attacker, which is a good thing. Absolute maximum next block fee rate historically has been <1000sat/vB; absolute minimum has been 1sat/vB. Just using those numbers for sake of conservativism is probably fine: 1.25^32 ~= 1010 1.15^50 ~= 1084 After all, you're putting up a *lot* of money for the privilege of using relatively little bandwidth at anything but relatively small fee-rates. As per my prior analysis of this topic, it's probably cheaper to just DoS attack public nodes directly, with similarish effectiveness: https://petertodd.org/2024/one-shot-replace-by-fee-rate#denial-of-service-attacks > > I picked 2x for the prototype because it's: > > > > 1) A safe default that makes DoS attacks _very_ expensive. > > 2) Low enough that the primary purpose of preventing pinning attacks still > > works. > > 3) High enough to be clearly incentive compatible for miners. > > 4) A ratio that's easy to implement with addition. > > > > The last reason is kinda funny... CFeeRate in Bitcoin Core v26.0 doesn't > > support multiplication or division operations. So I implemented the 2x ratio by > > just adding a fee-rate to itself. > > Yeah, it is funny :-) > > By the way, K=1.25 is also easy to implement using just additions: > > bool enough_increase(CFeeRate oldrate, newrate) { > auto oldx2 = oldrate + oldrate; > auto oldx5 = oldx2 + oldx2 + oldrate; > auto newx2 = newrate + newrate; > auto newx4 = newx2 + newx2; > return newx4 >= oldx5; > } lololol > Also CFeeRate supports integer multiplication, so it can be simplified as: > > bool enough_increase(CFeeRate oldrate, newrate) { > return (4 * newrate) >= (5 * oldrate); > } Check git blame: that's actually new! The v26.0 code base doesn't have that patch. Not sure if v26.1 will have it either. Of course, easy to just cherry-pick it at this point. -- https://petertodd.org 'peter'[:-1]@petertodd.org -- You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/bitcoindev/Zdps9GJ%2B59hsek3B%40petertodd.org. --JwyJ8CUR0pks+dDp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE0RcYcKRzsEwFZ3N5Lly11TVRLzcFAmXabPIACgkQLly11TVR LzeX8g/+KfPabWL6gCGZwDeNApSwTwWHt0IrjdPL6CE2PVRF6oNzwRO0wCQ37RJW 9MKuUu2IQFER+Go5XAfZKKoPZ5yYZEqTiUkQGFmRiZi7butHancuxBeiHYIzRpzW zJ+AYvzRehrSP6XBjTGC4zIUClUcmgRtbQGOHMvPLoj1RQvcBvM8RTOp3JL8e7x9 If07/FcEFZwFFSqoyGvF/9cRkLpjAOv9La++iiFwgrcry0V1mNc0GI906yNiAFP3 kvcLN70JZnGxbf020tnZ+nu4gqJpCQ5rvtcg/ATAvB6ewR6p+pDJc2LbBPmgsMRM Pixr9KEIDLRMleCCjjhJj+sua7XmZ7X9mwtrRF3lVqf+B6O9iDk8E6XnxEbbFfZQ g4asZLDkRVaQYSl/TL6qhvDpKIc2KPWF4Vj2Pw8OEsGfBGoUufIS8sNC9lkrwW3E uG3giJz+J8OYe+qidkTYBhnfN7L2FACvCfaKzs+ratEg2q7mftLbC2Uz3TLLA8gZ BABVm7QYpsXye5QNhgRKzylwCq35+yuCwbuR0MzFaHjrrJFuDnlRWI+/9zDkRtVB fKUxiHhV1d3u9XI81S8OMoCB1f+siUSK1bS3Vo1Z4K85/yL6ozM1qTDxUUQ5d5nj bAK2d29cg29FsHQhvGL5bPOToyEVUVvgJpbpOR/DC8FUjLs3WfM= =Bmgz -----END PGP SIGNATURE----- --JwyJ8CUR0pks+dDp--