PIVX-Labs / MyPIVXWallet

Send, Stake and Receive with PIVX's most universal wallet.
https://mypivxwallet.org/
MIT License
30 stars 36 forks source link

Modernizing MPW codebase #32

Open weoka opened 2 years ago

weoka commented 2 years ago

I was going to create an issue to bring masternodes support, but then I realized we need HD wallet support to make that happen.

I was then going to create an issue to bring HD support to the wallet, then I thought probably the quickest way of doing this would be using bip39.js to generate and validate seed phrases and then using elliptic/crypto to get private keys.

Then I realized there is no node/building support at the moment, which gives us two options:

I'm not a fan of either, so I'd say there is a need to modernize the codebase to current web standards.

And I do not only mean for dependencies management but as a whole. For example, as features get added, the frontend will also gain new tabs and sections, and piling them all into a single index.html will not be an option for maintenance's sake.

I suggest applying MVC standards where we can separate components from a logical and visual perspective, making it more comprehensive for new developers and easier to maintain in general.

There are several options for this, but I think using VUE would be the best fit compared to applying the pattern ourselves or using any other frontend framework/library.

The main reason is that VUE syntax and architecture is probably the easiest to incorporate, and it works out of the box with Vite, a module bundler 10x faster and better optimized than Webpack.

VUE will allow us to avoid this kind of unnecessary boilerplate:

image

This way will also make it super easy to create web-based mobile builds.

Of course, this can't just be merged into the current codebase, so the idea would be to start over on a new repo, MPW v2, or something like that.

Duddino commented 2 years ago

I know jskitty has been working on rewriting parts of the code in rust, which would solve some of these issues (We can use rust libraries compiled to wASM).

JSKitty commented 1 year ago

As of today we've completed the full implementations of BIP32 (HD), BIP39 (Seed Phrases), Masternodes and Governance.

Now that there shouldn't be "as-substantial" PRs in the near future, we'll start working on plans to standardise the codebase, with full style guides, slowly port over to modern web standards, CI automation (enforcement and assistance), and well, make the codebase as auditable and maintainable as possible. Yay! :rocket: :purple_heart:

Wen DogeCash fork? :dog: