This project is an example of using a client and server to facilitate transfers between different addresses. 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.
We have taken private key of the user and used that key for signing the hex message that contains sender address, recipient address, amount and nonce. nonce is used for restricting the 'Replay Attack'.
On server side we do not send the private key due to security concern, that's why we have sent signed message and the original hex message that will be used for recovering the account address. After the address is retrieved, the funds can be send to the recipient address if sender has enough funds.
The client folder contains a react app using vite. To get started, follow these steps:
- Open up a terminal in the
/client
folder - Run
npm install
to install all the depedencies - Run
npm run dev
to start the application - Now you should be able to visit the app at http://127.0.0.1:5173/
The server folder contains a node.js server using express. To run the server, follow these steps:
- Open a terminal within the
/server
folder - Run
npm install
to install all the depedencies - 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.