For a blockchain parser, is it correct to say that "for X magicbytes sequences, we have X blocks in blockchain" ?
In other words, may blocks in blockchain accidentally contain magicbytes sequences ?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
A blockchain is an abstract datastructure that contains a chain of blocks, consisting of hash-linked he headers and transactions.
If you're talking about a parser, I assume you're talking about files on disk... perhaps the blk*.dat files in Bitcoin Core's data directory. Those are just one way to represent the blockchain, and it's an implementation specific one that can change between releases.
Assuming you're indeed asking about the disk representation of blocks in Bitcoin Core (or similar software):
Furthermore, the term 'blockchain' is often interchangably used for both the tree of all blocks produced/known, or for the longest path through it. The block files on disk contain all blocks Bitcoin Core has ever seen, including blocks that are not part of the main chain ("orphan blocks") and were stale or reorganized out.