7

Is is possible that a miner modified a unconfirmed transaction (like changing the output of transaction to the miner himself) and put it into the local block, and after 10 mins the miner luckily solved the PoW, putting the block on the chain and broadcast it to others?

If a transaction was modified and finally linked onto the chain, how others check whether the tx was valid or not? (others only check if PoW answer was right or wrong, not checking tx, am I right?)

And If modified tx was on chain, how do affected people recover their assets from the loss in modified tx (in which output was modified to the miner himself)? Could they ask to revoke the block or how could they do?

Thanks

  • 2
    If a miner could modify your unconfirmed transaction, I could also modify your unconfirmed transaction even without mining. – user253751 Mar 13 '18 at 21:36
11

Is is possible that a miner modified a unconfirmed transaction (like changing the output of transaction to the miner himself) and put it into the local block, and after 10 mins the miner luckily solved the PoW, putting the block on the chain and broadcast it to others?

No, because the transaction would be invalid. The vast majority of transactions contain digital signatures which signs the entire transaction. If the transaction is changed, the signatures will become invalid and thus the transaction will be invalid. And if a transaction is invalid, the block containing it is also invalid.

If a transaction was modified and finally linked onto the chain, how others check whether the tx was valid or not? (others only check if PoW answer was right or wrong, not checking tx, am I right?)

No, this is completely incorrect. ALL full nodes verify all transactions in all blocks that they receive (as well as transactions received outside of blocks). Just because a block has a valid proof of work does not mean that the block is valid. It must still build upon a valid block and must only contain valid transactions. Full nodes still verify that transactions contained within a block are valid.

Contrary to popular belief, miners do not say what transactions are valid. Their job is to determine the order of transactions, within certain constraints. It is the job of full nodes to verify transactions, and all miners (or the mining pools) should be running full nodes.

  • Thank a lot, it's really helpful. So, it is that full node would verify every transactions in the block which was newly created by miner? For my scenario as example, if someone modified a tx and successfully mined the block containing it, and as the block was sent to a full node, the full node would verify it and find out the invalid tx, and then what would this full node do? broadcasts to other nodes and informs them that this block is invalid? is it so? and then every node just discards the block that is just mined, which causing no new blocks found in last 10 mins? Thanks – Ren Mar 14 '18 at 3:49
  • 1
    Every full node that receives that block would reject it as invalid. They just discard the block; there is no notifying other nodes that the block is invalid. All full nodes will figure out it is invalid. It will be just as if no block had been found. Most nodes will also ban the node that relayed them the invalid block. Such bans are local to the node, not network-wide. Note that the block being discarded does not mean that work was wasted. Mining is stateless and every block tried has the same probability of having a valid PoW as every other attempt for a block at a given height. – Andrew Chow Mar 14 '18 at 3:50
6

Every valid bitcoin transaction can only be created if you have the sender's private key, public key, and the receiver's public key. You can check that the transaction is valid without having the private key, but to modify it you would need to recreate the transaction from scratch, which would only be possible if you had the sender's private key.

So no, it is not possible.

Edit: For a good explanation, see https://youtu.be/Lx9zgZCMqXE?t=193

-1

It is possible, but not for regular transactions

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.