Bitcoin Forum
May 10, 2024, 09:30:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to parse blocks  (Read 641 times)
Radacoin (OP)
Sr. Member
****
Offline Offline

Activity: 255
Merit: 250


View Profile
April 30, 2013, 12:52:01 PM
 #1

Hi guys,

can you please point me to the right direction on how to parse blocks? Block format, what the blocks, chainstate, database directories are for. Stuff like that.

P.S.
I know how to read code (C, Java, ...).

1715376600
Hero Member
*
Offline Offline

Posts: 1715376600

View Profile Personal Message (Offline)

Ignore
1715376600
Reply with quote  #2

1715376600
Report to moderator
1715376600
Hero Member
*
Offline Offline

Posts: 1715376600

View Profile Personal Message (Offline)

Ignore
1715376600
Reply with quote  #2

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

Posts: 1715376600

View Profile Personal Message (Offline)

Ignore
1715376600
Reply with quote  #2

1715376600
Report to moderator
1715376600
Hero Member
*
Offline Offline

Posts: 1715376600

View Profile Personal Message (Offline)

Ignore
1715376600
Reply with quote  #2

1715376600
Report to moderator
nevafuse
Sr. Member
****
Offline Offline

Activity: 247
Merit: 250


View Profile
April 30, 2013, 01:51:26 PM
Last edit: April 30, 2013, 02:50:47 PM by nevafuse
 #2

If you can read C++, then you can probably just look at the bitcoin-qt source code...https://github.com/bitcoin/bitcoin

Otherwise the wiki may give you a better summary of how the block is parsed...https://en.bitcoin.it/wiki/Blocks

https://en.bitcoin.it/wiki/Bitcoind#Theory_of_Operation

The only reason to limit the block size is to subsidize non-Bitcoin currencies
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
April 30, 2013, 04:11:11 PM
 #3

Here's a good resource for understanding the basic structure of a block:

http://james.lab6.com/2012/01/12/bitcoin-285-bytes-that-changed-the-world/
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
April 30, 2013, 04:32:06 PM
 #4

I haven't upgraded to 0.8 on my development box yet, so I haven't had a need to peer into the new block files.  Are they the same format as the old ones, just smaller, or did they get changed?

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
April 30, 2013, 07:33:27 PM
 #5

I haven't upgraded to 0.8 on my development box yet, so I haven't had a need to peer into the new block files.  Are they the same format as the old ones, just smaller, or did they get changed?

Same format.
Radacoin (OP)
Sr. Member
****
Offline Offline

Activity: 255
Merit: 250


View Profile
May 02, 2013, 07:25:05 AM
Last edit: May 02, 2013, 11:31:48 AM by Radacoin
 #6

Thanks a lot guys.

Question: I thought the difficulty is also included in the blocks - but it seems not.

How can I calculate (historic) difficulty?

Reason I'm asking this: I wanna set up some charts for Alt-Coins.


edit: Found it myself: https://en.bitcoin.it/wiki/Difficulty#How_is_difficulty_stored_in_blocks.3F
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!