webaverse / weba-wallet

0 stars 2 forks source link

Basic wallet structure using web worker #5

Closed hamzatrq closed 2 years ago

hamzatrq commented 2 years ago

This commit adds a folder named worker in the repo. worker folder contains the basic wallet structure for the weba-wallet using a web worker to create a secure context. On function call a worker is created and stored as a private variable inside the parent function. This stops the scripts from directly manipulating the worker.

The worker when created expects the login function to be called first. Once called the worker will send the code and discord id to the server and will fetch the mnemonic. The fetched mnemonic never gets sent to the DOM and lives in the worker.

All the necessary functions needs to be written inside the worker so that mnemonic never gets shared.