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
- foreach input and output, add them to the sha256 engine. call finalize at the end.
- 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)
- 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.