From 2fe3687899b477dc1214c22b9967cdce3f69a3db Mon Sep 17 00:00:00 2001 From: jrakibi Date: Tue, 25 Feb 2025 00:30:31 +0700 Subject: [PATCH] Policy: Relax MIN_STANDARD_TX_NONWITNESS_SIZE to 65 Align with Bitcoin Core's policy by reducing the minimum non-witness transaction size from 82 to 65 bytes. This change allows for more minimal transaction cases (e.g., 1 input with 1 OP_RETURN output), while still maintaining protection against CVE-2017-12842. Matches bitcoin/bitcoin#26398 --- bitcoin/src/policy.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/policy.rs b/bitcoin/src/policy.rs index ca1bacb0d..96b77bbab 100644 --- a/bitcoin/src/policy.rs +++ b/bitcoin/src/policy.rs @@ -18,8 +18,8 @@ use super::constants::{MAX_BLOCK_SIGOPS_COST, WITNESS_SCALE_FACTOR}; /// Maximum weight of a transaction for it to be relayed by most nodes on the network pub const MAX_STANDARD_TX_WEIGHT: u32 = 400_000; -/// Minimum non-witness size for a standard transaction (1 SegWit input + 1 P2WPKH output = 82 bytes) -pub const MIN_STANDARD_TX_NONWITNESS_SIZE: u32 = 82; +/// Minimum non-witness size for a standard transaction, set to 65 bytes. +pub const MIN_STANDARD_TX_NONWITNESS_SIZE: u32 = 65; /// Maximum number of sigops in a standard tx. pub const MAX_STANDARD_TX_SIGOPS_COST: u32 = MAX_BLOCK_SIGOPS_COST as u32 / 5;