Answered step by step
Verified Expert Solution
Link Copied!

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 1) design the structure of
a blockchain; 2) demonstrate the structure in each node of a blockchain; 3) illustrate the
usage of hashed pointer in a blockchain; 4) describe how blockchain works; 5)
understand digital signature; 6) explore the reason that a blockchain can be self-verified.
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:
1. 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(){}
2. Using ArrayList to design your Blockchain.
3. Your blockchain must contain genesis block and make it to be the first block.
4. 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
5. In each transaction, please use the following format Santoshi (sender) pays x
(number) BTC to Ivan (receiver). Put each transaction in a string.
6. You can display the transactions, previous hash, and the current hash of any selected
block. Please use 1,2,3,... to select a block. 1 indicates the genesis block. If a
selected block does not exist, please display the block does not exist in this
Blockchain.
7. 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.
8. Display the whole blockchain with the contents in each block.
Submission through D2L Dropbox (zip the following into one file for submission):
1. Two screenshots to show the running results. (5 points)
2. Read me with name readme.txt to show how to run/operate your code. (5 points)
3. Java source code. (90 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago