Home

Awesome

BitcoinWallet

BitcoinWallet is a Simple Payment Verification (SPV) Bitcoin wallet written in Java. It allows you to send and receive coins using Pay-To-Pubkey-Hash payments. It has a 'wallet' and a 'safe'. The safe contains coins that are not to be spent until they are moved to the wallet. It uses a single change address because I'm not worried about being anonymous on the network and don't want to take a chance on losing coins because I forgot to back up the wallet after making a transaction. Bloom filters are used to reduce the amount of data sent to the wallet from the peer nodes.

You can use the production network (PROD) or the regression test network (TEST). The regression test network is useful because bitcoind will immediately generate a specified number of blocks. To use the regression test network, start bitcoind with the -regtest option. You can then generate blocks using bitcoin-cli to issue 'setgenerate true n' where 'n' is the number of blocks to generate. Block generation will stop after the requested number of blocks have been generated. Note that the genesis block, address formats and magic numbers are different between the two networks. BitcoinWallet will create files related to the TEST network in the TestNet subdirectory of the application data directory.

H2 is used for the wallet database and the files will be stored in the Database subdirectory of the application data directory.

BouncyCastle is used for the elliptic curve functions. Version 1.51 provides a custom SecP256K1 curve which significantly improves ECDSA performance. Earlier versions of BouncyCastle do not provide this support and will not work with BitcoinWallet.

Simple Logging Facade is used for console and file logging. I'm using the JDK logger implementation which is controlled by the logging.properties file located in the application data directory. If no logging.properties file is found, the system logging.properties file will be used (which defaults to logging to the console only).

Build

I use the Netbeans IDE but any build environment with Maven and the Java compiler available should work. The documentation is generated from the source code using javadoc.

Here are the steps for a manual build. You will need to install Maven 3 and Java SE Development Kit 8 if you don't already have them.

Runtime Options

The following command-line arguments are supported:

The following command-line options can be specified using -Dname=value

The following configuration options can be specified in BitcoinWallet.conf. This file is optional and must be in the application directory in order to be used.

Sample Windows shortcut:

javaw.exe -Xmx256m -jar \Bitcoin\BitcoinWallet\BitcoinWallet-3.0.1.jar PROD