Skip to content

Commit 252fd15

Browse files
author
MarcoFalke
committed
Merge #13926: [Tools] bitcoin-wallet - a tool for creating and managing wallets offline
3c3e31c [tests] Add wallet-tool test (João Barbosa) 49d2374 [tools] Add wallet inspection and modification tool (Jonas Schnelli) Pull request description: Adds an offline tool `bitcoin-wallet-tool` for wallet creation and maintenance. Currently this tool can create a new wallet file, display information on an existing wallet, and run the salvage and zapwallettxes maintenance tasks on an existing wallet. It can later be extended to support other common wallet maintenance tasks. Doing wallet maintenance tasks in an offline tool makes much more sense (and is potentially safer) than having to spin up a full node. Tree-SHA512: 75a28b8a58858d9d76c7532db40eacdefc5714ea5aab536fb1dc9756e2f7d750d69d68d59c50a68e633ce38fb5b8c3e3d4880db30fe01561e07ce58d42bceb2b
2 parents 4d661ba + 3c3e31c commit 252fd15

File tree

18 files changed

+864
-11
lines changed

18 files changed

+864
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ src/bitcoin
55
src/bitcoind
66
src/bitcoin-cli
77
src/bitcoin-tx
8+
src/bitcoin-wallet
89
src/test/test_bitcoin
910
src/test/test_bitcoin_fuzzy
1011
src/qt/test/test_bitcoin-qt
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Label="configInitTarget" Project="..\common.init.vcxproj" />
4+
<ItemGroup Label="ProjectConfigurations">
5+
<ProjectConfiguration Include="Debug|Win32">
6+
<Configuration>Debug</Configuration>
7+
<Platform>Win32</Platform>
8+
</ProjectConfiguration>
9+
<ProjectConfiguration Include="Release|Win32">
10+
<Configuration>Release</Configuration>
11+
<Platform>Win32</Platform>
12+
</ProjectConfiguration>
13+
<ProjectConfiguration Include="Debug|x64">
14+
<Configuration>Debug</Configuration>
15+
<Platform>x64</Platform>
16+
</ProjectConfiguration>
17+
<ProjectConfiguration Include="Release|x64">
18+
<Configuration>Release</Configuration>
19+
<Platform>x64</Platform>
20+
</ProjectConfiguration>
21+
</ItemGroup>
22+
<ItemGroup>
23+
<ClCompile Include="..\..\src\bitcoin-wallet.cpp" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<ProjectReference Include="..\libbitcoinconsensus\libbitcoinconsensus.vcxproj">
27+
<Project>{2b384fa8-9ee1-4544-93cb-0d733c25e8ce}</Project>
28+
</ProjectReference>
29+
<ProjectReference Include="..\libbitcoin_cli\libbitcoin_cli.vcxproj">
30+
<Project>{0667528c-d734-4009-adf9-c0d6c4a5a5a6}</Project>
31+
</ProjectReference>
32+
<ProjectReference Include="..\libbitcoin_common\libbitcoin_common.vcxproj">
33+
<Project>{7c87e378-df58-482e-aa2f-1bc129bc19ce}</Project>
34+
</ProjectReference>
35+
<ProjectReference Include="..\libbitcoin_crypto\libbitcoin_crypto.vcxproj">
36+
<Project>{6190199c-6cf4-4dad-bfbd-93fa72a760c1}</Project>
37+
</ProjectReference>
38+
<ProjectReference Include="..\libbitcoin_server\libbitcoin_server.vcxproj">
39+
<Project>{460fee33-1fe1-483f-b3bf-931ff8e969a5}</Project>
40+
</ProjectReference>
41+
<ProjectReference Include="..\libbitcoin_util\libbitcoin_util.vcxproj">
42+
<Project>{b53a5535-ee9d-4c6f-9a26-f79ee3bc3754}</Project>
43+
</ProjectReference>
44+
<ProjectReference Include="..\libbitcoin_wallet\libbitcoin_wallet.vcxproj">
45+
<Project>{93b86837-b543-48a5-a89b-7c87abb77df2}</Project>
46+
</ProjectReference>
47+
<ProjectReference Include="..\libbitcoin_zmq\libbitcoin_zmq.vcxproj">
48+
<Project>{792d487f-f14c-49fc-a9de-3fc150f31c3f}</Project>
49+
</ProjectReference>
50+
<ProjectReference Include="..\libunivalue\libunivalue.vcxproj">
51+
<Project>{5724ba7d-a09a-4ba8-800b-c4c1561b3d69}</Project>
52+
</ProjectReference>
53+
<ProjectReference Include="..\libbitcoin_wallet_tool\libbitcoin_wallet_tool.vcxproj">
54+
<Project>{f91ac55e-6f5e-4c58-9ac5-b40db7deef93}</Project>
55+
</ProjectReference>
56+
</ItemGroup>
57+
<PropertyGroup Label="Globals">
58+
<VCProjectVersion>15.0</VCProjectVersion>
59+
<ProjectGuid>{84DE8790-EDE3-4483-81AC-C32F15E861F4}</ProjectGuid>
60+
<Keyword>Win32Proj</Keyword>
61+
<RootNamespace>bitcointx</RootNamespace>
62+
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-static</VcpkgTriplet>
63+
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-static</VcpkgTriplet>
64+
</PropertyGroup>
65+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
66+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
67+
<ConfigurationType>Application</ConfigurationType>
68+
<UseDebugLibraries>true</UseDebugLibraries>
69+
<PlatformToolset>v141</PlatformToolset>
70+
<CharacterSet>Unicode</CharacterSet>
71+
</PropertyGroup>
72+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
73+
<ConfigurationType>Application</ConfigurationType>
74+
<UseDebugLibraries>false</UseDebugLibraries>
75+
<PlatformToolset>v141</PlatformToolset>
76+
<WholeProgramOptimization>true</WholeProgramOptimization>
77+
<CharacterSet>Unicode</CharacterSet>
78+
</PropertyGroup>
79+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
80+
<ConfigurationType>Application</ConfigurationType>
81+
<UseDebugLibraries>true</UseDebugLibraries>
82+
<PlatformToolset>v141</PlatformToolset>
83+
<CharacterSet>Unicode</CharacterSet>
84+
</PropertyGroup>
85+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
86+
<ConfigurationType>Application</ConfigurationType>
87+
<UseDebugLibraries>false</UseDebugLibraries>
88+
<PlatformToolset>v141</PlatformToolset>
89+
<WholeProgramOptimization>true</WholeProgramOptimization>
90+
<CharacterSet>Unicode</CharacterSet>
91+
</PropertyGroup>
92+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
93+
<ImportGroup Label="ExtensionSettings">
94+
</ImportGroup>
95+
<ImportGroup Label="Shared">
96+
</ImportGroup>
97+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
98+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
99+
</ImportGroup>
100+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
101+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
102+
</ImportGroup>
103+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
104+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
105+
</ImportGroup>
106+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
107+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
108+
</ImportGroup>
109+
<PropertyGroup Label="UserMacros" />
110+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
111+
<LinkIncremental>false</LinkIncremental>
112+
</PropertyGroup>
113+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
114+
<LinkIncremental>true</LinkIncremental>
115+
</PropertyGroup>
116+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
117+
<LinkIncremental>true</LinkIncremental>
118+
</PropertyGroup>
119+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
120+
<LinkIncremental>false</LinkIncremental>
121+
</PropertyGroup>
122+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
123+
<ClCompile>
124+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
125+
<WarningLevel>Level3</WarningLevel>
126+
<Optimization>MaxSpeed</Optimization>
127+
<FunctionLevelLinking>true</FunctionLevelLinking>
128+
<IntrinsicFunctions>true</IntrinsicFunctions>
129+
<PreprocessorDefinitions>HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
130+
<SDLCheck>true</SDLCheck>
131+
<AdditionalIncludeDirectories>..\..\src;..\..\src\univalue\include;</AdditionalIncludeDirectories>
132+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
133+
</ClCompile>
134+
<Link>
135+
<SubSystem>Console</SubSystem>
136+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
137+
<OptimizeReferences>true</OptimizeReferences>
138+
<GenerateDebugInformation>true</GenerateDebugInformation>
139+
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
140+
</Link>
141+
</ItemDefinitionGroup>
142+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
143+
<ClCompile>
144+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
145+
<WarningLevel>Level3</WarningLevel>
146+
<Optimization>Disabled</Optimization>
147+
<PreprocessorDefinitions>HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
148+
<SDLCheck>true</SDLCheck>
149+
<AdditionalIncludeDirectories>..\..\src;..\..\src\univalue\include;</AdditionalIncludeDirectories>
150+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
151+
</ClCompile>
152+
<Link>
153+
<SubSystem>Console</SubSystem>
154+
<GenerateDebugInformation>true</GenerateDebugInformation>
155+
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
156+
</Link>
157+
</ItemDefinitionGroup>
158+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
159+
<ClCompile>
160+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
161+
<WarningLevel>Level3</WarningLevel>
162+
<Optimization>Disabled</Optimization>
163+
<PreprocessorDefinitions>HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
164+
<SDLCheck>true</SDLCheck>
165+
<AdditionalIncludeDirectories>..\..\src;..\..\src\univalue\include;</AdditionalIncludeDirectories>
166+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
167+
</ClCompile>
168+
<Link>
169+
<SubSystem>Console</SubSystem>
170+
<GenerateDebugInformation>true</GenerateDebugInformation>
171+
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
172+
</Link>
173+
</ItemDefinitionGroup>
174+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
175+
<ClCompile>
176+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
177+
<WarningLevel>Level3</WarningLevel>
178+
<Optimization>MaxSpeed</Optimization>
179+
<FunctionLevelLinking>true</FunctionLevelLinking>
180+
<IntrinsicFunctions>true</IntrinsicFunctions>
181+
<PreprocessorDefinitions>HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
182+
<SDLCheck>true</SDLCheck>
183+
<AdditionalIncludeDirectories>..\..\src;..\..\src\univalue\include;</AdditionalIncludeDirectories>
184+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
185+
</ClCompile>
186+
<Link>
187+
<SubSystem>Console</SubSystem>
188+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
189+
<OptimizeReferences>true</OptimizeReferences>
190+
<GenerateDebugInformation>true</GenerateDebugInformation>
191+
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
192+
</Link>
193+
</ItemDefinitionGroup>
194+
<Import Label="configTarget" Project="..\common.vcxproj" />
195+
</Project>

build_msvc/bitcoin.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bench_bitcoin", "bench_bitc
3232
EndProject
3333
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-tx", "bitcoin-tx\bitcoin-tx.vcxproj", "{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}"
3434
EndProject
35+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-wallet", "bitcoin-wallet\bitcoin-wallet.vcxproj", "{84DE8790-EDE3-4483-81AC-C32F15E861F4}"
36+
EndProject
37+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_wallet_tool", "libbitcoin_wallet_tool\libbitcoin_wallet_tool.vcxproj", "{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}"
38+
EndProject
3539
Global
3640
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3741
Debug|x64 = Debug|x64
@@ -160,6 +164,22 @@ Global
160164
{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Release|x64.Build.0 = Release|x64
161165
{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Release|x86.ActiveCfg = Release|Win32
162166
{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Release|x86.Build.0 = Release|Win32
167+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Debug|x64.ActiveCfg = Debug|x64
168+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Debug|x64.Build.0 = Debug|x64
169+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Debug|x86.ActiveCfg = Debug|Win32
170+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Debug|x86.Build.0 = Debug|Win32
171+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Release|x64.ActiveCfg = Release|x64
172+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Release|x64.Build.0 = Release|x64
173+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Release|x86.ActiveCfg = Release|Win32
174+
{84DE8790-EDE3-4483-81AC-C32F15E861F4}.Release|x86.Build.0 = Release|Win32
175+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Debug|x64.ActiveCfg = Debug|x64
176+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Debug|x64.Build.0 = Debug|x64
177+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Debug|x86.ActiveCfg = Debug|Win32
178+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Debug|x86.Build.0 = Debug|Win32
179+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Release|x64.ActiveCfg = Release|x64
180+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Release|x64.Build.0 = Release|x64
181+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Release|x86.ActiveCfg = Release|Win32
182+
{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Release|x86.Build.0 = Release|Win32
163183
EndGlobalSection
164184
GlobalSection(SolutionProperties) = preSolution
165185
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)