Skip to content

Commit 5a1aad3

Browse files
Sjorsccdle12
andcommitted
Add sv2 noise protocol
Also introduce libbitcoin_sv2. Co-Authored-By: Christopher Coverdale <[email protected]>
1 parent 5dba5f5 commit 5a1aad3

File tree

11 files changed

+1176
-1
lines changed

11 files changed

+1176
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ if(ENABLE_IPC AND WITH_EXTERNAL_LIBMULTIPROCESS)
150150
)
151151
endif()
152152

153+
option(WITH_SV2 "Enable Stratum v2 functionality." ON)
154+
153155
cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF)
154156
if(BUILD_GUI)
155157
set(qt_components Core Gui Widgets LinguistTools)
@@ -686,6 +688,7 @@ message(" IPC ................................. ${ipc_status}")
686688
message(" USDT tracing ........................ ${WITH_USDT}")
687689
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
688690
message(" DBus (GUI) .......................... ${WITH_DBUS}")
691+
message(" Stratum v2 .......................... ${WITH_SV2}")
689692
message("Tests:")
690693
message(" test_bitcoin ........................ ${BUILD_TESTS}")
691694
message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")

doc/design/libraries.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
| *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. |
1515
| *libbitcoin_wallet_tool* | Lower-level wallet functionality used by *bitcoin-wallet* executable. |
1616
| *libbitcoin_zmq* | [ZeroMQ](../zmq.md) functionality used by *bitcoind* and *bitcoin-qt* executables. |
17+
| *libbitcoin_sv2* | Stratum v2 functionality (usage TBD) |
1718

1819
## Conventions
1920

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ add_subdirectory(util)
103103
if(ENABLE_IPC)
104104
add_subdirectory(ipc)
105105
endif()
106+
if(WITH_SV2)
107+
add_subdirectory(sv2)
108+
endif()
106109

107110
add_library(bitcoin_consensus STATIC EXCLUDE_FROM_ALL
108111
arith_uint256.cpp

src/pubkey.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ struct EllSwiftPubKey
319319
/** Construct a new ellswift public key from a given serialization. */
320320
EllSwiftPubKey(std::span<const std::byte> ellswift) noexcept;
321321

322-
/** Decode to normal compressed CPubKey (for debugging purposes). */
322+
/** Decode to normal compressed CPubKey. */
323323
CPubKey Decode() const;
324324

325325
// Read-only access for serialization.

src/sv2/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2024-present The Bitcoin Core developers
2+
# Distributed under the MIT software license, see the accompanying
3+
# file COPYING or https://opensource.org/license/mit/.
4+
5+
add_library(bitcoin_sv2 STATIC EXCLUDE_FROM_ALL
6+
noise.cpp
7+
)
8+
9+
target_link_libraries(bitcoin_sv2
10+
PRIVATE
11+
core_interface
12+
bitcoin_clientversion
13+
bitcoin_crypto
14+
$<$<PLATFORM_ID:Windows>:ws2_32>
15+
)

0 commit comments

Comments
 (0)