<p>It seems that when someone wants to send Bitcoins, he creates a transaction and the transaction_id will be transaction's hash. after block confirmation this id will be change and we can find out this id in the transaction explorers, I want to access the transaction id created by sender(first id) to verify the transaction by r, s and sender's public key that saved in block chain, but to verify this transaction I need the hash that created by sender, there is too many references that I can use to calculate the final transaction id but I need the id that created by sender to verify transaction. I wrote some implementation according to Bitcoin's wiki but it was wrong.</p>
<p>I need an exact reference or a function that shows how to calculate the transaction id that calculated by sender.</p>
<p>for example in a random <a href="https://explorer.btc.com/btc/transaction/adb1b4723f24841b671b1e979571929f7fc1db9f3884eee2e3fec782bb3ff0a6" rel="nofollow noreferrer">transaction</a>  with id
adb1b4723f24841b671b1e979571929f7fc1db9f3884eee2e3fec782bb3ff0a6
we can find the r = 0x0082a19fd532b25c79831c8a8e4802cd35ccabe41469c1c46386ce3fa9f60fde and the s = 0x04fa4e1593c94c130b0ebb1a57d390367d797191af0cb201b3a68fe683bc393b
the public key of sender is pub = (0x6bb502c0eb0a69caec1d649259f5ec3286bef74e2d1cf4cf2b3657be7242d5f9, 0x63f0ab38e0cb9399dcb386e64a67188d0acdc49363583893190e3f950fae5c38) if we run the verification algorithm it will return false if we take h = tx_id  = 0xadb1b4723f24841b671b1e979571929f7fc1db9f3884eee2e3fec782b
because r_prime = 0x9fc47f1afdb0f2012e373bb6e55e7f208afd5c162d538f36d6420daaf800f21 and it is not equals the r!
I test this senario with other transactions but the results was the same!</p>

CC BY-SA 4.0
2024-03-26T15:34:32.240Z
Hi Mohsen, a transaction does not change by being confirmed. There are some ways how third parties can [modify the hash of a transaction with non-segwit inputs](https://bitcoin.stackexchange.com/q/21994/5406), but I suspect that your problem may stem from the misunderstanding that a transaction id always changes by getting included in a block. Could you please edit your post to clarify your question in light of this information?
Murch
CC BY-SA 4.0
2024-03-26T15:53:29.037Z
Hi @Murch thanks for the comment. the post is updated.
Mohsen Ghorbani
CC BY-SA 4.0
2024-03-26T17:00:38.697Z
It is not clear what you are trying to do in your example. It sounds to me as if you assume that the message signed by a signature is the txid, but that is not the case.
Murch
CC BY-SA 4.0
2024-03-26T21:18:47.237Z
@Murch, maybe it is because of my misunderstanding. I should read the documentation of Transaction of bitcoin with more details. Thanks for your comments BTW.
Mohsen Ghorbani
CC BY-SA 4.0
2024-03-26T21:41:24.053Z
Perhaps the chapter on signatures in the recently published 3rd Edition of Mastering Bitcoin can clarify: https://github.com/bitcoinbook/bitcoinbook/blob/6d1c26e1640ae32b28389d5ae4caf1214c2be7db/ch08_signatures.adoc#L52 (the whole book is available in that repository).
Murch
CC BY-SA 4.0
2024-03-26T21:53:53.677Z
Thanks for the reference, it will be useful for me.
Mohsen Ghorbani
<transactions><raw-transaction><transaction-verification><transaction-malleability>
Is there anyway to produce the transaction's hash created by sender?
Mohsen Ghorbani
# Is there anyway to produce the transaction's hash created by sender?

(Asked by: username_0 on 2024-03-26)

It seems that when someone wants to send Bitcoins, he creates a transaction and the transaction\_id will be transaction's hash. after block confirmation this id will be change and we can find out this id in the transaction explorers, I want to access the transaction id created by sender(first id) to verify the transaction by r, s and sender's public key that saved in block chain, but to verify this transaction I need the hash that created by sender, there is too many references that I can use to calculate the final transaction id but I need the id that created by sender to verify transaction. I wrote some implementation according to Bitcoin's wiki but it was wrong.

I need an exact reference or a function that shows how to calculate the transaction id that calculated by sender.

for example in a random [transaction](https://explorer.btc.com/btc/transaction/adb1b4723f24841b671b1e979571929f7fc1db9f3884eee2e3fec782bb3ff0a6) with id
adb1b4723f24841b671b1e979571929f7fc1db9f3884eee2e3fec782bb3ff0a6
we can find the r = 0x0082a19fd532b25c79831c8a8e4802cd35ccabe41469c1c46386ce3fa9f60fde and the s = 0x04fa4e1593c94c130b0ebb1a57d390367d797191af0cb201b3a68fe683bc393b
the public key of sender is pub = (0x6bb502c0eb0a69caec1d649259f5ec3286bef74e2d1cf4cf2b3657be7242d5f9, 0x63f0ab38e0cb9399dcb386e64a67188d0acdc49363583893190e3f950fae5c38) if we run the verification algorithm it will return false if we take h = tx\_id = 0xadb1b4723f24841b671b1e979571929f7fc1db9f3884eee2e3fec782b
because r\_prime = 0x9fc47f1afdb0f2012e373bb6e55e7f208afd5c162d538f36d6420daaf800f21 and it is not equals the r!
I test this senario with other transactions but the results was the same!

**Tags:** transactions, raw-transaction, transaction-verification, transaction-malleability

> **Comments:**
> **username_1**: Hi username_0, a transaction does not change by being confirmed. There are some ways how third parties can [modify the hash of a transaction with non-segwit inputs](https://bitcoin.stackexchange.com/q/21994/5406), but I suspect that your problem may stem from the misunderstanding that a transaction id always changes by getting included in a block. Could you please edit your post to clarify your question in light of this information?  
> **username_0**: Hi @username_1 thanks for the comment. the post is updated.  
> **username_1**: It is not clear what you are trying to do in your example. It sounds to me as if you assume that the message signed by a signature is the txid, but that is not the case.  
> **username_0**: @username_1, maybe it is because of my misunderstanding. I should read the documentation of Transaction of bitcoin with more details. Thanks for your comments BTW.  
> **username_1**: Perhaps the chapter on signatures in the recently published 3rd Edition of Mastering Bitcoin can clarify: https://github.com/bitcoinbook/bitcoinbook/blob/6d1c26e1640ae32b28389d5ae4caf1214c2be7db/ch08_signatures.adoc#L52 (the whole book is available in that repository).  
> **username_0**: Thanks for the reference, it will be useful for me.  

---

## 0 answers

