Does every node has a whole copy of the blockchain?

2

1

As i read here, in a blockchain "each node the has a copy of all transactions ever made". This to me seems impossible, bitcoin exists for a long time, and the memory size of the intere blockchain would be enormous.

ps: if i have to pay for a service using bitcoins, do i become a node of the blockchain ?

AleWolf

Posted 2019-11-29T12:24:03.983

Reputation: 123

Answers

5

To join the network, a Bitcoin full node will work its way through the network history, independently verifying the state of the network through time. So yes, each node will have downloaded and validated the entire transaction history, but a node can choose to use 'pruning mode', where it will discard unneeded transaction history after validation is complete.

The ever-increasing size of the blockchain is a heavy consideration when considering network and protocol updates. Bitcoin requires a distributed network in order to maintain its function, so it is important that the software can be run on inexpensive hardware, so that more people can participate.

ps: if i have to pay for a service using bitcoins, do i become a node of the blockchain ?

There are other ways to interact with the network. Many wallets are lite-wallets, which validate the chain via headers instead of the entire block. This is a less robust security model, but it works well for many people.

You generally do not need to pay a service in order to interact with the network (as a full node, a lite-wallet, etc).

chytrik

Posted 2019-11-29T12:24:03.983

Reputation: 13 841

1

Full nodes by default store the entire blockchain. The current size of the blockchain is ~250GB, so it is feasible for individuals to have their own copy and verify all of the transactions. There is also the option to run Bitcoin in pruned mode, which reduces the number of transactions that need to be stored. This greatly reduces the storage space demands and it can still verify all the transactions.

However, not every node is a full node. There are lightweight nodes known as SPV nodes that don't verify the entire blockchain. Instead they can verify block headers and rely on a full node for the state of the blockchain.

More info on SPV nodes: https://gist.github.com/ariard/1034cd7624805d53334e80d4712fb8ee

If you're paying for a service using Bitcoin, its very likely that the service provider is running a full node for you. You run your own node when you run the bitcoin software yourself. It's a a worth while experience and if you're interested in Bitcoin and want to help maintain its integrity you should consider running your own node.

What/how to run your own node: https://bitcoin.org/en/full-node#what-is-a-full-node

Matthew Cruz

Posted 2019-11-29T12:24:03.983

Reputation: 418

1re: "Every full node has the entire blockchain" - this isn't true. Many full nodes run in pruning mode, allowing them to discard the vast majority of the block data, if they so choose. – chytrik – 2019-11-29T12:43:31.327

@chytrik you're correct, I edited my answer and I believe it is right now. – Matthew Cruz – 2019-11-29T12:52:31.617

Pruning has nothing to do with the Merkle tree. It's simply downloading and verifying the whole chain normally, but deleting old blocks once they have been verified. – Pieter Wuille – 2019-11-29T14:49:44.457

@PieterWuille okay I edited my answer again. I was under the impression that if a transaction was pruned and needed to be verified the transactions would then need to be generated from the merkle root. Is just the block header sufficient for that? – Matthew Cruz – 2019-11-29T15:20:38.420

2Transactions are pruned after they are verified. They don't need to be verified again. The Merkle root can be used to prove to lightweight (non-validating) clients that a transaction was part of a block, but that is unrelated to pruning. – Pieter Wuille – 2019-11-29T16:20:28.243