Week 1 project submission for the Alchemy University Blockchain Developer Bootcamp.
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.
I have added the following features:
- Generating new private keys through random private key generation
- Using Ethereum-style 20 Byte addresses derived from the public key
- Balances are public: Anyone can see anyone's balance by typing in their address
- Funds can only be sent by submitting a valid signature to the server. In order to generate a signature, the sender has to use their private key. The server recovers the signer's address from the signature and only transfers the amount if signer has enough funds.
- The private key is never submitted to the server
The client folder contains a react app using vite. To get started, follow these steps:
- Open up a terminal in the
/clientfolder - Run
npm installto install all the depedencies - Run
npm run devto 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
/serverfolder - Run
npm installto install all the depedencies - Run
node indexto start the server
The application should connect to the default server port (3042) automatically!