Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Blockchain a single linked list?

Seen as datatype, is Blockchain a single linked list? As each block refers to the previous block using a hash.
Or is it some kind of tree?

like image 331
tuuttuut Avatar asked Dec 18 '17 13:12

tuuttuut


People also ask

Is the blockchain a singly linked list?

Are Blockchains Related to Linked Lists? Blockchains can be represented as a singly linked list. While they have a close structure to that of a linked list, they are not a linked list. A linked list is a programming language data structure.

Why is blockchain a linked list?

A linked list is a linear way of arranging and storing data. Blockchains, for example, have Merkle Trees to store transactions and all the data related to the transactions. Moreover, these Merkle trees (or blocks) have a link to their parent hash with the unique hash number.

Is blockchain a single chain?

The Bitcoin blockchain converges to a single-file chain because each block references exactly one predecessor, and thus there can only be one block at every height in the chain connecting the genesis block and the chain-tip. However, at times more than one block will be found at the same height.

What kind of data structure is blockchain?

The blockchain data structure is an ordered, back-linked list of blocks of transactions. The blockchain can be stored as a flat file, or in a simple database. The Bitcoin Core client stores the blockchain metadata using Google's LevelDB database.


1 Answers

The way a blockchain is represented as a singly linked list. Each block has a hash of the previous block which can be thought of as a pointer to previous block.

Some differences are that in a linked list, there are generally more operations for a linked list that are not available in a blockchain, most notably being able to remove a block and to add a block in the middle of the list/chain.

In the bitcoin blockchain, and probably others, each transaction in the block is stored in a Merkle Tree. The blockchain is not a tree.

like image 84
DFord Avatar answered Oct 11 '22 14:10

DFord