Bitcoin Forum
September 24, 2021, 11:44:09 PM *
News: Latest Bitcoin Core release: 22.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Merkle root, hashing and other stuff - need little help.  (Read 4046 times)
kstepyra
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
May 23, 2011, 05:51:34 PM
 #1

Hi,

I am making an presentation about BTC's, and i am stuck in hashing blocks.
As far as i know - blocks contain informations about transactions, prev. hash, actual hash and merkle root of transactions(and other stuff which can be checked in blockexplorer ie.).
Problem is in - how and WHEN is the merkle root computed, and how is new hash computed?

I mean - it's like this? :

hash of block n+1 = hash(hash of block[n] + merkle root of transactions from current block(transaction[0] + transaction[1] +...+ transaction[n]) + nonce)

?
When any transaction appears in the network - what happens? It automatically change merkle root that is put into hashing algorithm to find number under desired target?
Or how does it go?

and how is transaction validation working? for example i've got 50 coins from block 10000 and now it's block 130000 and i want to spend it for something.
program check for all blocks between 10k and 130k that i actually own that money? and how he does that? step by step will be nice

Thanks for any advice:)

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

Posts: 1632527049

View Profile Personal Message (Offline)

Ignore
1632527049
Reply with quote  #2

1632527049
Report to moderator
1632527049
Hero Member
*
Offline Offline

Posts: 1632527049

View Profile Personal Message (Offline)

Ignore
1632527049
Reply with quote  #2

1632527049
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 4242
Merit: 8721


View Profile
May 24, 2011, 01:07:05 AM
 #2

Read more wiki.

How the Merkle root is calculated:
https://en.bitcoin.it/wiki/Dump_format#CBlock

When it's calculated:
https://en.bitcoin.it/wiki/Block_hashing_algorithm

Transaction verification:
https://en.bitcoin.it/wiki/Transactions

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
kstepyra
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
May 24, 2011, 07:59:52 PM
 #3

Awesome response, thanks a lot Smiley hope this project stays a lot of time.
ElectricMucus
Legendary
*
Offline Offline

Activity: 1666
Merit: 1057


Marketing manager - GO MP


View Profile WWW
August 19, 2011, 11:04:53 PM
 #4

I'm sorry to bump this but the documentation on the wiki is vague at best. Is there a more throw thing somewhere or do I have to read the code to understand how the format works?

thanks!
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!