Building on #10102, this adds an -ipcconnect option to bitcoin-wallet and an -ipcbind option to bitcoin-node (both enabled by default in multiprocess builds) so bitcoin node will listen on a <datadir>/sockets/node.sock unix socket, and bitcoin-wallet will connect to it.
The idea is that bitcoin-wallet can be extended in the future to have some online functionality. For example, there could be a bitcoin-wallet sync command that will update balances and sync latest transactions to an unloaded wallet, or a bitcoin-wallet serve subcommand that loads a wallet and serves RPC requests, or a bitcoin-wallet shell subcommand that allows running RPC methods interactively like the GUI console, or just general support for bitcoin-wallet <rpc method> <rpc params> invocations suggested #13926 (comment).
This PR is small and doesn't do much. The only visible change is that bitcoin-wallet now checks whether a node socket exists on startup and prints "Connected to IPC address" if it can connect it it.
The default bitcoin-wallet connect option is -ipcconnect=auto, which connects if possible as described above, and proceeds offline if not possible. Other supported options are -noipcconnect to disable ipc, -ipcconnect to require a connection and fail if it can't be established, and -ipcconnect=unix:<socket> to require a connection and use a custom socket path.
These changes require multiprocess support and this PR has no effect unless bitcoin is configured with --enable-multiprocess as described in doc/multiprocess.md
#25722 (refactor: Use util::Result class for wallet loading by ryanofsky)
#25665 (refactor: Add util::Result failure types and ability to merge result values by ryanofsky)
#24230 (indexes: Stop using node internal types and locking cs_main, improve sync logic by ryanofsky)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
LLM Linter (✨ experimental)
Possible typos and grammar issues:
rearraning parameters -> rearranging parameters [misspelled in the wallet.capnp TODO comment]
nonunix platforms -> non-Unix platforms [misspelled term in versions.md]
<sup>2026-08-18 15:10:10</sup>
DrahtBot added the label Needs rebase on Jul 11, 2020
ryanofsky force-pushed on Jul 14, 2020
ryanofsky
commented at 1:55 PM on July 14, 2020:
contributor
DrahtBot removed the label Needs rebase on Jul 14, 2020
DrahtBot added the label Needs rebase on Jul 30, 2020
ryanofsky force-pushed on Aug 12, 2020
DrahtBot removed the label Needs rebase on Aug 12, 2020
DrahtBot added the label Needs rebase on Aug 13, 2020
ryanofsky force-pushed on Aug 28, 2020
DrahtBot removed the label Needs rebase on Aug 28, 2020
DrahtBot added the label Needs rebase on Aug 31, 2020
ajtowns removed the label Docs on Sep 17, 2020
ajtowns removed the label GUI on Sep 17, 2020
ajtowns removed the label P2P on Sep 17, 2020
ajtowns removed the label RPC/REST/ZMQ on Sep 17, 2020
ajtowns removed the label Tests on Sep 17, 2020
ryanofsky force-pushed on Sep 28, 2020
DrahtBot removed the label Needs rebase on Sep 28, 2020
ryanofsky force-pushed on Oct 2, 2020
DrahtBot added the label Needs rebase on Oct 27, 2020
ryanofsky force-pushed on Nov 25, 2020
DrahtBot removed the label Needs rebase on Nov 25, 2020
DrahtBot added the label Needs rebase on Dec 2, 2020
ryanofsky force-pushed on Dec 11, 2020
DrahtBot removed the label Needs rebase on Dec 11, 2020
DrahtBot added the label Needs rebase on Dec 16, 2020
ryanofsky force-pushed on Dec 18, 2020
DrahtBot removed the label Needs rebase on Dec 18, 2020
jonasschnelli
commented at 8:02 AM on December 18, 2020:
contributor
Impressive change. Again!
Conceptual I'm not yet convinced.
My understanding is/was that bitcoin-wallet is an offline wallet exploring and manipulation tool without the requirement of a node or online connectivity.
Things that require a node, should IMO go into wallet RPC calls.
But my conceptual understanding might be old and rusty (happy to get convinced).
Things like bitcoin-wallet shell would be nice though. I guess we would just need to make sure the IPC/node option is completely optional and thus the offline functionality (for things that can work offline) is still guaranteed.
Or is this also an attempt to decouple the wallet from the node (in the long run)?
DrahtBot added the label Needs rebase on Dec 18, 2020
ryanofsky
commented at 11:34 AM on December 18, 2020:
contributor
My understanding is/was that bitcoin-wallet is an offline wallet exploring and manipulation tool without the requirement of a node or online connectivity.
To address any concern here, there's no thought of changing this. This PR gives bitcoin-wallet tool ability to do online things as well as offline things. It doesn't require a node or take away the ability to do offline things. Even if you require separate bitcoin-wallet-online-stuff and bitcoin-wallet-offline-only binaries, it only needs build changes not code changes (a new automake entry and src/init/bitcoin-wallet-offline-only.cpp stub)
Make sure to run all tests locally, according to the documentation.
The failure may happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot added the label CI failed on Jul 26, 2024
knst referenced this in commit 3411577473 on Jul 27, 2024
knst referenced this in commit a7993de34b on Aug 3, 2024
knst referenced this in commit aa2d3b8164 on Aug 7, 2024
hebasto added the label Needs CMake port on Aug 16, 2024
DrahtBot added the label Needs rebase on Aug 28, 2024
maflcko removed the label Needs CMake port on Aug 29, 2024
achow101 referenced this in commit df3f63ccfa on Sep 9, 2024
ryanofsky force-pushed on Sep 19, 2024
DrahtBot removed the label Needs rebase on Sep 19, 2024
DrahtBot added the label Needs rebase on Sep 25, 2024
ryanofsky force-pushed on Sep 26, 2024
DrahtBot removed the label Needs rebase on Sep 26, 2024
DrahtBot added the label Needs rebase on Nov 21, 2024
ryanofsky force-pushed on Dec 6, 2024
DrahtBot removed the label Needs rebase on Dec 6, 2024
DrahtBot added the label Needs rebase on Jan 29, 2025
ryanofsky force-pushed on Mar 18, 2025
ryanofsky force-pushed on Mar 19, 2025
ryanofsky
commented at 8:26 PM on March 19, 2025:
contributor
Updated 240bc4798a3c4e991e153d6660509c78323fe937 -> ce32dc3958c9e3610bd7113551a8a43396d0019d (pr/ipc-connect.42 -> pr/ipc-connect.43, compare) to fix CI failure in tool_wallet.py https://cirrus-ci.com/task/4513424845045760 where bitcoin-wallet throws an exception because the temporary directory name is too long and it causes a "Unix address path "..." exceeded maximum socket path length" error
Rebased ce32dc3958c9e3610bd7113551a8a43396d0019d -> 511f5a9be75b2e07dd45f497206b6fa844ef58a8 (pr/ipc-connect.43 -> pr/ipc-connect.44, compare) on top of updated base pr/ipc.216
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot added the label Needs rebase on Dec 4, 2025
ryanofsky force-pushed on Dec 12, 2025
DrahtBot removed the label Needs rebase on Dec 12, 2025
ryanofsky force-pushed on Dec 16, 2025
ryanofsky force-pushed on Jan 7, 2026
DrahtBot removed the label CI failed on Jan 7, 2026
DrahtBot added the label Needs rebase on Feb 4, 2026
ryanofsky force-pushed on Apr 1, 2026
DrahtBot removed the label Needs rebase on Apr 1, 2026
ajtowns
commented at 2:15 PM on April 27, 2026:
contributor
Why is this overloading daemon behaviour on an existing cli tool, instead of introducing a new binary like bitcoin-node or bitcoin-gui did? I can't see any discussion of this approach/conflict on irc or in #28978; though a [comment in #13926](/bitcoin-bitcoin/13926/#pullrequestreview-166662143) suggested bitcoind-wallet could be an option around the time that PR stole the name from multiprocess. bitcoin-walletd or bitcoin-ipc-wallet or bitcoin-wallet-ipc could also work afaics. Combining the two just seems like more work and a potential footgun for users to me.
Kino1994 referenced this in commit 31930f118b on Jun 28, 2026
BigcoinBGC referenced this in commit 76d7830689 on Jun 30, 2026
DrahtBot added the label Needs rebase on Jul 7, 2026
ab4cus referenced this in commit 5dcbdd80c0 on Jul 8, 2026
Add capnp serialization code for bitcoin types
- Add capnp ToBlob, ToArray, Wrap, Serialize, and Unserialize helper functions
- Add support for std::chrono::seconds capnp serialization
- Add support for util::Result capnp serialization
16a55c7f8a
Add capnp wrapper for Handler interface84e9b8ae2e
Add capnp wrapper for Chain interface72c2513992
multiprocess: Expose Chain interface
Expose Chain interface to external processes spawning or connecting to
bitcoin-node.
2eb914c634
ryanofsky force-pushed on Jul 14, 2026
DrahtBot removed the label Needs rebase on Jul 14, 2026
DrahtBot added the label Needs rebase on Jul 29, 2026
Merge branch 'pr/ipc-chain' into pr/ipc284352063d
test: Increase feature_block.py and feature_taproot.py timeouts
Needed because BlockConnected notifications are a lot slower with the wallet
running in separate process.
b5693414f1
test: Fix multiprocess test for unclean shutdown on kill6d7ebd20d0
util: Add util::Result workaround to be compatible with libmultiprocess
Make default constructor more generic so it doesn't only work with void types.
c99360a8d8
Squashed 'src/ipc/libmultiprocess/' changes from e8de5c7b68e..275c8eefdfb
275c8eefdfb Merge bitcoin-core/libmultiprocess#345: Remove trailing whitespace and Add -Wtrailing-whitespace to default ci config
cd7162fb832 Merge bitcoin-core/libmultiprocess#304: proxy: fix BuildList to use non-const iteration for interface types
9b136782af1 ci: Add -Wtrailing-whitespace to default config
2f4be9ec6ea refactor: Remove trailing whitespace
390b5f901f1 Merge bitcoin-core/libmultiprocess#344: test: listen_tests and connect_tests follow-ups
d6f8588d1ab proxy: fix BuildList to use non-const iteration for interface types
e18ca520f45 Merge bitcoin-core/libmultiprocess#343: test: fix race in connect_tests disconnect-deferred-failure test
c39c7850c66 doc: note construct() call in valid init interface test
b9c36c61751 test: close sockets unconditionally and check errors with KJ_SYSCALL
7eb741e6359 test: drop unnecessary KJ_EXPECT(true)
113f1d4d287 test: join server thread unconditionally in connect tests
44bc4630bc1 test: drop mp:: prefixes in connect tests
038d33eb31e test: share DefaultLogHandler between test files
b54a1633085 test: drop TestSetup socket members in connect tests
70467c5a727 test: add m_ prefix to TestSetup members in connect tests
cc260f2526f test: replace capnp fix link with upstream PR
137a6e4e039 test: fix race in connect_tests disconnect-deferred-failure test
8dab0d4bdeb Merge bitcoin-core/libmultiprocess#341: ci: add -Wextra-semi to llvm config
b3b134eed8b ci: add -Wextra-semi to llvm config
bdd0cd69418 Merge bitcoin-core/libmultiprocess#339: refactor: add `[[noreturn]]` attributes
a779a09764c ci: add -Wmissing-noreturn
636aaff576b refactor: add missing [[noreturn]] attributes
cc11c2b1b41 Merge bitcoin-core/libmultiprocess#338: test: check ReadList return value
2d6e863c77a Merge bitcoin-core/libmultiprocess#334: ci: Set CMAKE_BUILD_PARALLEL_LEVEL to enable parallelism by default
d4d10ff98ab Merge bitcoin-core/libmultiprocess#332: ci: add -Wextra-semi to default config
b540e70f25f Merge bitcoin-core/libmultiprocess#324: proxy: Name threads spawned by the event loop
e5e367e785c Merge bitcoin-core/libmultiprocess#312: util: report back child errors to parent and throw
2220df68c91 Merge bitcoin-core/libmultiprocess#298: Fix error handling when creating clients (`mp::ConnectStream`)
51defb79ef7 Merge bitcoin-core/libmultiprocess#340: ci: Update `capnproto` prerequisites on NetBSD
7e94790b08a ci: Update `capnproto` prerequisites on NetBSD
9f25ffca5b0 test: Cover OS thread names for worker, pool, and async threads
648a18589c4 proxy: Name threads spawned by the event loop
49834b2609e ci: add -Wextra-semi to default config
fae9a637e35 example: Remove unused kj/async.h include
bb473690c97 Fix error handling when creating clients
44d191420c6 Add test coverage for ConnectStream
231361ae5af Correct stale UnixListener doc comment
060c1a50d03 Extract `UnixListener` class to a dedicated file
62f25af06c3 test: check ReadList return value
ce51d737255 ci: Set CMAKE_BUILD_PARALLEL_LEVEL to enable parallism in build jobs by default
67302cd132a Merge bitcoin-core/libmultiprocess#331: Remove code for Cap'n Proto versions before 0.9
f13c64ab54e Merge bitcoin-core/libmultiprocess#330: ci: Compile with minimum supported g++ in olddeps
8e026f66252 Merge bitcoin-core/libmultiprocess#327: build: avoid unnecessary capnp-rpc dependency for mpgen
e5206e9eb5b Merge bitcoin-core/libmultiprocess#325: cmake: Remove `QUIET` option from `find_package(CapnProto ...)`
879efea2bc7 Merge bitcoin-core/libmultiprocess#321: ci: Roll NetBSD releases to 11.0, drop 9.4
abf127a3141 Merge bitcoin-core/libmultiprocess#317: ipc: Fix mpgen capnp tool path for vcpkg/Windows builds
c437d7f107e Merge bitcoin-core/libmultiprocess#310: test: cover immediate client disconnects for `ListenConnections`
31bff8a673f Merge bitcoin-core/libmultiprocess#307: refactor: memcpy -> std::ranges::copy
f355108b0a0 Merge bitcoin-core/libmultiprocess#303: type-chrono: Add CustomBuildField/CustomReadField overloads for std::chrono::time_point
2d678177c14 Merge bitcoin-core/libmultiprocess#296: ci: Bump channel to nixos-26.05
3f05b11624c util: kill and reap child on SpawnProcess error
4a56c1837a7 util: report back child error to parent and throw
a9e70dbe775 ci: Add NetBSD release 11.0
2d33b14fb0e ci: Switch to default compiler on NetBSD 9.4
36f74002775 ci: Drop NetBSD release 9.4
bd508311b56 refactor: Drop stray semicolons after function definitions
788f17a8509 Remove code for Cap'n Proto versions before 0.9
7402affd0ce ci: Pin oldeps config to older nixpkgs channel to compile older cmake with older gcc
edf63435624 ci: Compile with minimum supported g++-11 in olddeps
fa47449afe1 cmake: avoid unnecessary capnp-rpc dependency for mpgen
a494b764de5 cmake: Remove `QUIET` option from `find_package(CapnProto ...)`
26452e02d75 refactor: memcpy -> std::ranges::copy
e1dcc6eb182 Merge bitcoin-core/libmultiprocess#316: cmake: Fix stale codegen when mpgen binary changes
7a72df02e2d type-chrono: Add CustomBuildField/CustomReadField overloads for std::chrono::time_point
45b685c3f58 type-number, type-chrono: Fix static assert signed/unsigned comparisons
45f6255975d type-number: exclude bool from the integral overload
8d6d4649482 Merge bitcoin-core/libmultiprocess#315: Fix startup race in example
a6fc80d2547 Merge bitcoin-core/libmultiprocess#311: bugfix: clear FD_CLOEXEC in child instead of parent before fork
496fb84e69f test: cover immediate client disconnects for `ListenConnections`
36c6c63520e doc: Document reference-counted EventLoop lifetime
3a997e113cf Fix startup race in mpexample
f5c15ce33ff Merge bitcoin-core/libmultiprocess#323: refactor: access ThreadContext through CurrentThread(), ci: switch Bitcoin Core to master
66298c737f4 ci: Switch back to Bitcoin Core's master branch
86b48105018 refactor: access ThreadContext through CurrentThread()
eea9c64f6e1 cmake: Fix stale codegen when mpgen binary changes
a26a08496b8 cmake: Fix mpgen capnp tool path for vcpkg/Windows builds
140d9ba6ff7 test: allow custom log handler in `ListenSetup`
1e0c7ff9a51 util: Clear FD_CLOEXEC in child instead of parent before fork
8550ee6a317 util, refactor: Add ChildFail helper for post-fork child errors
17eab90b526 test: Fix typo in listen_tests.cpp
ce865a9ba86 refactor: Directly use value in CustomBuildField
3f221b5bfd7 Merge bitcoin-core/libmultiprocess#274: Add nonunix platform support
1b0f6056062 doc: Remove trailing whitespace
d8f8ca3119f ipc: Wrap mpgen main() in try-catch to print errors
fbe5a14ad46 ci: Check out bitcoin/bitcoin PR #35084 instead of master
39d3690d83d types: Replace SFINAE with requires clauses to avoid MSVC C2039 error
ba68520203c proxy, refactor: Fix C4305 truncation warning in Accessor on MSVC
1d81d47811e util, refactor: Fix PtrOrValue constructor for move-only types on MSVC
b883fe1e527 proxy: Fix shutdownWrite() exception handling on macOS with dynamic libraries
0012411ccc6 proxy: Call shutdownWrite() in Connection destructor
38312ad1912 proxy, refactor: Change ConnectStream and ServeStream to accept stream objects
e96d5d742ab proxy, refactor: Replace EventLoop wakeup fd integers with KJ stream objects
db4f9a3d739 cmake: Bump minimum required Cap'n Proto version to 0.9
652934fb793 util, refactor: Add SocketPair() and use it in SpawnProcess
1c6ef7a26c0 util, refactor: Do not fork() and exec() separately
1389cf3132f util, refactor: Add SpawnConnectInfo type alias and use it
c7ca1f00b62 util, refactor: Add SocketId type alias and use it
be46a35203c util, refactor: Add ProcessId type alias and use it
91a78db7808 doc: Bump version 13 > 14
fa2c56ec27f ci: Bump channel to nixos-26.05
git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 275c8eefdfb256acda1c3ad5a250ecafa3d2f1be
Add tests pinning down when a callback object (and any state it owns)
is destroyed. Currently disconnect() only disables the callback: the
object stays alive until a later connect() call on the same signal
garbage collects it and every connection handle referencing it has been
released; with no connection handle held it lives until the signal
itself is destroyed.
This differs from boost::signals2, which btcsignals aims to be
api-compatible with: there, disconnecting destroys the slot's function
object as soon as no emission is using it.
No behavior change; these tests document the status quo so the next
commit changing the destruction timing has a clear before/after diff.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ae67ee61ab
Merge commit 'f7e3b453e4d3e9594cc7c08929e36f0442be45a0' into pr/subtree-1431f8fab184
btcsignals: destroy callbacks eagerly on disconnect
Previously a disconnected callback and any state it owned could stay
alive indefinitely: destruction required both a later connect() call on
the same signal to garbage collect it and release of every connection
handle referencing it. That made destruction timing unpredictable for
callbacks that own resources whose release has side effects, and it
diverges from boost::signals2, which destroys a disconnected slot's
function object as soon as no emission is running it. (The concrete
fallout was in multiprocess bitcoin-gui, where node notification
callbacks own IPC proxy objects: their deferred destruction kept
bitcoin-node from exiting and hung interface_gui.py until timeout.)
Make disconnect() destroy the callback, deferring only while a
concurrent emission is mid-call into it, matching boost::signals2
semantics. The previous commit's characterization tests are updated;
their diff shows the ownership change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f05754a5b1
build: suppress -Wc++23-lambda-attributes in warn_interface
Lambda [[noreturn]] attributes before the parameter list are a C++23
extension intentionally used in C++20 builds (needed for compatibility
with -Wmissing-noreturn). Suppress the extension warning rather than
removing the attributes or working around them.
Uses the existing IF_CHECK_PASSED idiom so GCC, which silently ignores
unknown -Wno-* flags, is unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
05ddcb1e1a
btcsignals: fall back to atomic_load/store without __cpp_lib_atomic_shared_ptr
std::atomic<shared_ptr<T>> is a C++20 library feature, but library
implementations are not required to ship all C++20 features at once;
__cpp_lib_atomic_shared_ptr is the feature-test macro that indicates its
presence. Without it, the generic std::atomic<T> requires trivially copyable
T — shared_ptr is not, causing build failures on macOS (Xcode 16.2),
FreeBSD 15.1, and the MSan/TSan custom libc++ builds in CI.
Fall back to the C++14 atomic_load/atomic_store free functions, which are
specifically overloaded for shared_ptr. The fallback is intended to be
temporary: those functions are deprecated in C++20 and will eventually be
removed, so the #else branch can be dropped once all CI platforms carry the
C++20 specialization.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6572239bb4
multiprocess: Add capnp serialization code for bitcoin types9f1dab87ff
interfaces, refactor: Change WalletLoader::restoreWallet parameter order
Libmultiprocess requires output parameters to be ordered after input parameter,
so move warnings parameter last. Problematic order was introduced in
4ec2d18a0734f44c0a74f05b59ad1269d323dfdb from
https://github.com/bitcoin-core/gui/pull/877
906254e0b6
multiprocess: Add capnp wrapper for Wallet interface90275ad54d
multiprocess: Add capnp wrapper for Node interface0a8a50ca9e
multiprocess: Make bitcoin-gui spawn a bitcoin-node process
Spawn node subprocess instead of running node code internally
1e95e889fe
multiprocess: Make bitcoin-node spawn a bitcoin-wallet process
Spawn wallet subprocess instead of running wallet code internally
f7723e6fdc
multiprocess: Add debug.log .wallet/.gui suffixes
Add .wallet/.gui suffixes to log files created by bitcoin-gui and
bitcoin-wallet processes so they don't clash with bitcoin-node log file.
cb3d099961
doc: Multiprocess misc doc and comment updates31aadbe43b
Add `-ipcconnect` option to `bitcoin-wallet` to allow connecting to a bitcoin
node process over IPC. The `bitcoin-wallet` tool doesn't really do anything with its
connection to the node yet, but it could potentially run or serve RPCs that
require being online.
Example usage:
src/bitcoin-node -regtest -debug -ipcbind=unix
src/bitcoin-wallet -regtest -ipcconnect=unix info
a8ea190f46
test-each-commit: Increase fetch depth
Needed due to base PR, can be dropped before merge
9a8e51ae73
ryanofsky force-pushed on Aug 18, 2026
DrahtBot removed the label Needs rebase on Aug 18, 2026
Kino1994 referenced this in commit 17443e59e2 on Aug 19, 2026
DrahtBot added the label Needs rebase on Aug 21, 2026
DrahtBot
commented at 8:44 AM on August 21, 2026:
contributor
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-08-21 14:54 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me