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 2,770 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 21, 2018 by Perry
• 17,100 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
877 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
1,346 views
0 votes
1 answer

Best database type to store data that will be used with a blockchain?

Storing just the hash on the blockchain ...READ MORE

answered Apr 7, 2022 in Blockchain by Aditya
• 7,680 points
1,176 views
+1 vote
3 answers

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

Basically you implement requested logic on by ...READ MORE

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

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,470 views
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,740 points
1,037 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 27, 2018 in Blockchain by Perry
• 17,100 points
3,984 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,100 points
833 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP