Title: What is the blockchain like ? Post by: cyberguy on June 06, 2016, 06:23:29 AM please excuse me for the noob like question. But I am asking since I use Electrum and do not run bitcoin-core.
In what form does the blockchain exist on full nodes, is it as a single file or a collection of files ? If more than 1 file are they numbered in any way ? I am almost certain it is not a single 60+ GB file, since all OSes may not support that. Does the actual blockchain contain extra data besides the actual blocks (meta data for indexing etc.)? Title: Re: What is the blockchain like ? Post by: achow101 on June 06, 2016, 11:55:33 AM For Bitcoin Core and its derivatives, the blockchain is stored as multiple files, around 130 Mb each. The blocks are stored on the disk in their serialized format. The extra data for each block are the 4 network magic bytes and a varint the indicates the block size in bytes. Those data files are append only. There are additional files which index the locations of each block as well as undo data for those indices because everything is append only.
Title: Re: What is the blockchain like ? Post by: cyberguy on June 07, 2016, 12:42:07 PM For Bitcoin Core and its derivatives, the blockchain is stored as multiple files, around 130 Mb each. The blocks are stored on the disk in their serialized format. The extra data for each block are the 4 network magic bytes and a varint the indicates the block size in bytes. Those data files are append only. There are additional files which index the locations of each block as well as undo data for those indices because everything is append only. Thanks, could you please guide me to some place where I can find some information regarding the content and structure of these files, how they are numbered, the default locations they are saved in (for Windows, Linux etc.) ? Title: Re: What is the blockchain like ? Post by: Cent21 on June 07, 2016, 12:57:39 PM I am almost certain it is not a single 60+ GB file, since all OSes may not support that. You are right when you write tha blockchain is not in a single file, as other have explain it is splitted in many smaller files. You are wrong when you write that all OSes may not support them... in fact maximum file size depends by the type of filesystem that you use on your drives... and also the old implementation of NTFS filesystem (used since windows NT version) has a maximum file size of about 16TB. Nowadays, on windows systems, is commonly in use NTFS5 which has a maximum file size of about 16 ExaBytes. :) Title: Re: What is the blockchain like ? Post by: achow101 on June 07, 2016, 01:13:30 PM For Bitcoin Core and its derivatives, the blockchain is stored as multiple files, around 130 Mb each. The blocks are stored on the disk in their serialized format. The extra data for each block are the 4 network magic bytes and a varint the indicates the block size in bytes. Those data files are append only. There are additional files which index the locations of each block as well as undo data for those indices because everything is append only. Thanks, could you please guide me to some place where I can find some information regarding the content and structure of these files, how they are numbered, the default locations they are saved in (for Windows, Linux etc.) ? Title: Re: What is the blockchain like ? Post by: DannyHamilton on June 07, 2016, 02:32:42 PM I am almost certain it is not a single 60+ GB file, since all OSes may not support that. You are right when you write tha blockchain is not in a single file, as other have explain it is splitted in many smaller files. You are wrong when you write that all OSes may not support them... in fact maximum file size depends by the type of filesystem that you use on your drives... and also the old implementation of NTFS filesystem (used since windows NT version) has a maximum file size of about 16TB. Nowadays, on windows systems, is commonly in use NTFS5 which has a maximum file size of about 16 ExaBytes. :) I think you misunderstood the OP. When he said: since all OSes may not support that. I'm pretty sure that he meant: "That may not be supported by all Operating Systems". Meaning that there are some Operating Systems that won't support sizes that large (60GB) for a single file. I think in that case that the OP is NOT wrong. Title: Re: What is the blockchain like ? Post by: cyberguy on June 07, 2016, 02:52:22 PM I'm pretty sure that he meant: "That may not be supported by all Operating Systems". Meaning that there are some Operating Systems that won't support sizes that large (60GB) for a single file. you are correct, this is what i meant by that statement. However, on second thoughts, I realize that only filesystems such as FAT16 and FAT32 will not be able to handle that file size. (FAT16 cannot even have a partition larger than 2GB) Generally, even someone still running Windows XP (definitely not recommended) can be expected to have it installed on a NTFS drive. Title: Re: What is the blockchain like ? Post by: CIYAM on June 07, 2016, 03:00:19 PM I still have an XP version running (although am pretty sure it is using NTFS) - the maximum size that I seem to see for any of the block files is 134 MB.
They are named as such: blk00000.dat blk00001.dat blk00002.dat ... The "reverse" files are named as such: rev00000.dat rev00001.dat rev00002.dat ... (and are much smaller) Title: Re: What is the blockchain like ? Post by: cyberguy on June 07, 2016, 03:27:38 PM I still have an XP version running (although am pretty sure it is using NTFS) - the maximum size that I seem to see for any of the block files is 134 MB. They are named as such: blk00000.dat blk00001.dat blk00002.dat ... The "reverse" files are named as such: rev00000.dat rev00001.dat rev00002.dat ... (and are much smaller) thanks for the response. Googling for the above file names took me to a reddit link mentioning an article "Bitcoin: 285 bytes that changed the world", which was published 4 years ago, and is no longer available. However, I found it in the internet archive and it contains exactly what I was looking for. For those interested https://web.archive.org/web/20140213190023/http://james.lab6.com/2012/01/12/bitcoin-285-bytes-that-changed-the-world/ (https://web.archive.org/web/20140213190023/http://james.lab6.com/2012/01/12/bitcoin-285-bytes-that-changed-the-world/) Title: Re: What is the blockchain like ? Post by: Jet Cash on June 11, 2016, 06:19:09 AM Don't forget that SegWit will add some extra files.
|