Skip to content

Create, rent DVDs, Books, etc. Save/read them to/from a JSON file. It may need some restructure, but it works. This is an old project for my University.

Notifications You must be signed in to change notification settings

TasoulasTheofanis/Media-Store-in-Java-Implemented-with-Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Media-Store-in-Java Implemented with Blockchain

This is a simple program in Java for renting movies, books, videos, music. It implements a blockchain logic to log all the transactions done.

You can create a user who will have his own Digital wallet (private key and public key) and will be able to rent a media for 1 dollar. Each session (starting and closing the application) will create a block. A block will contain all transactions made (rental or return). The admin user is the one who gets paid and he will be able to see the users and the blockchain that has been created. The program briefly consists of:

Media class: title, type (book, movie, etc), length, genre, description, artists, averageRating, ratingsCount Block class: contains properties such as id, nonce, timeStamp, hash, previousHash list of transactions. CryptographyHelper class: provides methods for hashing data, generating key pairs using ECDSA, and applying/verifying digital signatures using ECDSA. Transaction class: each transaction consists of Id, sender (the user who rents, returns), the receiver (always the admin), signature, action (rent, return), title of media. Wallet class: privateKey and publicKey, which are generated by java package. User class: name, email, password, balance.

The blockchain will be the set of blocks, with the further purpose of ensuring the integrity of transactions and ensuring their undesired modification. User data (except the wallet), blocks and transactions will be stored in json files. User passwords will be hashed on the JSON file.

After importing the project to your IDE (Eclipse, Visual Code, etc.), you may need to configure the build path.

After that, run the app.java application and login (All passwords are 1234 for the users. Admin's password is 12345. You can see Users on the JSON file.)

As admin you can view the blockchain and the users' data by pressing 7.

In order to rent a media you need balance (in USD) greater or equal to 1. Otherwise, add balance. You may also return Medias.

About

Create, rent DVDs, Books, etc. Save/read them to/from a JSON file. It may need some restructure, but it works. This is an old project for my University.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages