In the Bitcoin white paper, Satoshi Nakamoto described how it was possible to use Bitcoin without running a full network node by using a method called Simplified Payment Verification, or SPV. Wallets that implement SPV do not validate all transactions or store a full copy of the blockchain, as full nodes do. Instead, SPV wallets store only the headers from the longest known chain and rely on the merkle root in block headers along with a merkle branch to prove that a certain amount of work would be required to double-spend a given transaction. The more blocks are built on top of a given transaction, the more an SPV wallet can trust that it will not be double-spent. This is referred to as the “block depth” security model, as opposed to the “block height” or “difficultywise-longest” security model of Bitcoin full nodes.
All that glitters is not gold
In their attempt to balance resource consumption with security, SPV wallets create several disadvantages for users. One downside is the possibility of a Denial of Service attack. While a full node cannot easily trick an SPV wallet into thinking that a transaction has been included in a block when it really hasn’t, the opposite is not true. A full node could easily lie to an SPV wallet by telling them that a transaction hasn’t been included in a block even when it really was. The solution would be for the SPV wallet to connect to many nodes, but there is nothing stopping a network partition or Sybil attack from further confusing the SPV wallet.
A second downside of using an SPV wallet are the inherent privacy leaks. SPV wallets only request transactions from full nodes for keys that the SPV wallet owns, making it trivial for full nodes to link the addresses and correlate transactions to deanonymize a Bitcoin user. While attempts have been made to fix SPV privacy with Bloom filters, such attempts have been shown to be largely ineffective. If transaction requests are not being sent through an anonymizing network such as Tor, then full nodes learn not only the specific addresses that an SPV wallet is interested in but also the IP address of the SPV wallet. This is a significant reduction in privacy compared with Bitcoin wallets that are secured by their own trusted full node.
Have your cake and eat it too
It is possible to obtain the benefits of using an SPV wallet, such as reduced memory and bandwidth requirements, without being subjected to the downsides faced by users of most SPV implementations. An SPV wallet user can run their own Bitcoin full node and instruct their SPV wallet to only retrieve and broadcast transaction data through that specific node. The user could even choose to run several nodes and spread them out across the Internet to improve performance, again instructing their SPV wallet to only connect to those specific nodes. This way, the user can be sure that the full node their SPV wallet is connecting to will not try to attack the user through denial of service or deanonymization. The user therefore gains all of the benefits of an SPV wallet and all of the benefits of running a full node.
There is currently only one mobile Bitcoin wallet which allows users to specify which full node to connect to: Bitcoin Wallet for Android, by Andreas Schildbach. Once your Bitcoin full node is fully synchronized with the network, you will be able to take the following steps to link your node to Bitcoin Wallet and rely on this node exclusively for all of your transaction security.
Step 1: Find the public IP address of your Bitcoin full node.
If you are using a Bitseed, the public IP address for your device is shown on the Bitseed Status Page. You can access the Status Page by following the directions in the Bitseed documentation.
After ensuring that your full node is accepting connections from outside nodes via UPnP or port forwarding (showing more than 8 peer connections), you can proceed to the next step.
Step 2: Download Bitcoin Wallet for Android.
The easiest way to download the Bitcoin Wallet app is by downloading it from the Google Play Store. Advanced users can also build the app from source and install the app directly on their phone by first checking the “install from untrusted sources” checkbox in the Android security settings menu then transferring the APK file to the phone via email, cloud storage, or USB transfer.
Step 3: Choose trusted peer.
Click the three vertical dots at the top of the the Bitcoin Wallet app screen to access the main menu, click the Settings button, then click Settings one more time to reveal the Settings menu. Click the Trusted Peer button, enter the public IP address of your Bitcoin full node, then click OK. This will force the wallet to always try to connect to your node and make it one of the 8 peers it uses to verify and relay transactions.
If you want make the wallet to connect only to your full node, check the box next to “Skip regular peer discovery.” This will offer maximum privacy since the IP address of the wallet will not be publicly exposed. However, note that your wallet will only be able to verify the blockchain on that single node and cannot double check against any other nodes. Also, the wallet will not be able to track the progress of the transaction until it is included in a block.
Exit the Settings menu to go back to the main screen and try sending a small test transaction to another wallet to ensure that the new configuration works properly. If the test transaction does not work, double-check the previous steps taken, try again, and if it still does not work, troubleshoot your node to make sure it is publicly available. If the transaction does go through, then success! You now have an SPV wallet that is secured exclusively by your own trusted Bitcoin full node.