Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objectives: The objectives of this programming project include 1 ) design the structure of a blockchain; 2 ) demonstrate the structure in each node of
Objectives: The objectives of this programming project include design the structure of
a blockchain; demonstrate the structure in each node of a blockchain; illustrate the
usage of hashed pointer in a blockchain; describe how blockchain works;
understand digital signature; explore the reason that a blockchain can be selfverified.
Description: In this project, you are required to make a java code to build a blockchain
including multiple blocks. In each block, it contains a list of transactions, previous hash
the digital signature of the previous block, and the hash of the current block which is
based on the list of transactions and the previous hash. If anyone would change anything
with the previous block, the digital signature of the current block will change. When this
changes, the digital signature of the next block will change.
Detailed Requirements:
Define your block class which contains three private members and four public
methods.
a Members: previousHash int transactions String and blockHash int;
b Methods:
i Block int previousHash, String transactions
ii getPreviousHash
iii. getTransaction
iv getBlockHash
Using ArrayList to design your Blockchain.
Your blockchain must contain genesis block and make it to be the first block.
You can add a block to the end of the blockchain. When a new block is added, it first
must point to the last block in your blockchain, and can allow a user to add any
number of transactions until the user click done
In each transaction, please use the following format Santoshi sender pays x
number BTC to Ivan receiver Put each transaction in a string.
You can display the transactions, previous hash, and the current hash of any selected
block. Please use to select a block. indicates the genesis block. If a
selected block does not exist, please display the block does not exist in this
Blockchain
Edit the transactions in a selected block, but you must verify and show it will break
the consistency with the previousHash in the block after this block.
Display the whole blockchain with the contents in each block.
Submission through DL Dropbox zip the following into one file for submission:
Two screenshots to show the running results. points
Read me with name readmetxt to show how to runoperate your code. points
Java source code. points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started