Bitcoin Forum
May 10, 2024, 06:29:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Merkle root, hashing and other stuff - need little help.  (Read 4069 times)
kstepyra (OP)
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
1715365799
Hero Member
*
Offline Offline

Posts: 1715365799

View Profile Personal Message (Offline)

Ignore
1715365799
Reply with quote  #2

1715365799
Report to moderator
1715365799
Hero Member
*
Offline Offline

Posts: 1715365799

View Profile Personal Message (Offline)

Ignore
1715365799
Reply with quote  #2

1715365799
Report to moderator
1715365799
Hero Member
*
Offline Offline

Posts: 1715365799

View Profile Personal Message (Offline)

Ignore
1715365799
Reply with quote  #2

1715365799
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715365799
Hero Member
*
Offline Offline

Posts: 1715365799

View Profile Personal Message (Offline)

Ignore
1715365799
Reply with quote  #2

1715365799
Report to moderator
1715365799
Hero Member
*
Offline Offline

Posts: 1715365799

View Profile Personal Message (Offline)

Ignore
1715365799
Reply with quote  #2

1715365799
Report to moderator
1715365799
Hero Member
*
Offline Offline

Posts: 1715365799

View Profile Personal Message (Offline)

Ignore
1715365799
Reply with quote  #2

1715365799
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12982


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 (OP)
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!