Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: daniel_san on March 03, 2023, 04:01:54 AM



Title: Bitcoin, some technical questions about light nodes
Post by: daniel_san on March 03, 2023, 04:01:54 AM
Hello everyone.
I'm studying bitcoin's underlying protocol and codebase but I'm struggling with some subjects.
1. I've read that light nodes aren't able to propagate transactions because they can't validate them, but in my opinion that doesn't make much sense because if it was true they would be lost resource. They could just propagte and leave the validation for full nodes. Can someone explain?
2. I understand that full nodes verify every transaction in the blockchain, but how is it done and if light nodes do it too, how they do it if they don't have the full copy of the blockchain?

Thanks in advance!


Title: Re: Bitcoin, some technical questions about light nodes
Post by: pooya87 on March 03, 2023, 04:45:47 AM
They could just propagte and leave the validation for full nodes.
That could be abused for spamming invalid transactions through other people's computers. You'd just send the light node your invalid transaction and they send it to the full nodes they are connected to and get themselves banned.
Besides, the bitcoin network has enough full nodes that are relaying transactions so there is no need to use others.

Quote
2. I understand that full nodes verify every transaction in the blockchain, but how is it done and if light nodes do it too, how they do it if they don't have the full copy of the blockchain?
Light nodes cannot verify everything, that is why they are "light" after all.
A full node would verify a lot of things including whether or not the inputs the transaction is spending were spent before which requires the full node to have downloaded the whole blockchain to that point and have built a database of UTXOs. The full node also verifies all the scripts (including signature verification) in the transaction's inputs.


Title: Re: Bitcoin, some technical questions about light nodes
Post by: NotATether on March 03, 2023, 08:14:48 AM
Light nodes can broadcast their own transactions to other (full) nodes, whereas the full nodes will both validate the transaction and relay it to other nodes.

It is technically possible for anyone to relay a transaction, but it would have to be placed inside a full node's mempool to actually get mined.


Title: Re: Bitcoin, some technical questions about light nodes
Post by: witcher_sense on March 03, 2023, 08:44:42 AM
2. I understand that full nodes verify every transaction in the blockchain, but how is it done and if light nodes do it too, how they do it if they don't have the full copy of the blockchain?
They don't and they don't have to.


Any bitcoin-related software capable of creating, receiving and broadcasting transactions is technically a node, that is, it can be considered a part of bitcoin network. Despite the fact that light nodes are limited in their ability to verify validity of data coming from other node, they still play a very important role of providing mobile communication for bitcoin users. The only thing you need to spin up a light node is minimum hardware and working internet connection. You can have thousands of light nodes for no additional cost in terms of storage or bandwidth. You can create your network of nodes in which all light nodes will be connected to your own full node, and that will allow you to transact from any part of the world without having to rely on third-party solutions. In fact, without light nodes, the adoption of bitcoin technology is impossible because not all people are going to run personal servers with bitcoin software installed, most of them will be connecting to Uncle Jim's server, whom they fully trust.