From ca1d1f5bdbf0bc4fdd2afcb91836cb1a7bd2b8a4 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sat, 15 Aug 2026 21:53:11 -0400 Subject: [PATCH 1/6] Rename services config to provided and required. --- src/parser.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 38cd5c21..f7d9e3d3 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -63,9 +63,9 @@ parser::parser(system::chain::selection context, configured.network.protocol_minimum = level::headers_protocol; configured.network.protocol_maximum = level::bip130; - // services_minimum must be node_witness to be a witness node. - configured.network.services_minimum = service::node_network | service::node_witness; - configured.network.services_maximum = service::node_network | service::node_witness; + // services_provided must include node_witness to be a witness node. + configured.network.services_required = service::node_network | service::node_witness; + configured.network.services_provided = service::node_network | service::node_witness; // TODO: from bitcoind, revert to defaults when seeds are up. configured.network.outbound.seeds.clear(); @@ -584,14 +584,14 @@ options_metadata parser::load_settings() THROWS "The minimum network protocol version, defaults to '31800'." ) ( - "peer.services_maximum", - value(&configured.network.services_maximum), - "The maximum services exposed by network connections, defaults to '9' (full node, witness)." + "peer.services_provided", + value(&configured.network.services_provided), + "The services provided to network connections, defaults to '9' (full node, witness)." ) ( - "peer.services_minimum", - value(&configured.network.services_minimum), - "The minimum services exposed by network connections, defaults to '9' (full node, witness)." + "peer.services_required", + value(&configured.network.services_required), + "The services required of outbound network connections, defaults to '9' (full node, witness)." ) ( "peer.invalid_services", From 9b55672964a02f9890a70c94a290455df6c39e1a Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sat, 15 Aug 2026 23:11:06 -0400 Subject: [PATCH 2/6] Parse privacy and node service configuration settings. --- src/parser.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/parser.cpp b/src/parser.cpp index f7d9e3d3..3aa55efa 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -593,6 +593,11 @@ options_metadata parser::load_settings() THROWS value(&configured.network.services_required), "The services required of outbound network connections, defaults to '9' (full node, witness)." ) + ( + "peer.privacy", + value(&configured.network.privacy), + "Enable opportunistic connection encryption, defaults to false." + ) ( "peer.invalid_services", value(&configured.network.invalid_services), @@ -1487,6 +1492,36 @@ options_metadata parser::load_settings() THROWS value(&configured.node.delay_inbound), "Delay accepting inbound connections until node is current, defaults to 'true'." ) + ( + "node.provide_blocks", + value(&configured.node.provide_blocks), + "Serve blocks to network connections, defaults to 'true'." + ) + ( + "node.limited_blocks", + value(&configured.node.limited_blocks), + "Limit block service to recent blocks, defaults to 'false'." + ) + ( + "node.require_blocks", + value(&configured.node.require_blocks), + "Require block service of outbound connections, defaults to 'true'." + ) + ( + "node.provide_witness", + value(&configured.node.provide_witness), + "Serve witness data to network connections, defaults to 'true'." + ) + ( + "node.require_witness", + value(&configured.node.require_witness), + "Require witness service of outbound connections, defaults to 'true'." + ) + ( + "node.provide_filters", + value(&configured.node.provide_filters), + "Serve client filters to network connections, defaults to 'false'." + ) ( "node.batch_signatures", value(&configured.node.batch_signatures), From 0de930cf15c490a766ac0bf61b1bd302591763a8 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sat, 15 Aug 2026 23:11:29 -0400 Subject: [PATCH 3/6] Regenerate artifacts. --- builds/cmake/install-cmake.sh | 1 + builds/cmake/install-presets.sh | 1 + builds/gnu/install-gnu.sh | 1 + include/bitcoin/server.hpp | 2 ++ 4 files changed, 5 insertions(+) diff --git a/builds/cmake/install-cmake.sh b/builds/cmake/install-cmake.sh index ebabaeb6..ef73e638 100755 --- a/builds/cmake/install-cmake.sh +++ b/builds/cmake/install-cmake.sh @@ -463,6 +463,7 @@ main() secp256k1_OPTIONS=( "-DSECP256K1_BUILD_TESTS=OFF" "-DSECP256K1_EXPERIMENTAL=ON" + "-DSECP256K1_ENABLE_MODULE_ELLSWIFT=ON" "-DSECP256K1_ENABLE_MODULE_RECOVERY=ON" "-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON") diff --git a/builds/cmake/install-presets.sh b/builds/cmake/install-presets.sh index 9d13b9cc..ac7bf6a5 100755 --- a/builds/cmake/install-presets.sh +++ b/builds/cmake/install-presets.sh @@ -479,6 +479,7 @@ main() secp256k1_OPTIONS=( "-DSECP256K1_BUILD_TESTS=OFF" "-DSECP256K1_EXPERIMENTAL=ON" + "-DSECP256K1_ENABLE_MODULE_ELLSWIFT=ON" "-DSECP256K1_ENABLE_MODULE_RECOVERY=ON" "-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON") diff --git a/builds/gnu/install-gnu.sh b/builds/gnu/install-gnu.sh index 75fb7ecc..6958182f 100755 --- a/builds/gnu/install-gnu.sh +++ b/builds/gnu/install-gnu.sh @@ -491,6 +491,7 @@ main() secp256k1_OPTIONS=( "--disable-tests" "--enable-experimental" + "--enable-module-ellswift" "--enable-module-recovery" "--enable-module-schnorrsig") diff --git a/include/bitcoin/server.hpp b/include/bitcoin/server.hpp index c356dc69..2be1321c 100644 --- a/include/bitcoin/server.hpp +++ b/include/bitcoin/server.hpp @@ -50,7 +50,9 @@ #include #include #include +#include #include +#include #include #include #include From c11d3981e9c6ef1e4924089d58e29231b3713d46 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 16 Aug 2026 01:20:45 -0400 Subject: [PATCH 4/6] Replace network services settings with node settings. --- src/parser.cpp | 14 -------------- .../bitcoind/protocol_bitcoind_blockchain.cpp | 2 +- src/protocols/bitcoind/protocol_bitcoind_rest.cpp | 2 +- src/protocols/btcd/protocol_btcd_utility.cpp | 2 +- .../native/protocol_native_configuration.cpp | 4 ++-- 5 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 3aa55efa..e95ac034 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -63,10 +63,6 @@ parser::parser(system::chain::selection context, configured.network.protocol_minimum = level::headers_protocol; configured.network.protocol_maximum = level::bip130; - // services_provided must include node_witness to be a witness node. - configured.network.services_required = service::node_network | service::node_witness; - configured.network.services_provided = service::node_network | service::node_witness; - // TODO: from bitcoind, revert to defaults when seeds are up. configured.network.outbound.seeds.clear(); configured.network.outbound.seeds.emplace_back("seed.bitcoin.sipa.be", 8333_u16); @@ -583,16 +579,6 @@ options_metadata parser::load_settings() THROWS value(&configured.network.protocol_minimum), "The minimum network protocol version, defaults to '31800'." ) - ( - "peer.services_provided", - value(&configured.network.services_provided), - "The services provided to network connections, defaults to '9' (full node, witness)." - ) - ( - "peer.services_required", - value(&configured.network.services_required), - "The services required of outbound network connections, defaults to '9' (full node, witness)." - ) ( "peer.privacy", value(&configured.network.privacy), diff --git a/src/protocols/bitcoind/protocol_bitcoind_blockchain.cpp b/src/protocols/bitcoind/protocol_bitcoind_blockchain.cpp index 5081b599..c3ab340b 100644 --- a/src/protocols/bitcoind/protocol_bitcoind_blockchain.cpp +++ b/src/protocols/bitcoind/protocol_bitcoind_blockchain.cpp @@ -180,7 +180,7 @@ bool protocol_bitcoind_blockchain::handle_get_block_chain_info(const code& ec, return false; object_t out{}; - if (!chain_info(out, archive(), network_settings().pruned_node(), + if (!chain_info(out, archive(), node_settings().limited_blocks, is_current_chain(true))) { send_error(database::error::integrity); diff --git a/src/protocols/bitcoind/protocol_bitcoind_rest.cpp b/src/protocols/bitcoind/protocol_bitcoind_rest.cpp index 0e4e09e9..02105c32 100644 --- a/src/protocols/bitcoind/protocol_bitcoind_rest.cpp +++ b/src/protocols/bitcoind/protocol_bitcoind_rest.cpp @@ -574,7 +574,7 @@ bool protocol_bitcoind_rest::handle_get_chain_information(const code& ec, { "difficulty", header->difficulty() }, { "time", header->timestamp() }, { "mediantime", median_time_past(query, link) }, - { "pruned", network_settings().pruned_node() } + { "pruned", node_settings().limited_blocks } }, 256); return true; } diff --git a/src/protocols/btcd/protocol_btcd_utility.cpp b/src/protocols/btcd/protocol_btcd_utility.cpp index 5681c5b6..2af9c2de 100644 --- a/src/protocols/btcd/protocol_btcd_utility.cpp +++ b/src/protocols/btcd/protocol_btcd_utility.cpp @@ -65,7 +65,7 @@ bool protocol_btcd::handle_get_block_chain_info(const code& ec, return false; object_t out{}; - if (!chain_info(out, archive(), network_settings().pruned_node(), + if (!chain_info(out, archive(), node_settings().limited_blocks, is_current_chain(true))) { send_error(database::error::integrity); diff --git a/src/protocols/native/protocol_native_configuration.cpp b/src/protocols/native/protocol_native_configuration.cpp index 305997e5..0baec6b4 100644 --- a/src/protocols/native/protocol_native_configuration.cpp +++ b/src/protocols/native/protocol_native_configuration.cpp @@ -48,7 +48,7 @@ bool protocol_native::handle_get_configuration(const code& ec, { "address", archive().address_enabled() }, { "filter", archive().filter_enabled() }, { "turbo", database_settings().turbo }, - { "witness", network_settings().witness_node() }, + { "witness", node_settings().require_witness }, { "retarget", system_settings().forks.retarget }, { "difficult", system_settings().forks.difficult }, { "pruned", get_pruned_height() }, @@ -61,7 +61,7 @@ bool protocol_native::handle_get_configuration(const code& ec, size_t protocol_native::get_pruned_height() NOEXCEPT { - if (!network_settings().pruned_node()) + if (!node_settings().limited_blocks) return {}; const auto& system_ = system_settings(); From cf605f15e4ecb8cf4982c35108d9b1af36356e0d Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 16 Aug 2026 02:23:06 -0400 Subject: [PATCH 5/6] Don't preserve failed (over limit) subscription. --- .../electrum/protocol_electrum_subscribe.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/protocols/electrum/protocol_electrum_subscribe.cpp b/src/protocols/electrum/protocol_electrum_subscribe.cpp index 40923b13..fdd2f9ca 100644 --- a/src/protocols/electrum/protocol_electrum_subscribe.cpp +++ b/src/protocols/electrum/protocol_electrum_subscribe.cpp @@ -95,9 +95,15 @@ void protocol_electrum::do_scripthash_subscribe(const hash_digest& hash, // Initial subscription is limited by configured maximum history. const auto limit = at.second ? options().maximum_history : max_size_t; - ec = get_scripthash_history(at.first->second, at.first->first, limit); - status = at.first->second.status; - subscribed_address_.store(true, relaxed); + if ((ec = get_scripthash_history(at.first->second, at.first->first, limit))) + { + if (at.second) address_subscriptions_.erase(at.first); + } + else + { + status = at.first->second.status; + subscribed_address_.store(true, relaxed); + } } POST(complete_scripthash_subscribe, ec, std::move(status)); From e7594cade0440fb810aded6c22fce330e17b8163 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 16 Aug 2026 02:37:49 -0400 Subject: [PATCH 6/6] rename peer.privacy to .enable_privacy. --- src/parser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index e95ac034..97507b3e 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -579,11 +579,6 @@ options_metadata parser::load_settings() THROWS value(&configured.network.protocol_minimum), "The minimum network protocol version, defaults to '31800'." ) - ( - "peer.privacy", - value(&configured.network.privacy), - "Enable opportunistic connection encryption, defaults to false." - ) ( "peer.invalid_services", value(&configured.network.invalid_services), @@ -624,6 +619,11 @@ options_metadata parser::load_settings() THROWS value(&configured.network.enable_relay), "Enable transaction relay, defaults to 'true'." ) + ( + "peer.enable_privacy", + value(&configured.network.enable_privacy), + "Enable opportunistic connection encryption, defaults to 'false'." + ) ( "peer.validate_checksum", value(&configured.network.validate_checksum),