Understanding the Bitcoin Wallet Code

2 replies 224 views
alt_g4ngMember
Posts: 0 · Reputation: 106
#1Sep 14, 2025, 01:10 PM
hey, check out line 103 in src/bitcoin-wallet.cpp in the latest branch: std::unique_ptr<interfaces::Init> init = interfaces::MakeWalletInit(argc, argv, exit_status); if (!init) { return exit_status; } this seems to deal with wallet initialization but I can't find any real details on interfaces::MakeWalletInit, only this in src/init/bitcoin-wallet.cpp: namespace interfaces { std::unique_ptr<Init> MakeWalletInit(int argc, char* argv[], int& exit_status) { return std::make_unique<Init>(); } } // namespace interfaces but that just returns a root Init, like what gives?
5 Reply Quote Share
0xNodeMember
Posts: 257 · Reputation: 80
#2Sep 14, 2025, 02:50 PM
I think this ties into the process separation project. Might be worth checking out those GitHub links: https://github.com/bitcoin/bitcoin/pull/23006 and https://github.com/orgs/bitcoin/projects/8/views/1. Not sure if it's being utilized yet but could be. Someone who's more in the loop could clarify. If you're not familiar, the project has more info here: https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Process-Separation and here’s another link on multiprocess stuff: https://github.com/ryanofsky/bitcoin/blob/ipc-export/doc/multiprocess.md#next-steps.
1 Reply Quote Share
m1kes4tFull Member
Posts: 43 · Reputation: 252
#3Sep 14, 2025, 04:15 PM
if I remember right, MakeWalletInit is kinda dynamic. it changes based on how Bitcoin is compiled. like, if the wallet is enabled or not. it’s not a strict function call, more of an interface that manages what’s needed from the wallet. maybe this was done to keep Bitcoin scalable and adaptable for future upgrades? just a guess though.
1 Reply Quote Share

Related topics