Bitcoin Forum
December 04, 2016, 08:30:15 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [TECHNICAL] how are transactions hashes created?  (Read 790 times)
browep
Jr. Member
*
Offline Offline

Activity: 45


View Profile WWW
August 16, 2011, 07:27:24 PM
 #1

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.


1480840215
Hero Member
*
Offline Offline

Posts: 1480840215

View Profile Personal Message (Offline)

Ignore
1480840215
Reply with quote  #2

1480840215
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Kansattica
Member
**
Offline Offline

Activity: 112


Don't get eaten by wolves!


View Profile WWW
August 17, 2011, 02:53:32 AM
 #2

Have you tried the Wikipedia page on Bitcoins?

http://en.wikipedia.org/wiki/Bitcoin

Shocking, obligatory charity code:
1Gimmiec4KSrcKR3t6xoReJd4rNGt8zM58

Free BTC every hour:
http://mycryptcoin.com/?rid=1CccBJE7BCTJEvRN9Uxfgwbr11fSaUvjFe

And why not free Bitcoins?
https://bitcointalk.org/index.php?topic=83057

Great (read: best) old computer games for BTC:
https://bitcointalk.org/index.php?topic=85347.0
browep
Jr. Member
*
Offline Offline

Activity: 45


View Profile WWW
August 17, 2011, 03:41:47 AM
 #3

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?

Kansattica
Member
**
Offline Offline

Activity: 112


Don't get eaten by wolves!


View Profile WWW
August 17, 2011, 04:16:20 AM
 #4

The wiki has a collection of technical specs (https://en.bitcoin.it/wiki/Category:Technical), but I can't vouch for their thoroughness.

Shocking, obligatory charity code:
1Gimmiec4KSrcKR3t6xoReJd4rNGt8zM58

Free BTC every hour:
http://mycryptcoin.com/?rid=1CccBJE7BCTJEvRN9Uxfgwbr11fSaUvjFe

And why not free Bitcoins?
https://bitcointalk.org/index.php?topic=83057

Great (read: best) old computer games for BTC:
https://bitcointalk.org/index.php?topic=85347.0
Meni Rosenfeld
Donator
Legendary
*
Offline Offline

Activity: 1890



View Profile WWW
August 17, 2011, 04:38:09 AM
 #5

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.

1EofoZNBhWQ3kxfKnvWkhtMns4AivZArhr   |   Who am I?   |   bitcoin-otc WoT
Bitcoil - Exchange bitcoins for ILS (thread)   |   Israel Bitcoin community homepage (thread)
Analysis of Bitcoin Pooled Mining Reward Systems (thread, summary)  |   PureMining - Infinite-term, deterministic mining bond
jackjack
Hero Member
*****
Offline Offline

Activity: 868


May Bitcoin be touched by his Noodly Appendage


View Profile
August 18, 2011, 01:31:52 PM
 #6

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

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Jimmy2011
Hero Member
*****
Offline Offline

Activity: 566



View Profile
September 08, 2011, 11:49:24 AM
 #7

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)

Bitcoin:1EBxhCQp2bUdQDZoQsix6vnivtr3EodCdP       Peercoin:PEjCk5P7FDTFbt3ZwtLPqsGpnQSRSTYRJX
Sekioh
Full Member
***
Offline Offline

Activity: 163


FirstBits: 1sekioh


View Profile
September 08, 2011, 01:00:45 PM
 #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"
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!