Developed by Lightning Labs, the Neutrino protocol is the first implementation of BIP 157 and BIP 158. The developer claims its protocol provides a lightweight and scalable solution for mobile bitcoin apps without trade-offs in centralization and privacy
What is Neutrino?
Neutrino is a new light-client protocol optimized for devices with low-power processors, limited storage, limited bandwidth, intermittent power, and erratic connectivity. Based on BIP 157/158, Neutrino has a number of advantages over implementations of the popular BIP 37. With Neutrino, the control of private keys stays with their user, which also improves censorship-resistance. Unlike SPV clients, the Neutrino-based apps, Lightning Labs claims, do not leak user information and preserve personal transaction history hidden. The protocol requires less computation and thus boasts a higher level of decentralization and scaling compared to SPV/BIP 37 protocols.
How does it work?
Neutrino is based on the chain of ‘filters’ that each correspond to a block in the Bitcoin blockchain. These filters use a special compression algorithm called Golomb-Rice coding to represent the addresses contained in a block. Neutrino filters (called GCS filters, for 'Golomb-Coded Set') are a much more compressed way of representing a block and are ~15KB each, whereas the source blocks can be over 250 times as large (up to ~4MB).
The protocol allows low-power devices to observe the blockchain, extract transactions that are relevant to the user’s wallet and update the balance. This process includes four steps:
- As each new block is found, full nodes derive corresponding GCS filters and broadcast them to Neutrino nodes;
- the Neutrino client receives the filter and compares it to the user’s wallet to see if there are any relevant transactions;
- If a filter does show relevant transactions, the client downloads the stripped version of the block that contains all transaction data but excludes signatures;
- After scanning the block, the client updates the user’s balance.
Of course, the client cannot do it in real-time if the Neutrino-based app is closed. When the user first opens the app, it will have to download and validate the entire chain of block headers that adds up to about 40MB for the current Bitcoin blockchain. After that, the client downloads the chain of filter headers. After validation, headers from blocks prior to the wallet’s creation are deleted. The third step is to download all the GCS filters for the blocks starting from when the wallet was created. Finally, the client scans all of the downloaded filters, discards of those that do not contain relevant transactions and downloads the stripped blocks of those that do. Now the client is up to date and ready to be used. The whole initial syncing process, Lightning Labs assure, does not take more than a few minutes on a typical smartphone.