0

I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .
Then it adds this block in the ledger and broadcasts to all nodes that it has solved the puzzle. Other nodes verify it and allow the that new chain in which block is added.

My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?

I don't know and it is not written anywhere that at the point when a node broadcasts that it has solved the puzzle and found hash of tampered transactions, is it the case that the other node has also solved the puzzle and hopefully with the untampered transactions? Because won't it be waster of resources to solve the same puzzle twice? And if other nodes do not solve the puzzle for the second time, how are they able to decide that the malicious node has solved the puzzle with the tampered transaction?

0

My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?

No. Unless you mean changing the order of, or which transactions are included. Any unauthorized modifications to the transaction data itself will invalidate the digital signature. Any blocks with invalid transactions will be rejected by the bitcoin-core software that runs on the nodes on the network. Any work done (for PoW) is therefore wasted if the transactions are tampered with. Also, nodes don't typically mine anymore, it's the miners that do the proof-of-work, and then submit the work to the node for validation. This includes validating all of the transactions along with the proof of work.

I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .

The miners role is not to validate the block of transactions (though it might choose to in order to prevent wasting resources), it is the role of the node. Also, proof of work is done by hashing the block header, which includes: version, previous block hash, merkle root, unix epoch time, difficulty target (bits), and nonce, see Bitcoin Mining Algorithm.

1

I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .

More accurately: the miner's role is to confirm the block of transactions. Each and every node (and miner) will independently verify the validity of all transactions and blocks. 'Validation' is not just the job of a miner. As mentioned by JBaczuk, the POW blockhash is actually computed on version, previous block hash, merkle root, unix epoch time, difficulty target (bits), and nonce.

My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?

Not quite. Once a transaction is confirmed in a block, any new subsequent block that spends the same UTXO will be invalid (since that UTXO was already spent).

If the miner attempts to re-mine that original block (ie. a new block with the altered transaction, at the same blockheight), this will likely fail and be a waste of their resources. Even if they do find a valid block, the rest of the network will already know about the first version of that block, and the other miners will be working on the next block already (or they will have already found it). So even if your altered block is valid, the network will still ignore it since the network has already accepted a longest (most work) chain, that does not include your block.

I don't know and it is not written anywhere that at the point when a node broadcasts that it has solved the puzzle and found hash of tampered transactions, is it the case that the other node has also solved the puzzle and hopefully with the untampered transactions?

Transactions generally can't be meaningfully 'tampered with'. Transaction malleability is an edge case that could be considered, but otherwise changing the contents of a transaction will make it invalid. When a node verifies the validity of a block, it would catch any invalid transactions, and thus drop the block for being invalid.

Other ways you could change a block's transaction content would include adding or removing certain transactions from the block, changing the ordering of the transaction in the block, or substituting one transaction for another (that spends the same UTXO, see double spend attacks).


In short: Since the miners are always incentivized to mine at the chain tip, having a miner work on re-mining an old block to introduce an 'altered' block in some way ultimately doesn't really matter to the rest of the network participants. The network just ignores the altered block, meaning the net outcome is that the miner that made the altered block just wasted their resources.

0

The answer to your question is in the point 5 of the Bitcoin's Whitepaper by Satoshi Nakamoto:

The steps to run the network are as follows:

1) New transactions are broadcast to all nodes.

2) Each node collects new transactions into a block.

3) Each node works on finding a difficult proof-of-work for its block.

4) When a node finds a proof-of-work, it broadcasts the block to all nodes.

5) Nodes accept the block only if all transactions in it are valid and not already spent.

6) Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.

Nodes always consider the longest chain to be the correct one and will keep working on extending it. If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, they work on the first one they received, but save the other branch in case it becomes longer. The tie will be broken when the next proofof-work is found and one branch becomes longer; the nodes that were working on the other branch will then switch to the longer one.

New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped messages. If a node does not receive a block, it will request it when it receives the next block and realizes it missed one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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