How to Add a Watch-Only Wallet to Bitcoin on OSX/Linux with Bitcoind
When it comes to managing Bitcoin transactions and assets, it’s crucial to have a secure and controlled environment. One way to achieve this is by using a watch-only wallet, which allows you to control your private keys without exposing them to the public world. In this article, we’ll explore how to add a watch-only wallet to Bitcoind on OSX/Linux.
Understanding Watch-Only Wallets
A watch-only wallet is similar to a regular Bitcoin wallet, but with a few key differences:
- The owner can still control their private keys and send coins, but they have no purchasing power.
- There is no transaction history or records of wallet activities.
- The owner cannot access the wallet’s funds without using a mnemonic seed.
Adding a Read-Only Wallet to Bitcoind
To add a read-only wallet to Bitcoind on OSX/Linux, you will need to:
- Install Bitcoind from source: You can download and compile Bitcoind from its official repository at [ Make sure to configure the build process correctly.
- Choose a JSON RPC client library: You will need a library that allows you to connect to the Bitcoin network using JSON-RPC (JavaScript Object Request Packets) APIs. Some popular choices include
bitcoinj
andwallethub
. For this example, we will usebitcoinj
.
- Generate a mnemonic seed: You will need a mnemonic seed to restore your read-only wallet from a backup or recover it in case of loss. A mnemonic seed is a series of words that represent the private keys used for your wallet.
Step 1: Install and configure Bitcoind
Once you have installed Bitcoind, make sure it is running correctly by checking your logs:
bitcoind -version
Configure Bitcoind to use the JSON RPC client library:
bitcoind --jsonrpcurl
Step 2: Generate a mnemonic seed
Generate a mnemonic seed using bitcoinj
. You will need to specify the list of mnemonic words and the length of the seeds. For example, if you have a standard English dictionary, you can use it like this:
bitcoinj --seedwordlist /usr/share/mnemonic-wordlists/english-dictionary.txt -l 25
This will generate a seed phrase in JSON format that you will need to restore your wallet from a backup or recover it if lost.
Step 3: Add the read-only wallet
Create a new file called wallet.json
with the following content:
{
"address": "0x...",
"mnemonicSeed": "...",
"privateKey": "...",
"publicKey": "..."
}
Replace the addresses, mnemonic seed, private key, and public key with your own values. The mnemonicSeed
field must match the seed phrase generated by bitcoinj
.
Step 4: Connect to Bitcoin using JSON-RPC
Connect to the Bitcoin network using JSON-RPC:
bitcoind --jsonrpcurl
Once connected, you can use the wallet.json
file as a starting point to create and manage your read-only wallet.
Use Case Example
Here is an example of how you can use the newly added read-only wallet to send coins:
bitcoind --jsonrpcurl wallets/getaddr 0x...
get the address associated with the mnemonic seedbitcoind --jsonrpcurl wallet/0x...
restore the wallet using the private key and public key
By following these steps, you can add a read-only wallet to Bitcoind on OSX/Linux and start managing your Bitcoin assets securely.