CSC 438 Blockchain Systems - Programming Project
CSC 438 Blockchain Systems - Programming Project
Programming Project
Khaleel Mershad
Spring 2025
Programming Project
During the course lectures, we implemented a basic blockchain system using the Java pro-
gramming language. In this project, we created Java classes for the blockchain Transaction,
Block, Wallet, and Transaction Input and Output. Our blockchain system is able to create
simple cryptocurrency transactions that consume previous UTXOs and create new UTXOs.
We wrote the Java code that enables a user to create a new transaction, select the required
UTXOs that he/she owns, generate the transaction inputs, and sign the transaction. We
also created the code that enables a miner to process and validate the transaction before
adding it to the new block. Furthermore, we wrote the code that creates a new block by
combining several transactions into a Java ArrayList and generating the Merkle root of the
selected transactions. After that, the block is mined using the specified difficulty before it
is added to the blockchain. Finally, we wrote the code of the Wallet class that generates
a public/private key pair for the wallet owner and uses them to create and sign each new
transaction. We tested our blockchain system by creating sample wallets and transferring
currency between them.
As part of the “CSC438 Blockchain Systems” course requirements, you will be extending
the described project and submitting the extension as your course project. You can start
working on this assignment directly after the last lab is covered in the course lectures, and
submit it by the end of the last week of the semester. Hence, for the Spring 2025 semester,
the deadline for submitting this project is Friday, May 2, 2025.
Based on the Blockchain system that we created in this course, you are required to modify
the Java code to create a more advanced blockchain system. Sample ideas that you can
implement are listed below:
1. Implement a Client-Server system and divide the blockchain operations into client and
server. Users who generate transactions and broadcast them act as clients while Miner
nodes that receive transactions and create blocks act as servers. Each node has the
option to act as a client, server, or both.
2. Provide a secure method to store the private key in the system.
3. Modify the signature that we implemented in the labs to make it more realistic, re-
sembling the Bitcoin signature model.
4. Add the concept of transaction fees into the transaction and adjust the whole system
to support it. You can make the user define the amount of fee he/she wants to add
per byte.
5. Add the concept of the coinbase transaction to enable the miner to collect the block
reward. This can be done in conjunction with or separate from the previous point
(transaction fees).
6. Add the concept of Locking and Unlocking scripts to enable only the owner of a UTXO
to use it in a transaction. You can use the same approach in Bitcoin Script or any
suitable approach that achieves the same objective.
7. Add a method to adjust the difficulty automatically based on the average time of the
last n blocks (for example, n = 10).
8. Modify the Wallet class to enable each user to store multiple accounts in his/her wallet.
A transaction can be created by combining UTXOs from multiple accounts in the same
wallet, if needed.
9. Enable the user to store Big data in the blockchain by connecting your system to an
external data storage (for example, MongoDB), saving the data off-chain, while saving
the hash of each data item and its location in the blockchain transactions.
10. Add one or more defense mechanisms to defend the blockchain against the most famous
blockchain attacks, such as double spending, 51%, and replay attacks.
11. In addition to any modifications that improve the blockchain system and make it more
realistic and similar to real-life cryptocurrencies.
Note that the number and level of improvements that you are required to do depends on
the number of students in the group. If the project is being done by a single student, then
two/three additions are sufficient to obtain a very good grade (if implemented correctly and
efficiently). In general, the more number of students in the group, the larger the number of
changes and their levels are expected to be.
Please note that you are required to add a table to your submitted report that
identifies which features you added to the project. For each added feature, you
are required to identify in the table the student(s) who worked on implementing
that feature.
Most importantly, you are required to write the code yourself. Any copying
from the projects of other students (for example, from previous semesters) will
be detected by the instructor and you will receive a zero grade.
Requirements
• You are required to test each of the features that you added to the blockchain project
by designing and implementing suitable testing scenarios in the Driver class.
• In the report, you are required to explain the details of the modifications that you did
to the project code to implement each feature that you added, and the scenarios that
you executed to test each feature. In addition, you should show, via screenshots, the
outputs that you obtained for each scenario, and discuss them accordingly.
Submission Requirements
Before the project deadline, you are required to submit the following:
• Updated Code of the Blockchain Project: You are required to update the code,
combine all the old, updated, and new Classes of the project into a ZIP file, and include
it in the submission.
• Project Report: Write a short Microsoft Word report that describes the updates
that you made to the code and shows the output that you obtained after running the
project. The report should also illustrate the description and testing of each feature
that you added to the project.