od41 / secure-digital-server-learning-project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Secure Digital Payments Server

This project is an example of using a client and server to facilitate transfers between different addresses. Since there is just a single server on the back-end handling transfers, this is clearly very centralized. We won't worry about distributed consensus for this project.

However, something that we would like to incoporate is Public Key Cryptography. By using Elliptic Curve Digital Signatures we can make it so the server only allows transfers that have been signed for by the person who owns the associated address.

Instructions

  • You SHOULD NOT send the private in the payload to the server
  • The signed message and the message object as part of the payload from client to server.
  • Pass any additional data you might need.

Client

The client folder contains a react app using vite. To get started, follow these steps:

  1. Open up a terminal in the /client folder
  2. Run npm install to install all the depedencies
  3. Run npm run dev to start the application
  4. Now you should be able to visit the app at http://127.0.0.1:5173/

Server

The server folder contains a node.js server using express. To run the server, follow these steps:

  1. Open a terminal within the /server folder
  2. Run npm install to install all the depedencies
  3. Run node generate.js to generate a few private keys & addresses with balances of 200
  4. Run node index to start the server

The application should connect to the default server port (3042) automatically!

Hint - Use nodemon instead of node to automatically restart the server on any changes.

About


Languages

Language:JavaScript 75.5%Language:SCSS 19.5%Language:HTML 5.0%