Wherever I read about fraud in bitcoin, it talks about modified a transaction that is already in a block and changing the receiver and then trying to create a longer chain.

However, I was wondering, if we can modify a transaction thats already in the block, why can not a miner, modify a transaction at the time of mining itself. And if he is lucky, he can find a block that will make the transaction unmodifiable.

PS. Kindly excuse me for such a silly question, as I am a student in bitcoin and blockchain.


Generally, no. Most transactions contain a digital signature which signs a hash of the transaction. Usually this hash includes the entirety of the transaction, so changing any part of the transaction would invalidate the signature and thus invalidate the entire transaction.

There are some exceptions though. There are some signature hash types which don't include specific parts of the transaction thus allowing output to be changed, inputs to be added, etc. There are also some transaction output types which don't require a signature. However these signature hash types and output types are not created by wallet software. Making them requires you to know exactly what you are doing and either make it by hand or use custom software. The vast majority of users will never need to use or make such transactions.

Whoever told you that transactions can be modified in a block and then the blockchain extended to make that transaction valid is completely wrong. Besides the fact that transactions cannot be changed like this and still be valid, including a transaction in the blockchain does not automatically make it valid. It must be valid to be included, and if it is invalid, the block is invalid and nodes will reject it so it isn't actually added to the blockchain that everyone is following.

  • Additional information: During the mining phase you can change the transaction in such a way that the content remains the same but the txid changes, also known as the transaction malleability issue. This has lead to the demise of MtGox. – Penquin Jul 6 '17 at 1:15
  • all has been said about tx melleability, I will not re-explain here :-) for Varesh: tx melleability cannot change the tx in a way, like you posted your request. It has to do with "return adresses", but doesn't cange the value of a tx or a destination address, as that's a part of the hashing, like Andrew explained. – pebwindkraft Jul 6 '17 at 7:36

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.