-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[PoC] Add wallet inspection and modification tool "bitcoin-wallet-tool" #8745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ce30a75 to
d57bcd1
Compare
|
I like the concept of an external app working on I can even imagine removing/deprecating We have to take care of proper file locking when working on the file when Some travis' hosts do not build (wallet/nowallet configs?). |
|
Yeah, why not. Concept ACK. This is conceptually similar to SQL database's external utilities for repair, management, etc. From a deployment point of view I think we should keep this command-line only. Two Qt-using statically linked monster executables in the distribution is a bit too much, because of size concerns but also because e.g. MacOSX assumes a one-to-one mapping of GUI executables to applications.
This is indeed very important, it needs to be prevented (and tested) that it is impossible to fudge a database with this utility while bitcoind is running. |
Yes. The whole -walletupgare (as well as salvage) could go into this tool.
Yes. The current Qt app could support similar functions, It doesn't need to be a separate App. Multiwallet support would help in this case. |
|
Another operation that would be useful here: rewriting the wallet. This does the CDB::rewrite step as done after encryption, but is meant to get rid of no-longer-used 'junk' blocks in the wallet. Either to make the file smaller or permanently rid of sensitive metadata that has been removed. This cannot be conveniently done from the context of bitcoind (needs restart) but ideally in an external tool. |
08bd4a8 to
3ad7856
Compare
|
I think if we're going to keep adding more binaries like this, we really ought to stop using static linking for the gitian bins sooner rather than later... :/ |
3ad7856 to
7914686
Compare
|
Can't figure out how to solve the gcc linking circular dependencies issue. Maybe @theuni know a way to solve this. |
On windows that's easy: package the DLLs with the binary, ship them in the same directory. Many software does this. On Linux less so, unfortunately. It's possible to ship Anyhow this is a tangent: our non-GUI dependencies are really small. E.g. boost is mostly header-only with some small library files, libevent is tiny, berkeleydb is relatively small, etc. It isn't too problematic to link them to each executable. Also this tool doesn't even need libevent. |
|
Agree with @laanwj. The non QT static linked tools should be relatively small, compared to the disk space required by the blocks/index. |
Hmm, what about RPATH? |
|
Agree with @laanwj/@jonasschnelli above. @luke-jr rpath would work (for linux, you can use a relative path). There are lots of reasons not to do that though, and unless there's a better reason than filesize, it doesn't seem justifiable. |
|
Closing for now. Requires some steps in between until this can be revitalized |
|
Reopening. |
7914686 to
30c40ff
Compare
30c40ff to
f76ed9c
Compare
|
Not sure if you are still seeing issues with circular dependencies, but a simple way to allow building with circular dependencies during development is to add |
|
doesn't build for me. Fails at linking: Travis seems to have the same build failures. Concept ACK. Once you've fixed the build failures, I'm very keen to test and review this. As you say, this will be especially useful for multi-wallet. |
|
I can get this to build using the |
|
I have a branch of this rebased on #10762 and #12490 (which remove the wallet <-> server circular dependencies and allow this to build) here: https://github.com/jnewbery/bitcoin/tree/pr8745_rebased if anyone wants to play around with it. |
|
I've rebased https://github.com/jnewbery/bitcoin/tree/pr8745_rebased and pushed it (there were lots of silent conflicts with wallet refactors). |
|
I've rebased https://github.com/jnewbery/bitcoin/tree/pr8745_rebased on top of #12490 (which removed the circular dependency that prevents this branch from building). @jonasschnelli - feel free to take that branch and push it to this PR. Otherwise, I'm happy to open my own PR and continue maintaining this feature. |
|
Closing in the hope @jnewbery takes this over |
WORK IN PROGRESS
Add another bitcoin-tool called
bitcoin-wallet-tool. Currently it supports creation of wallets (with optional encryption before creating keys), encryption and some info-dumping.If we agree on this concept, it could be use for creating a HD wallet with a given xpriv.
Also, a such tool would probably be required to properly restore a hd wallet.
If we once migrate away from BerkleyDB, this could also be helpful.