<p>I'm trying to compute the normalized transaction ID so that it matches what is on blockchain.into at the following URL</p>

<pre><code> http://blockchain.info/q/hashtontxid/  --- normal TX ID here ----
</code></pre>

<p>Given that I need to create a canonical id of some type (just the tx inputs, etc), can anyone go into technical detail as to how the hash is created?</p>

<p>Some variations I've tried</p>

<ol>
<li>foreach input and output, add them to the sha256 engine.  call finalize at the end.</li>
<li>foreach input and output, add them to the sha256 engine.  call finalize at each round.  Use the finalized output to initialize each round, and then the next data[] (input or output array)</li>
<li>make everything one flat memory array, laid out sequentially, hash and finalize.</li>
</ol>

<p>I'm assuming that the byte[] layout in memory is no different than what it is on the bitcoin network.</p>

<p>I might be dealing with yet another endian issue, so any confirmation on approach will reduce my troubleshooting.</p>

CC BY-SA 3.0
2014-03-10T10:22:13.027Z
Maybe this can help: https://bitcoin.stackexchange.com/questions/22168/what-is-the-normalized-transaction-hash-of-a-transaction
Steven Roose
CC BY-SA 3.0
2014-03-10T11:43:11.030Z
Thanks I read that, the pull request, and tried to figure out the proposed changes that "were not supposed to be a serious proposal for inclusion into the code" and am having trouble matching C# with what is in block chain.
makerofthings7
CC BY-SA 3.0
2014-03-11T00:45:31.607Z
Just now the core BTC devs decided to not support normalized txids.
Steven Roose
<transactions><development><blockchain.info><transaction-id>
When computing a normalized transaction id, when do I finalize the sha256 hash?
makerofthings7
# When computing a normalized transaction id, when do I finalize the sha256 hash?

(Asked by: username_0 on 2014-03-10)

I'm trying to compute the normalized transaction ID so that it matches what is on blockchain.into at the following URL

```
 http://blockchain.info/q/hashtontxid/  --- normal TX ID here ----

```

Given that I need to create a canonical id of some type (just the tx inputs, etc), can anyone go into technical detail as to how the hash is created?

Some variations I've tried

1. foreach input and output, add them to the sha256 engine. call finalize at the end.
2. foreach input and output, add them to the sha256 engine. call finalize at each round. Use the finalized output to initialize each round, and then the next data[] (input or output array)
3. make everything one flat memory array, laid out sequentially, hash and finalize.

I'm assuming that the byte[] layout in memory is no different than what it is on the bitcoin network.

I might be dealing with yet another endian issue, so any confirmation on approach will reduce my troubleshooting.

**Tags:** transactions, development, blockchain.info, transaction-id

> **Comments:**
> **username_1**: Maybe this can help: https://bitcoin.stackexchange.com/questions/22168/what-is-the-normalized-transaction-hash-of-a-transaction  
> **username_0**: Thanks I read that, the pull request, and tried to figure out the proposed changes that "were not supposed to be a serious proposal for inclusion into the code" and am having trouble matching C# with what is in block chain.  
> **username_1**: Just now the core BTC devs decided to not support normalized txids.  

---

## 0 answers

