36

The block chain file is getting rather large, ~500MB. Is there a way to trim it or clean up, or maybe configure it to be limited in the future? I am using the stock Bitcoin client on Ubuntu.

13

For portable devices there are variants of the Bitcoin client often dubbed "selfish clients" in that they do not download any portion of the block chain other than what pertains to their own specific addresses and transactions. To my knowledge, none of these variants has been fully developed into a desktop client, but it is likely that such projects are underway. Unless your system is literally lacking the hardware to accommodate these files, however, it is recommended that you use a non-selfish client version. The lightweight versions are called "selfish" for a reason - by only holding block chain data which pertains to your own transactions, you cannot pass anything but that data to other nodes and as such your client is of minimal (if any) use to the network.

  • Also, at the time of this writing, hard disk space is about $50 per TB which means the 500 MB block chain is costing you about 2.5 cents to store - "selfish client" may not be an overly nasty moniker after all. – David Perry Sep 4 '11 at 19:57
  • 9
    For platter based disk space yes, but my main machine is SSD which is about $2 per GB compared to $0.6 per GB and at 60 GB you have to keep on eye on it. I also may wish to look into Point-of-sale devices that may be using simple 12GB or 16GB SSD's and it may be a consideration. – browep Sep 6 '11 at 2:20
  • @DavidPerry What are the security risks in not having the entire Block Chain? – Pacerier Jun 17 '12 at 18:22
  • @Pacerier to my knowledge there aren't any meaningful security risks, you simply have an incomplete dataset. As long as the dataset contains all the blocks which are pertinent to the addresses you're interested in (i.e. the ones you own) then there shouldn't be any issues. – David Perry Jun 17 '12 at 19:21
  • @browep Most of the point-of-sale devices you're referencing already run credit card transactions through a server in a back room or via an attached embedded device anyway. Bitcoin has a built-in RPC mechanism for just such purposes, not to mention services like bitpay. It might not help save your expensive SSD, but you're an edge case - in almost every case either a) hard disk space is cheap or b) RPC/bitpay/ewallet is a better (and not unreasonable) option. – David Perry Jun 17 '12 at 19:24
8

If you want to use the standard client, currently there is no way to prune the blockchain data. However, you can try using a lightweight client (like MultiBit or Electrum), which offers similar security to the standard client (wallet.dat is stored on your computer), or an eWallet (like StrongCoin, or even using MtGox if you don't need too much functionality), but then you have to trust that service.

The first two would reduce the disk space on your machine, but you'd still need to synchronize with the network; the second two would make you store nothing on computer and you would not need to synchronize.

There is work being done on a "Stratum client", which might offer the speed and minimal disk requirements of an eWallet with security of a lightweight client.

You can read more about various levels of security provided by different types of clients here.

4

The short answer is: No.

The Bitcoin client requires the entire block chain in order to validate transactions, and the block chain is currently around 500MB. It will continue to get larger and larger over time.

3

NOTE: Do not use this solution. It is no longer relevant for current clients. See other answers for suggestions on how to use incomplete blockchain representations.

The current version of the client doesn't offer much in the way of optimizing space, and does some caching that may cause bloat, but here are some ideas for manual ways that could help.

  1. Copy the wallet.dat file out of the data directory, then remove the data directory. Restart the client have it build the data directory again and download the block chain. Stop the client replace the wallet.dat file with your backup. Restart the client with the -rescan option.
  2. Backup your entire data directory and remove it. Start the client again creating a new data directory, and block chain download. Copy an address from the client. Close the client, backup the new data directory as a different backup. Restore the old directory. Start the client and transfer all of your coins to the new address. You can then restore the number 2 backup of the data directory, and discard the old directory. In this scenario you do not need to restart the client with the -rescan option.

However, be very careful with these steps, and keep all the backups until you are sure you are successful. And remember that if you are expecting payments on the old wallet.dat file then you shouldn't use option two unless you can easily update the payment address to your new wallet.

  • 6
    Will that really help much in the way of space? The block chain is the block chain and it /is/ getting pretty big. – lemonginger Sep 3 '11 at 4:32
  • I will leave this here for historical value, and to avoid a future duplicate of this answer, but it is no longer a relevant solution. There may have been some inefficiencies in an earlier client versions, but there is no evidence of that now. As @lemonginger and others point out the block chain is what it is, any solution will involve not using the the full block chain. – Joshua Kolden Oct 7 '14 at 22:26
0

You can use the -prune command when you execute the core. This will strip down the blocks your client maintains to only the essential. For me it has pared down the size of the btc Blocks folder by a third.

Add -prune to the end of your command line when you go to run the bitcoincore executable

All command-line options (except for -conf) may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file.

You can also add -prune to end (outside the quotes) of the Target text in the properties of the bitcoincore GUI shortcut.

-3

I don't believe you can, actually, which is one of Bitcoin's wee little problems, along with a too-long-gap between difficulty computations.

In order for Bitcoin to take over from the dollar, you'd have to have the entire economy of the USA on everyone's computer. That can't happen.

In order to fix that, we will have to modify the block chain system and that is DAMN DANGEROUS, because in spite of all the scandals around Bitcoin, Bitcoin itself is immutable, nothing has ever been found wrong with it's actual data structure itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.