If you want to support Bitcoin, but don’t have the vast computing power to make mining worthwhile or even practical, then a lightweight node may be what you’re looking for. Here’s what you need to know.
What’s a Full Node?
Our guide to blockchain in simple terms covers the specifics of how blockchain works, but before we can look at a lightweight node, we need to discuss a full node.
A full node is the “traditional” way to mine Bitcoin. You connect a computer to the network, it downloads the whole ledger and gets to work. This is a problem. It has to download and store the whole blockchain and keep it up to date. This is almost the point of Bitcoin, but hear us out.
The Bitcoin ledger is roughly 160GB at the time of writing. While not tiny, this isn’t a huge problem for most mining rigs. A decent Internet connection won’t take long to download that much data, and any modern computer has ample storage space, often ten times that much.
What if you don’t have that much storage space? What if your Internet connection is so bad, you’ll never download all that data? Well, you could get a friend to download the ledger, or buy new storage, but that incurs extra expenses and isn’t exactly convenient. Besides, this is impossible on a mobile phone or other portable or restricted device.
What can you do if you want to support Bitcoin, but don’t have the computer power to do so? What if you want to use your mobile phone, or you have an old computer, and you can’t afford to invest in the latest and greatest mining hardware?
Enter: Lightweight Nodes.
What Are Lightweight Nodes?
Lightweight nodes (sometimes called partial nodes, lightweight clients, or thin clients) differ to full nodes in one simple but significant way. They don’t need to store the whole blockchain. Lightweight nodes only need to store a very small part of the blockchain. This allows them to use far fewer resources, yet contribute to the network.
I know what you’re thinking. A Bitcoin node which doesn’t know about every transaction can never work? Isn’t that a cornerstone of Bitcoin itself? Yes, it is, but there are many circumstances where you don’t need a full node, simple (but limited) interactions with the blockchain will often suffice.
This limited blockchain interaction is possible using something called Simplified Payment Verification, or SPV for short. SPV allows anything to verify the transactions included in a block, without having to download that block.
Satoshi Nakamoto included SPV in the original Bitcoin whitepaper, so it’s not some ill-advised addition, it’s part of Bitcoin itself. Lightweight nodes download the block headers. These are like a summary of each block. They outline details about the transactions within the block but comprise of far smaller file sizes than the block itself.
To figure out if a transaction is in a block, lightweight nodes request proof of inclusion. This proof of inclusion works through a computer science technique known as a “Merkle branch”. The technology behind Merkle branches is very complex, but they are a unique identity for a block, which summarises all the information in the block. No two blocks have the same Merkle branch, they are completely unique. Merkle branches use cryptology techniques like those that power Bitcoin itself.
By looking at a Merkle branch, a lightweight node can get the status of a transaction, without having to download the whole ledger or search through it.
SPV exists to ensure the transactions a lightweight node thinks happened, actually happened. Although there are some minor drawbacks. Lightweight nodes have to request proof of inclusion from a full node. This may lead to a centralization of sorts of Bitcoin, but that’s not always a problem, providing there are enough miners running full nodes to maintain a healthy network.
Why Use a Lightweight Node?
Now that you understand how lightweight nodes work, it’s easy to imagine the potential. If you’ve used Bitcoin at all, then you may have used a lightweight node or client.
Almost all crypto wallets are lightweight nodes. If you want to see the status of your funds, it’s not always convenient to download the whole ledger and keep it up to date.
Tools such as Block Explorers sometimes rely on lightweight nodes and any kind of mobile app will use one. There are many instances where apps, software packages, or products use lightweight nodes somewhere in the virtual supply chain, but don’t always communicate that to you. This could be a website which lists the latest price, or a web wallet. These products may use lightweight nodes or clients, but abstract that away behind internal tools.
A lightweight client is an awesome way to build your own desktop wallet status tracker, or what about a smartwatch app?
Still, lightweight nodes aren’t always the best choice for every situation. If you want to run your own exchange or make money mining, then a full node is the way to go. Full nodes support lightweight nodes, among many other important tasks.
If too many people started switching to lightweight nodes, there may be serious consequences for the network as a whole. There may not be significant computing power left for the network to process all the transactions in an acceptable timeframe.
This may also expose the network to a 51 percent attack, where one person or group can control the network by owning the majority of the computing power. While unlikely, it shows that lightweight nodes are excellent, full nodes are still the best way support Bitcoin—providing you have the computer power to do so.
What are some of your favorite uses for lightweight nodes? Let us know in the comments below, or join our Twitter or Facebook communities and let us know.