Bitcoin Forum
April 20, 2024, 02:06:19 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: You can have wallet.dat anywhere and with any name, now!  (Read 5678 times)
old c coder (OP)
Sr. Member
****
Offline Offline

Activity: 260
Merit: 250



View Profile WWW
July 03, 2013, 03:45:21 AM
 #1

Hello all,

I have been fighting GitHub and my ignorance, long and hard, but have finally won!

See
https://github.com/old-c-coder/bitcoin-git/commit/929019012dc7d93fd3ba59d8eb553e390211a713

If you can compile bitcoind &/or bitcoin-qt, you can have a wallet with any name, on any drive, in any directory. The wallet is not restricted to the name wallet.dat, nor is it tethered to the [data] directory.

Bitcoin-qt allows one to "backup" ones wallet to anywhere, with any name (not really! It doesn't allow names with no extension, at least on windows!). Now one can run from that back up wallet, or anywhere. The idea is that there is a new argument for bitcoin.conf or the command line, that names and locates what used to be wallet.dat only in the data directory.

For example, after exiting bitcoin, d or qt, one can copy ones wallet.dat to another location say drive x, path y and name z. One only has to add a line to bitcoin.conf, if you are using one, or an argument to the bitcoin program of -walletpath=x:/y/z, or in bitcoin.conf walletpath=x:/y/z

That's it. It can be a partial path, e.g. walletpath=y/z or a filename walletpath=z

If there is no walletpath argument, bitcoin behaves as before. Also if the argument is walletpath=wallet.dat it also behaves as before. This just makes explicit what was implicit before! This change then, if one doesn't use it doesn't 'disturb the force' Smiley

I have tested it successfully with all kinds of names, even with no extension, on various drives, in various directories. There is one proviso: the wallet file, whatever its name now, still has some "genetic" connection to a 1MB file called [data] directory/database/log.0000000001

I don't know their relationship, but I could probably move it with the wallet file if needed. This means that it would be prudent keep log.0000000001 in "sync" with one\'s wallet.

The advantage of separating the wallet from the now ~9.75GB block chain is that they can be on different drives or even computers!? Or one can have various, possibly test versions, of bitcoind or bitcoin-qt, and they can all share the same block chain, or can share the same wallet.

I have added the change to the 0.8.3 release source and it works there too.

All these changes have been on a windows unit, so I am curious about the other two platforms.

I haven't tried with coins in the wallet, but I see no problems:) Let me know if you like it, or have any questions.

Ron


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

Posts: 1713578779

View Profile Personal Message (Offline)

Ignore
1713578779
Reply with quote  #2

1713578779
Report to moderator
1713578779
Hero Member
*
Offline Offline

Posts: 1713578779

View Profile Personal Message (Offline)

Ignore
1713578779
Reply with quote  #2

1713578779
Report to moderator
1713578779
Hero Member
*
Offline Offline

Posts: 1713578779

View Profile Personal Message (Offline)

Ignore
1713578779
Reply with quote  #2

1713578779
Report to moderator
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
b!z
Legendary
*
Offline Offline

Activity: 1582
Merit: 1010



View Profile
July 03, 2013, 03:56:42 AM
 #2

Cool! Now we can have backups with different names, which makes sorting easier too.
ArpFlush
Hero Member
*****
Offline Offline

Activity: 623
Merit: 500


View Profile
July 17, 2015, 09:01:21 AM
 #3

I tested this in a Testnet wallet, but without succes. Or will it only work on the mainnet?

"Panic Selling is not an Investment Strategy"
InceptionCoin
Member
**
Offline Offline

Activity: 108
Merit: 10


View Profile
July 17, 2015, 09:57:15 AM
 #4

Will you make pull request to bitcoin-core repository?

Skilled C++ and Python programmer. Looking around to create solid longterm coin by myself. Do you have any ideas? Feel free to PM me.
ArpFlush
Hero Member
*****
Offline Offline

Activity: 623
Merit: 500


View Profile
July 17, 2015, 10:11:39 AM
 #5

Will you make pull request to bitcoin-core repository?
I would, if I could  Huh I'm a noob on github  Shocked

"Panic Selling is not an Investment Strategy"
d4n13
Full Member
***
Offline Offline

Activity: 210
Merit: 101


“Create Your Decentralized Life”


View Profile
July 17, 2015, 06:13:10 PM
Last edit: July 18, 2015, 10:14:00 AM by d4n13
 #6

If you can compile bitcoind &/or bitcoin-qt, you can have a wallet with any name, on any drive, in any directory. The wallet is not restricted to the name wallet.dat, nor is it tethered to the [data] directory.

I had always thought that '-wallet' did that, but I guess not... Glad to hear it, and a damn good thing to protect against malicious code.

Renaming my wallet to 'KittyPicsToShareWithFriends.zip'.  
That'll teach 'em

unamis76
Legendary
*
Offline Offline

Activity: 1512
Merit: 1005


View Profile
July 17, 2015, 09:37:53 PM
 #7

This is very useful! I hope it will eventually get merged with the main code. Thank you Smiley
Amitabh S
Legendary
*
Offline Offline

Activity: 1001
Merit: 1003


View Profile
July 19, 2015, 11:05:49 PM
 #8

I tested this in a Testnet wallet, but without succes. Or will it only work on the mainnet?

Can you answer this question? Great feature but does it work on testnet? I would not test a new wallet on mainnet.

Coinsecure referral ID: https://coinsecure.in/signup/refamit (use this link to signup)
888coin
Member
**
Offline Offline

Activity: 63
Merit: 10


View Profile
July 20, 2015, 07:17:16 AM
 #9

If you can compile bitcoind &/or bitcoin-qt, you can have a wallet with any name, on any drive, in any directory. The wallet is not restricted to the name wallet.dat, nor is it tethered to the [data] directory.

I had always thought that '-wallet' did that, but I guess not... Glad to hear it, and a damn good thing to protect against malicious code.

Renaming my wallet to 'KittyPicsToShareWithFriends.zip'.  
That'll teach 'em


Interesting and I gonna to try it out later today. This will make file management easier and it seems I won't need to manually change filenames by renaming anymore.   Wink
arnuschky
Hero Member
*****
Offline Offline

Activity: 517
Merit: 501


View Profile
July 20, 2015, 03:42:32 PM
 #10


Reasons why not to do this are given in this issue: https://github.com/bitcoin/bitcoin/issues/68
The concerns regard corruption of the wallet due to improper locking.

Don't really understand what you mean with "married to LOG... file", though.
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
July 20, 2015, 09:12:16 PM
 #11

This is an inconsiderate bump of a very old thread.

Interesting and I gonna to try it out later today. This will make file management easier and it seems I won't need to manually change filenames by renaming anymore.   Wink

Bitcoin Core has had the ability to set the wallet file name with -wallet= for years. There is no need to rename files, and hasn't been a reason to do so for longer than your account here has existed.  You cannot change the path because if you split the BDB recovery logs and wallet file itself onto seperate media you will end up with irreparabile data corruption if there is an unclean power off with (un)reasonable probablity.

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!