Bitcoin Forum
April 24, 2024, 03:20:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Where transaction's hashes are stored?  (Read 803 times)
smemo92 (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


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.
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!