Bitcoin Forum
November 22, 2017, 12:02:18 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Where transaction's hashes are stored?  (Read 743 times)
smemo92
Newbie
*
Offline Offline

Activity: 12


View Profile
September 17, 2014, 01:37:38 PM
 #1

Hi, I'm tryng to understand how transactions works and how they are organized. I understand the structure of a transaction, made up of a list of input and output https://en.bitcoin.it/wiki/File:TxBinaryMap.png .
First 32 bytes of tx input are the hash of the previous transaction (and then 4 bytes of index), that is the transaction where there is the unspent output that I use as input in this transaction. This is the idea, right?
But in transaction structure there is no hash field, transaction are stored in blocks, and blocks have their own hash and the merkle root hash.
I can't understand how with transaction hash we can check if in that transaction there is an unspent output.
How can i find a transaction from its hash if it isn't stored anywhere?

I've also read that there is a structure that contains all utxo but i can't find detail about that.
1511352138
Hero Member
*
Offline Offline

Posts: 1511352138

View Profile Personal Message (Offline)

Ignore
1511352138
Reply with quote  #2

1511352138
Report to moderator
1511352138
Hero Member
*
Offline Offline

Posts: 1511352138

View Profile Personal Message (Offline)

Ignore
1511352138
Reply with quote  #2

1511352138
Report to moderator
1511352138
Hero Member
*
Offline Offline

Posts: 1511352138

View Profile Personal Message (Offline)

Ignore
1511352138
Reply with quote  #2

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

Posts: 1511352138

View Profile Personal Message (Offline)

Ignore
1511352138
Reply with quote  #2

1511352138
Report to moderator
1511352138
Hero Member
*
Offline Offline

Posts: 1511352138

View Profile Personal Message (Offline)

Ignore
1511352138
Reply with quote  #2

1511352138
Report to moderator
fbueller
Sr. Member
****
Offline Offline

Activity: 412


View Profile
September 17, 2014, 01:44:14 PM
 #2

For your current transaction, the txid is just SHA256d of the whole transaction. this is why transactions are malleable, as any change produces a different hash.

The 'inputs' txids are stored in the transaction, but are in little endian notation so you may not recognize it immediately if you stare at a raw transaction hex..

Bitwasp Developer.
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!