Which data structure to prefer to model a blockchain?

+1 vote
I am working on Scala to implement mini-Blockchain, but I am not able to figure out a suitable data structure to model a Blockchain.

Can somebody tell me the most preferred database to implement my blockchain (considering the limitations and security conditions that exist in blockchain)
Apr 20, 2018 in Blockchain by anonymous

edited Aug 9, 2018 by Omkar 49 views

1 answer to this question.

+1 vote
Best answer

To start with, let me tell you blockchain in itself is a data structure. A back-linked list of records.

If we take an example of bitcoin, the blockchain of which is stored in levelDB, which uses a key-value pair database, however you can also consider couch DB.

Hash map is also an option you can consider which is an in-memory data structure,here, the key is a hash of the contents (such as a block header). From there, the header's Merkel root would point to another hash map of transactions arranged in a Merkle tree (as per the protocol).

answered Apr 20, 2018 by Perry
• 17,020 points

selected Aug 9, 2018 by Omkar

Related Questions In Blockchain

+1 vote
1 answer

I would like to create a blockchain network which will stay at the same level of complexity, is it possible?

You can very easily create a cryptocurrency having a ...READ MORE

answered Apr 4, 2018 in Blockchain by Christine
• 15,790 points
52 views
0 votes
1 answer

How to explore and analyze the data inside a Hyperledger Blockchain network?

In Hyperledger Composer, you have all the ...READ MORE

answered Aug 10, 2018 in Blockchain by Christine
• 15,790 points
121 views
+1 vote
3 answers

Is it possible to store data about arbitrary objects on the blockchain using smart contracts?

Consider following tutorial from Hyperledger Fabric "Getting Started" pages. Basically ...READ MORE

answered Aug 30, 2018 in Blockchain by Artem
115 views
0 votes
1 answer

How to make sure transactions take no fee in a private Ethereum blockchain?

In a private ethereum network you have ...READ MORE

answered Mar 26, 2018 in Blockchain by Christine
• 15,790 points

edited Mar 26, 2018 by Christine 109 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
77 views
+1 vote
1 answer
0 votes
1 answer

How to retrieve data from a block to a blockchain?

web3.eth.getTransaction(txHash) will returns transaction details like blockHash, transactionIndex, ...READ MORE

answered Jun 26, 2018 in Blockchain by Perry
• 17,020 points
161 views
0 votes
1 answer

How secure is to implement blockchain at a smaller scale??

Blockchain relies on the number of nodes ...READ MORE

answered Apr 18, 2018 in Blockchain by Perry
• 17,020 points
36 views