https://github.com/nakov/client-side-ethereum-wallet
Voting DApp with client-side Ethereum wallet. Implements register / login / logout / vote
https://github.com/nakov/client-side-ethereum-wallet
authentication client-side encryption ethereum wallet
Last synced: about 1 year ago
JSON representation
Voting DApp with client-side Ethereum wallet. Implements register / login / logout / vote
- Host: GitHub
- URL: https://github.com/nakov/client-side-ethereum-wallet
- Owner: nakov
- License: mit
- Created: 2018-04-19T06:53:23.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-22T21:59:44.000Z (over 7 years ago)
- Last Synced: 2025-04-05T05:51:12.218Z (about 1 year ago)
- Topics: authentication, client-side, encryption, ethereum, wallet
- Language: JavaScript
- Size: 133 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Client-Side Wallet - Demo
Play with the demo now: https://client-side-wallet-demo.herokuapp.com
This demon example demonstrates how to build a simple DApp (Voting) with client-side Ethereum wallet. Based on Solidity smart contract and client-side UI (JS + jQuery + Ethers.js) + server-side account management (Node.js + Express + simple REST API). The wallet is encrypted in UTC / JSON format (both private key + mnemonics are encrypted with AES-CRT-128 using SCrypt key derivation).
- The app implements register / login / logout / vote.
- Candidates and votes stay in Solidity contract on the Ropsten testnet.
- Users register in the system and get a wallet (private key + address)
- The wallet JSON is stored after strong encryption at the server side
- The wallet password / private key never leave the client app
- User login -> download the encrypted wallet JSON from the server
- After login / register, keep the encrypted wallet JSON in the browser session
- Logout -> clear the browser session
- Use different passwords for server login and for the wallet
- Wallet password (client-side): HMAC(password, username + 'wallet')
- Server password (wallet id): HMAC(username, password + 'server')
- Lost password cannot be recovered / reset -> use the mnemonics
- Based on the Ethers.js library
## Project Structure
This DApp example is based on JavaScript (server-side + client-side)
- `public` - holds the client-side JS app
- `src` - holds the server-side Node.js app
- `contract` - holds the `Voting` solidity contract, published at https://ropsten.etherscan.io/address/0x121241C506ebb1d04A4d8d355D37aC9fd06361de
## Running the Demo
1. Download the demo from GitHub:
```
git clone https://github.com/nakov/client-side-ethereum-wallet
```
2. Go to the project directory:
```
cd client-side-ethereum-wallet
```
3. Install the NPM packages
```
npm install
```
3. Run the server
```
npm start
```
4. Open the project URL from your Web browser:
```
http://localhost:80
```
## Slides and Videos
Slides:
- https://www.slideshare.net/nakov/clientside-wallets-in-dapps-nakov-blockworld-2018-san-jose
Videos:
- https://youtu.be/Wi9nZNUC_B8 (in Bulgarian language, Ethereum meetup, Sofia)
- https://youtu.be/7b3Pr7DMSMc (in English, at Microsoft Singapore)
- https://youtu.be/_E_HPGbDRmk (in English, from BlockWorld 2018, San Jose)