How to setup a bittiraha Bitcoin wallet on your Linux server, and how to connect to the wallet with the Bitcoin and Altcoin Wallets WordPress plugin.
The Bitcoin and Altcoin Wallets WordPress plugin can work with the bittiraha wallet since version 1.1.0. It has come to my attention that there was no guide on how to do this. Here’s how:
Why use bittiraha?
The bittiraha wallet is useful to users who want to use the WordPress plugin without running a full Bitcoin node, AND without relying on one of the provided cloud wallet services.
A full Bitcoin node stores a local copy of the entire blockchain. This takes up several Gigabytes, which makes it an unattractive solution for some web servers. The bittiraha wallet is based on the bitcoinj wallet implementation and features an RPC API that is fully compatible with Bitcoin core. You can therefore connect to this wallet from the built-in Bitcoin core node Adapter that came with your copy of the plugin.
This is an intermediate-difficulty guide. Do not attempt this if you are not prepared to administer your server from the command line. For most users, the cloud wallets are the way to go.
The following instructions are based on the Bittiraha wallet’s readme file.
First, ensure that your Linux environment is ready for building the wallet:
sudo apt-get install moreutils openjdk-7-jre openjdk-7-jdk ant git
Depending on the repositories of your distribution, you might need to install
Then, clone the repository using
git clone https://github.com/prasos/bittiraha-walletd
Now enter the source code directory and run the build script.
cd bittiraha-walletd sh build.sh
This will build the JAR file in
The wallet configuration is not done via a
bitcoin.conf file as in Bitcoin core.
Instead, the two files that control the server are
testnet.conf. Use the testnet config for testing, then switch to mainnet for production.
Create the file
mainnet.conf and give it the following contents:
# start determines whether this network will be started. 1 means start, 0 means don't start=1 # sendUnconfirmedChange determines whether walletd will consider unconfirmed change outputs spendable. # 1 means they are spendable, 0 means they're not. You can use this to deal with malleability attack and # to make your transactions look less risky to accept as 0-conf. sendUnconfirmedChange=1 # targetCoinCount and targetCoinAmount control automatic splitting of change, which is helpful if sendUncofirmedChange # is disabled. If you wish to disable the feature, set targetCoinCount to 0. Basically, walletd will split the change # into more than one output when change is more than targetCoinAmount and there are less than targetCoinCount outputs # of at least targetCoinAmount coins present in the wallet. Outputs smaller than targetCoinAmount will be counted as # fractional outputs. targetCoinCount=8 targetCoinAmount=0.5 # TCP port for RPC API port=8332 # Here you can configure withdrawal fees paid to the network's miners # To determine sane values, use https://bitcoinfees.earn.com/ paytxfee=0.00100000
Copy the file to
testnet.conf and edit the port number to read 18332 instead of 8332. These are the default RPC ports, and you can change them if needed.
That’s it. Save the conf files in the root of the source tree. Use the
start= line to turn on or off connection to the mainnet and testnet.
You can now start the wallet with:
Go to the admin area of your WordPress site. Visit Wallets → Bitcoin core node (BTC). Make sure that:
- the adapter is set to enabled.
- there are no other adapters enabled for the BTC symbol.
- the RPC port matches your wallet configuration.
- the withdrawal fees are equal to or larger that your value of
There is no need to set a username and password as this wallet provides no authentication. Make sure to secure your wallet via a firewall so it accepts connections only from your WordPress IP. Details on how to do this on your system can vary. For example, one way to control access would be to enter a ufw rule:
sudo ufw allow from 184.108.40.206 to any port 8332
220.127.116.11 would be the IP address of your WordPress site.
Finally, go to Wallets → Adapters. If all is configured correctly, the adapter status should be responding.