Author

Topic: Self contained, cross platform USB stick client & wallet (Read 2148 times)

sr. member
Activity: 294
Merit: 250
LinuxCoin.

I do run Linuxcoin from USB for my mining rig. 

But I'd like to run the client in the OS that is already running, not re-boot into linux.  Especially since Macs can't boot a non-Mac OS from USB.  Well, not easily. 

I already have my secure bank on a bootable Ubuntu live CD. With several backups, of course.

I'm still looking into various "more secure" alternatives to running the client directly.  Looking into VirtualBox right now.

Of course, version 0.4 could come out with an encrypted wallet.dat and save the day, but we don't know when that might be.

I don't really have enough BTC to matter, and half of what I DO have is in MtGox, so this is really more for my own curiosity than anything else.
member
Activity: 84
Merit: 10
I yam what I yam. - Popeye
sr. member
Activity: 294
Merit: 250
My Linux box at work can't run the bitcoin client, the OS is too old.  And I still don't have access to a Windows box.

However, there is this thread: http://forum.bitcoin.org/index.php?topic=4868.msg71216#msg71216  that I found.  He's on windows and using the same approach as me.

So it should work.
legendary
Activity: 3920
Merit: 2349
Eadem mutata resurgo

bitcoin does a lot of disk activity so hardware is a consideration. If you run this 24/7 you may expect USB drive failures (got back-up?), I corrupted a USB running bitcoin like this.

What is a perhaps a better method, not quite as secure but just about, is to move the whole -datadir into a RAM disk (/dev/shm/ on ubuntu/debian), although it is quite large but still doable at around 700-800Mb.

0. Mount USB with bitcoin client and datadir

(Ubuntu/Debian)
1. Check available space on RAM disk
Code:
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              53G  8.9G   42G  18% /
none                  743M  668K  742M   1% /dev
none                  749M  1.5M  748M   1% /dev/shm
none                  749M   96K  749M   1% /var/run
none                  749M     0  749M   0% /var/lock

/dev/shm needs to be bigger than 750M. Make sure you aren't running some other RAM hogging code that could cause issues (i.e. don't run any other programs unless you know what you are doing.)

2. Copy .bitcoin folder onto RAM disk
Code:
$cp -R /media/MyUSBDrive/.bitcoin /dev/shm/.bitcoin

3. Run bitcoin
Code:
bitcoin -datadir=/dev/shm/.bitcoin

When you are done copy the whole thing back from RAM onto USB (first $srm the existing wallet.dat on USB if one exists, make sure you have another copy of wallet.dat elsewhere because at this point you will only have one copy and it is in RAM, be careful) and then reboot.

4. Secure remove previous wallet
Code:
$srm /media/MyUSBDrive/.bitcoin/wallet.dat

5. Remove existing datadir on USB drive
Code:
$rm -rf /media/MyUSBDrive/.bitcoin

6. Copy everything back from RAM onto USB drive (could also do an update and skip step 5 above)
Code:
$cp -R /dev/shm/.bitcoin/ /media/MyUSBDrive/.bitcoin

7. Check wallets are identical (probably should encrypt first anyway but outside of scope here)
Code:
$diff /dev/shm/.bitcoin/wallet.dat /media/MyUSBDrive/.bitcoin/wallet.dat

8. Reboot.
vip
Activity: 1358
Merit: 1000
AKA: gigavps
I would also like to know if this is something that is cross platform. Please update.
newbie
Activity: 9
Merit: 0
This sounds like something that I would use. Any updates?
sr. member
Activity: 294
Merit: 250
Hello.

Today I was playing around trying to make a self-contained USB Bitcoin client.  The bitcoin executable, wallet.dat & blockchain would all live on the USB stick.

I'm on a Mac at home.  I have it working on the mac.  I use a shell script to launch the OSX bitcoin client with the -datadir parameter, to the datadir on the USB stick using a relative path.

USB dir structure:

root
  * bin
      -> Bitcoin_osx.app
  * data
      -> all the bitcoin data files and wallet.dat
-> Run_Bitcoin_OSX.command

The "Run_Bitcoin_OSX.command" is:

Code:
#!/bin/sh
echo $0;
DIR=`dirname "$0"`
echo $DIR
cd "$DIR"
exec bin/Bitcoin_osx.app/Contents/MacOS/bitcoin -datadir=./data

I need to try this approach for Linux (should work) and Windows (I have no idea)

Next steps:

* On Monday, at work, on my Linux desktop, I'll get Linux working
* Somehow get access to a Windows desktop (I guess I have friends with Windows at home) and try that
* Once it's all working cross platform, try some cross platform encryption.

Suggestions / Ideas / I'm totaly wrong?
 
Jump to: