1

How are the blocks traversed? Is it using a linked list concept to traverse?

If I need to see all block details, will it traverse from the genesis block to the requested block or will it traverse from the last block to the requested block?

What is the next or previous link in all the blocks?

In case of mining, then from which block will it start to traverse to get the requested block?

q9f
  • 32,913
  • 47
  • 156
  • 395
userven
  • 201
  • 1
  • 2

1 Answers1

1

The logical data structure is that each new block commits to the hash of the previous block, so you can think of it like a singly linked list. See What is the exact data structure of each block?, or Ethereum block architecture for some nice diagrams.

If you sync and validate the blockchain from scratch you will also follow this order, so you start with the genesis block, and add each new block on top of it.

However, the data structures for storing this in any given piece of software will depend on that particular software.

Edmund Edgar
  • 16,897
  • 1
  • 29
  • 58