Bitcoin Forum
December 12, 2024, 02:36:02 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: wallet.dat renamed to ANY filename in ANY location for bitcond & bitcoin-qt  (Read 6942 times)
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 251



View Profile WWW
June 21, 2013, 09:07:02 PM
 #1

Hello

I have submitted a small change to the GitHub Bitcoin Project that modifies 3 files.

bitcoind & bitcoin-qt will have wallet.dat behave exactly as before, or optionally the wallet file (wallet.dat) can now be any legal file name in your operating system, and it can be in any directory on any fixed or removable drive. This is done with an optional configuration argument:

walletpath=<full wallet file name>

This is in the same spirit as the conf option, which allows for a bitcoin.conf file anywhere and with any name.

Add a command line argument -walletpath=a:/b.c/d.e/f.g
or, in your bitcoin.conf file, add the line walletpath=a:/b.c/d.e/f.g

In either case, the wallet.dat file is now f.g in the d.e directory, etc.

This allows one to have various separate wallets for a single bitcoin program, as determined by the configuration  --OR--  one can have multiple versions of bitcoind and/or bitcoin-qt such that when each program runs, it uses the same wallet.

With this change, ONE block chain in the datadir directory can service multiple wallets.

Finally, walletpath can be just a file name, a partial path name or a full path name. And these can have spaces (blanks) in them if the whole argument is enclosed in quotes ("path name").

To summarize this allows wallet.dat to be named anything and located anywhere as determined by the user and separated from all blockchain data.

Ron


LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
June 22, 2013, 12:12:28 AM
 #2

Great patch!. While I cannot do it now, I will definitely send you a small donation.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
June 22, 2013, 12:23:37 AM
 #3

This is nice. Some questions, and test you could do, so if I have two wallets, one is in /wallet1/wallet.dat and /wallet2/wallet.dat (unix paths) what are the startup times? Do I have to add a -rescan command when i am switch between wallets or will this do it automatically? Or can you just add maybe a checkpoint to the wallet, so it knows the blockchain it was scanned up until and then just scan from there on?

Also a link to the pull request would be nice.
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 251



View Profile WWW
June 22, 2013, 01:10:53 AM
 #4

This is nice. Some questions, and test you could do, so if I have two wallets, one is in /wallet1/wallet.dat and /wallet2/wallet.dat (unix paths) what are the startup times? Do I have to add a -rescan command when i am switch between wallets or will this do it automatically? Or can you just add maybe a checkpoint to the wallet, so it knows the blockchain it was scanned up until and then just scan from there on?

Also a link to the pull request would be nice.

I don't do anything special? I just run a bitcoind or bitcoin-qt with a bitcoin.conf that points to a wallet file at some location. Then after that bitcoin ends I run it again or another with a bitcoin.conf that points at a different wallet. But both programs can use the same block chain. The wallets aren't meant to be switched while the program is running, if that is what you asked.

I did a 'github commit' but it seems to be 'invisible'!? I may have done something wrong in the process? I appear to have an 'unsynced commit' a2f59a3e58f83a6688b54fedacd25034842c6061, whatever that is:) I am using a 'github for windows', see http://windows.github.com/ and so am well 'insulated' from 'trouble', I hope! I can't seem to do a 'pull request' that is 'satisfying', in that it looks like 0.8.1 or 0.8.2

O.8.2 seems to be a great improvement over 0.8.1 in being able to 'catch up' after being in computer standby, and staying 'current' with only 8 connections.

Ron


LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
btceic
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


♫ A wave came crashing like a fist to the jaw ♫


View Profile WWW
June 22, 2013, 01:21:58 AM
 #5

Hello

I have submitted a small change to the GitHub Bitcoin Project that modifies 3 files.

bitcoind & bitcoin-qt will have wallet.dat behave exactly as before, or optionally the wallet file (wallet.dat) can now be any legal file name in your operating system, and it can be in any directory on any fixed or removable drive. This is done with an optional configuration argument:

walletpath=<full wallet file name>

This is in the same spirit as the conf option, which allows for a bitcoin.conf file anywhere and with any name.

Add a command line argument -walletpath=a:/b.c/d.e/f.g
or, in your bitcoin.conf file, add the line walletpath=a:/b.c/d.e/f.g

In either case, the wallet.dat file is now f.g in the d.e directory, etc.

This allows one to have various separate wallets for a single bitcoin program, as determined by the configuration  --OR--  one can have multiple versions of bitcoind and/or bitcoin-qt such that when each program runs, it uses the same wallet.

With this change, ONE block chain in the datadir directory can service multiple wallets.

Finally, walletpath can be just a file name, a partial path name or a full path name. And these can have spaces (blanks) in them if the whole argument is enclosed in quotes ("path name").

To summarize this allows wallet.dat to be named anything and located anywhere as determined by the user and separated from all blockchain data.

Ron

Wouldn't this open a vector to allow attackers to modify wallet.dat at any time?
I suggest that this command line arg require the password to be passed in for confirmation reasons, unless of course it already does, if so then forgive my ignorance.

♫ This situation, which side are you on? Are you getting out? Are you dropping bombs? Have you heard of diplomatic resolve? ♫ How To Run A Cheap Full Bitcoin Node For $19 A Year ♫ If I knew where it was, I would take you there. There’s much more than this. ♫ Track Your Bitcoins Value
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1462



View Profile
June 22, 2013, 02:43:32 PM
 #6

bitcoind & bitcoin-qt will have wallet.dat behave exactly as before, or optionally the wallet file (wallet.dat) can now be any legal file name in your operating system, and it can be in any directory on any fixed or removable drive. This is done with an optional configuration argument:

walletpath=<full wallet file name>

This is in the same spirit as the conf option, which allows for a bitcoin.conf file anywhere and with any name.
Just to be clear, this doesn't make the client any more secure. A virus can just scan bitcoin.conf for the real location of the wallet file. If walletpath is included in a shortcut/command line, a quick search of start menu + desktop will likely reveal the wallet location as well.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 251



View Profile WWW
June 22, 2013, 02:46:16 PM
 #7

Wouldn't this open a vector to allow attackers to modify wallet.dat at any time?
I suggest that this command line arg require the password to be passed in for confirmation reasons, unless of course it already does, if so then forgive my ignorance.

Hello

My response seems to have vanished (?) so here goes again. This change was done in the spirit of the -conf argument code and since neither -conf nor -walletpath are in the vRPCCommands[] in bitcoinrpc.cpp I don't see the 'vector'. Actually, the only additions to the code are in AppInit2(), step 5 in init.cpp

I am still trying to get my 'patch' visible, but I don't 'speak' or 'understand' github-ese yet Smiley Things like is 'clone in windows' the same as a 'pull request'?

Ron


LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 251



View Profile WWW
June 22, 2013, 03:12:22 PM
 #8

bitcoind & bitcoin-qt will have wallet.dat behave exactly as before, or optionally the wallet file (wallet.dat) can now be any legal file name in your operating system, and it can be in any directory on any fixed or removable drive. This is done with an optional configuration argument:

walletpath=<full wallet file name>

This is in the same spirit as the conf option, which allows for a bitcoin.conf file anywhere and with any name.
Just to be clear, this doesn't make the client any more secure. A virus can just scan bitcoin.conf for the real location of the wallet file. If walletpath is included in a shortcut/command line, a quick search of start menu + desktop will likely reveal the wallet location as well.

Hello

I didn't say anywhere that this would make bitcoin's wallet more secure. The wallet encryption still works! The purpose of this 'patch' is to separate the wallet file from the large amount of block chain data in the -datadir directory and optionally rename it too.

For security, I propose only having the wallet.dat (or whatever you now choose to call it) on the computer when you choose to run bitcoin with the purpose of using it to spend BTCs, say on a USB thumb drive.

Further, compile your own version of bitcoind & bitcoin-qt and 'find & replace' walletpath in the file init.cpp with any obscure word of your choice! It is in only 2 places! Then for good measure add many more arguments to your invocation of bitcoin, all similar but meaningless. One could also make the file hidden, or 'system' etc. but this would require a little more code I presume in order to read and write to the file.

All of these would only slow down a 'pro' or prism (sounds like prison) if he/she/it were to compromise your system.  The intent of this change was to make the wallet file more accessible to the average user and developers, like me!

Ron



LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 251



View Profile WWW
June 27, 2013, 10:32:53 PM
 #9

Hello all

Boy, have I been having trouble with 0.8.2.x & 0.8.3  Huh I can't get a github fork->clone to work anything like the release 0.8.2 or 0.8.3 (which is very close to 0.8.2.2)

At the moment I am running daemon release 0.8.3 which insists it must reindex. Which I have never seen before?

Whenever I create my own bitcoind.exe, I get random file errors of the following nature,

LevelDB read failure: IO error: H:\xx\datadir\chainstate\002128.sst:
Could not create random access file.

Where the file 00xxxx.sst can vary. These files are fine as I can view and change them (using Ztree or other similar programs). It seems that the bitcoin-qt versions work OK though?

Has anybody had any problems like this, or am I alone?

This has been holding me back from contributing the moveable wallet code.

Ron


LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 251



View Profile WWW
July 03, 2013, 12:10:50 PM
 #10

I have succeeded! See
https://bitcointalk.org/index.php?topic=248855.0

basically GitHub success at
https://github.com/old-c-coder/bitcoin-git/commit/929019012dc7d93fd3ba59d8eb553e390211a713

Ron


LTC: LUYiMVsrFQewUSPDasSKGzhyTPAkiTeSov BTC: 1DPvP6WoZzaNQ9Nxzd64hjYad1kyQzTTbx YAC: Y3ZggXDvnRJaRwtVGyGJwt6DMLN3EPQpQf 
The day is coming when a single carrot, freshly observed, will set off a revolution.  Paul Cezanne
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!