Bitcoin Forum
May 24, 2024, 03:26:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Self contained, cross platform USB stick client & wallet  (Read 2127 times)
geek-trader (OP)
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


View Profile
July 24, 2011, 03:02:43 AM
 #1

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?
 

Make 1 deposit and earn BTC for life! http://bitcoinpyramid.com/r/345
Play my FREE HTML5 games at: http://magigames.org  BTC donations accepted.
ottoxgam
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
July 28, 2011, 05:28:18 AM
 #2

This sounds like something that I would use. Any updates?
jamesg
VIP
Legendary
*
Offline Offline

Activity: 1358
Merit: 1000


AKA: gigavps


View Profile
July 28, 2011, 11:10:27 AM
 #3

I would also like to know if this is something that is cross platform. Please update.
marcus_of_augustus
Legendary
*
Offline Offline

Activity: 3920
Merit: 2349


Eadem mutata resurgo


View Profile
July 31, 2011, 10:32:55 PM
 #4


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.

geek-trader (OP)
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


View Profile
August 01, 2011, 01:07:52 AM
 #5

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.

Make 1 deposit and earn BTC for life! http://bitcoinpyramid.com/r/345
Play my FREE HTML5 games at: http://magigames.org  BTC donations accepted.
Smalleyster
Member
**
Offline Offline

Activity: 84
Merit: 10


I yam what I yam. - Popeye


View Profile WWW
August 01, 2011, 01:12:38 AM
 #6

LinuxCoin.

Feel like investing in a Miner?:
http://bitcointalk.org/index.php?topic=30044.msg377773#msg377773
A soup to nuts newbee system for a secure, portable USB wallet (free instructions):
NoobHowTo: http://bitcointalk.org/index.php?topic=27088.msg341387#msg341387
geek-trader (OP)
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


View Profile
August 01, 2011, 01:21:33 AM
 #7

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.

Make 1 deposit and earn BTC for life! http://bitcoinpyramid.com/r/345
Play my FREE HTML5 games at: http://magigames.org  BTC donations accepted.
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!