<p>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.</p>

<p>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.</p>

<p>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.</p>

CC BY-SA 3.0
2017-07-06T01:15:09.793Z
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
CC BY-SA 3.0
2017-07-06T07:36:48.043Z
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
CC BY-SA 3.0
2017-07-05T23:51:17.243Z
2017-07-05T23:51:17.243Z
Ava Chow
<p>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.</p>

<p>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.</p>

<p><em>PS. Kindly excuse me for such a silly question, as I am a student in bitcoin and blockchain.</em></p>

<fraud>
Can bitcoin transactions be modified during mining
Varesh
# Can bitcoin transactions be modified during mining

(Asked by: username_0 on 2017-07-05)

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.*

**Tags:** fraud


---

## 1 answers

### Answer by username_1 on 2017-07-05. Score: 0 | Accepted answer

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.

> **Comments:**
> **username_2**: 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.  
> **username_3**: all has been said about tx melleability, I will not re-explain here :-) for username_0: 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.  

---

