Author

Topic: [TECHNICAL] how are transactions hashes created? (Read 997 times)

full member
Activity: 181
Merit: 100
September 08, 2011, 08:00:45 AM
#8
That's because it's not showing the full block, just that transaction block, so the example is incomplete. If you read the line under that it's the 'truncated' first few bytes of the whole transaction hash. If they showed that whole block I'm sure you'd be able to piece together the information of which combines to make that.

I never found the answer when I was looking for it
It's the Hash (ie sha256^2) of the transaction in little-endian

For example, the Hash of
Quote
010000000130395068e54c83864c17e0d04467956e67229066c60b3e4e3500dfae8524a6e400000 0008c493046022100e564071d42b5e7ce069b5d864c3f151e2121b5216cd77599e82c83f4b21e43 7a022100fd83c972dbe5fdbdb11c8457c7d42504c5f8fc7c93aad16468681a35b66a6713014104e 2f81f840e109d8cfad3b31040b4d674c36de4e28d3566061f6bb119f0c210d6b6c29cf23b21443b b25044eae5647a6ebc1e4a8b66e93c851a20f3d73f50580fffffffff02e679bdb7030000001976a 9149e8607eb634e1819413a51685423fb2a2144062888ac40420f00000000001976a914ec752339 9bfff0e1e1be93377a3b0253fe9d4f1a88ac00000000
is f3bb27c3733258fb49f377fc189a839e9eafc4cbdde88aacf1ffa1d2bcebc95b, so its hash is 5bc9ebbcd2a1fff1ac8ae8ddcbc4af9e9e839a18fc77f349fb583273c327bbf3

I imagine for this transaction hash for example is shortened to like 5bc9eb then hashed with the previous block, (read farther down on that wiki page, theres the merkle tree root information there, it takes the previous blocks Merkle and hashes it with the transaction. So say the merkle for this block was "hashMerkleRoot=e81287" (which is the hash of the previous blocks transactions, to provide a chain order?) and our transaction is "hash=5bc9eb", the hash of the two of those is the actual "hash=" that is stored in the block you see which could be "hash=2d7f4d"
hero member
Activity: 589
Merit: 500
Try https://en.bitcoin.it/wiki/Protocol_specification and https://en.bitcoin.it/wiki/Protocol_rules. Though it's possible that for some things the code is the de facto documentation.

I have the same question on how to calculate transaction hash. From https://en.bitcoin.it/wiki/Dump_format, I can't understand how  the following 2d7f4d is calculated out.

Quote
CTransaction(hash=2d7f4d, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(000000, -1), coinbase 0418ba001c02ce03)
    CTxOut(nValue=50.00000000, scriptPubKey=0x4FE11D72F988AEA611F026)
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
I never found the answer when I was looking for it
It's the Hash (ie sha256^2) of the transaction in little-endian

For example, the Hash of
Quote
010000000130395068e54c83864c17e0d04467956e67229066c60b3e4e3500dfae8524a6e400000 0008c493046022100e564071d42b5e7ce069b5d864c3f151e2121b5216cd77599e82c83f4b21e43 7a022100fd83c972dbe5fdbdb11c8457c7d42504c5f8fc7c93aad16468681a35b66a6713014104e 2f81f840e109d8cfad3b31040b4d674c36de4e28d3566061f6bb119f0c210d6b6c29cf23b21443b b25044eae5647a6ebc1e4a8b66e93c851a20f3d73f50580fffffffff02e679bdb7030000001976a 9149e8607eb634e1819413a51685423fb2a2144062888ac40420f00000000001976a914ec752339 9bfff0e1e1be93377a3b0253fe9d4f1a88ac00000000
is f3bb27c3733258fb49f377fc189a839e9eafc4cbdde88aacf1ffa1d2bcebc95b, so its hash is 5bc9ebbcd2a1fff1ac8ae8ddcbc4af9e9e839a18fc77f349fb583273c327bbf3
donator
Activity: 2058
Merit: 1054
Try https://en.bitcoin.it/wiki/Protocol_specification and https://en.bitcoin.it/wiki/Protocol_rules. Though it's possible that for some things the code is the de facto documentation.
member
Activity: 112
Merit: 10
Don't get eaten by wolves!
The wiki has a collection of technical specs (https://en.bitcoin.it/wiki/Category:Technical), but I can't vouch for their thoroughness.
newbie
Activity: 46
Merit: 0
thats the closest I have come to  a technical spec for how the transaction hash is created.  Thanks.  Is there anything more technical like a white paper or anything like that?
member
Activity: 112
Merit: 10
Don't get eaten by wolves!
Have you tried the Wikipedia page on Bitcoins?

http://en.wikipedia.org/wiki/Bitcoin
newbie
Activity: 46
Merit: 0
Could someone explain how a transaction hash is created?  Or maybe point me to a resource that has a good technical rundown of bitcoin.  I am finding it pretty hard to find good technical documentation.

Jump to: