0

I am curious to know how a node first knows if there are conflicting blockchains, I'm assuming, when two miners send a node a valid block, the node accepts the one it received first, and restores the second one in a cache. When new miners broadcasts blocks, and its previous hashes match the one in the cache, and it is the longer blockchain, it updates the blockchain to contain the new blocks.

Also, is it possible for a miner to send a blockchain instead of a block to be validated, if so, how does the node check if the transactions verified, does it only check the blockchain and the mempool to see if the transactions exist?

2 Answers 2

2

how a node first knows if there are conflicting blockchains,

It receives two or more blocks each containing a pointer (block ID) to the same previous block.

it is the longer blockchain

Loosely speaking yes. In fact it is the chain with the most accumulated work. A long chain with low difficulty levels won't replace a shorter chain with higher difficulty levels.

, is it possible for a miner to send a blockchain instead of a block

No, the network protocol has no message type for that

how does the node check if the transactions verified

Nodes don't ever trust miners. Never. Nodes do all the validating themselves. Nodes don't use miners as a validating service. The only function of miners is choosing an order (sequence) for transactions.

The number of confirmations (not validations) of a transaction is simply the position of a transaction in the sequence. A transaction in the 19th block from the top has 19 confirmations.


Everything described above, verification, confirmations, mining, nodes, blockchain fork and fork resolution would work just the same if Bitcoin blocks contained photos of cats instead of transactions. Nodes don't need a miner to tell them a photo of Pluto is not a picture of a cat, they can see that for themselves. They don't need a miner to tell them they have already seen a particular photo, they can check that themselves.

0

Bitcoin has the longest chain rule as one of its consensus rule. Which means that the node should accept and extend the longest valid chain. If there are miners validating blocks that extend the same "longest chain" than a fork happens. you end up with multiple blockchains for a temporary amount of time. To resolve this miners will mine on whatever chain they believe is valid and eventually one will be larger than the others and is declared the canonical chain.

Basically whichever chain ends up longer first wins. Nodes on shorter chains disregard them and switch over to referencing the longer chain as the source of truth

Miners dont send entire blockchains for validations as a response for your second q.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.