Bitcoin Forum
April 18, 2024, 02:37:49 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Who network detects that block is invalid  (Read 176 times)
eugene111 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
May 31, 2018, 11:46:27 AM
 #1

Assuming I have 3 nodes and they are fully synced and 3 of them has 5 equal blocks:
1 node:   1 -> 2 -> 3 -> 4 -> 5
2 node:   1 -> 2 -> 3 -> 4 -> 5
3 node:   1 -> 2 -> 3 -> 4 -> 5

Imagine that a bad guy who owns node 2 changed data in block 3 (probably by using some binary editor or by re-mining of this block) so
2 node will have: 1 -> 2 -> 3c  ->  4  ->  5

and blocks 4 and 5 must became invalid, but - if nobody checks this validity nobody will know that 3c is invalid.
As I understand to proof that 3 is invalid - we need to calculate it's hash and compare with the prev hash in block 4. So the question 1. Is this validation perfomed at some time?

Then the invalid block 3c is published to the network. How is it validated that this block is invalid? Node just look up for the node with the same height and compares hashes? and if they are different - it is rejected?


1713407869
Hero Member
*
Offline Offline

Posts: 1713407869

View Profile Personal Message (Offline)

Ignore
1713407869
Reply with quote  #2

1713407869
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
nc50lc
Legendary
*
Offline Offline

Activity: 2380
Merit: 5477


Self-proclaimed Genius


View Profile
May 31, 2018, 12:05:35 PM
 #2

Those were validated by all of the nodes via consensus, means "the more, the real~er".

In the end, all other nodes will invalidate that edited block because your node is the only one "voting" that block 3c is valid.
If someone try to make a transaction that uses an input from that block, it will just return with an error like "invalid missing inputs".

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4158


View Profile
May 31, 2018, 12:06:42 PM
 #3

Full validation is only performed when they receive the blocks from their peers. When the client is opened, it only validates the last X blocks and its not a full validation.

In the case of Bitcoin Core nodes, they validate every single block and transaction that they receive. If any of the blocks doesn't follow the network's rule, the node will ignore the transaction. This includes blocks with low difficulty, invalid transactions etc; basically whichever blocks that does not follow the rules of the node. Since nodes does not consider invalid blocks, I can modify the blocks on my computer all I want (if I could) but no one would recognise it. Unless, the way I modify the block makes it such that it will follow their specific set of rules.

In the process of validation, nodes cannot rely on other nodes to give them the correct block hash. This would simply make it vulnerable to loads of attacks.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
watashi-kokoto
Sr. Member
****
Offline Offline

Activity: 682
Merit: 268



View Profile
May 31, 2018, 02:30:19 PM
Merited by odolvlobo (1), achow101 (1), ABCbits (1), HCP (1)
 #4

Assuming I have 3 nodes and they are fully synced and 3 of them has 5 equal blocks:
1 node:   1 -> 2 -> 3 -> 4 -> 5
2 node:   1 -> 2 -> 3 -> 4 -> 5
3 node:   1 -> 2 -> 3 -> 4 -> 5

1 node:   1 -> 2 -> 3 -> 4 -> 5
2 node:   1 -> 2 -> 3 -> 4 -> 5
3 node:   1 -> 2 -> 3 -> 4 -> 5



Imagine that a bad guy who owns node 2 changed data in block 3 (probably by using some binary editor or by re-mining of this block) so
2 node will have: 1 -> 2 -> 3c  ->  4  ->  5

1 node:   1 -> 2 -> 3 -> 4 -> 5
2 node:   1 -> 2 -> 3c
3 node:   1 -> 2 -> 3 -> 4 -> 5



and blocks 4 and 5 must became invalid, but - if nobody checks this validity nobody will know that 3c is invalid.
As I understand to proof that 3 is invalid - we need to calculate it's hash and compare with the prev hash in block 4. So the question 1. Is this validation perfomed at some time?

This validation is performed when a new node (node 4) is connecting to the network and syncing:

1 node:   1 -> 2 -> 3 -> 4 -> 5
2 node:   1 -> 2 -> 3c
3 node:   1 -> 2 -> 3 -> 4 -> 5
4 node:   1 -> 2



Then the invalid block 3c is published to the network. How is it validated that this block is invalid? Node just look up for the node with the same height and compares hashes? and if they are different - it is rejected?


                  ,-> 3 -> 4 -> 5
4 node:   1 -> 2 <
                  '-> 3c


Node 4 learns that two block chains exist. Node 4 determines the total proof of work (mining power spent) of all block chains. Once it is done it selects the longest valid chain.

                  ,-> 3 -> 4 -> 5  <- Longest Proof of Work Chain
4 node:   1 -> 2 <
                  '-> 3c


Afterwards, the node 2 is only node on the network with corrupted block chain.


1 node:   1 -> 2 -> 3 -> 4 -> 5
2 node:   1 -> 2 -> 3c
3 node:   1 -> 2 -> 3 -> 4 -> 5
4 node:   1 -> 2 -> 3 -> 4 -> 5
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!