@electrumsv is on PowPing!

PowPing is a place where you can earn Bitcoin simply by socializing, for FREE.
Never tried Bitcoin? It's OK! Just come, socialize, and earn Bitcoin.
Check out electrumsv's activities
Total Economy: 6.59 USD

On ElectrumSV, mobile and UI

One of the things I recently explored was the possibility that ElectrumSV could use a framework like Ionic or Flutter to move forward. The following article summarises my position on the likely path forward.

The main goal of this article is to summarise my current stance on this subject, so I hopefully have a clear picture to refer to as we get time to work on it. Having reread some of my past articles I am not so sure they have succeeded in that sense. Secondary goals are to solicit feedback. But there's a lot of work to do before we get to the point we are ready for this.

On Ionic

The core problem that ElectrumSV has is that it is written in Python. We had always planned to decouple the backend wallet server from the user interface, and have the user interface written in some form of Javascript and HTML. But let's consider one of the end goals, an iOS application. From what I understand, iOS is very limiting in terms of the application. So the idea that we might bundle the backend wallet server in the Ionic application, and run it in the background appear to be largely infeasible. Indeed doing so in any Android application might also be problematic.

Ionic also deploys to desktop targets, like MacOS and Windows. And in those cases, it is likely that we could get away with bundling the wallet server and running it in the background. But if it doesn't work for mobile, then this isn't a solution that works across the board.

So the conclusion is that we might very well consider Ionic for desktop, but for mobile we might have to come up with a different solution, perhaps even per-platform solutions.

On Electron Cash's mobile applications

Electron Cash has mobile applications for both iOS and Android.

What both of these do, is embed the main Python-based wallet code, and add a platform-specific user interface in front of it. This is in-process wallet support, with a user interface. It requires extra per-platform work both for development, and maintenance. The appeal of an approach like Ionic or Flutter, is that the user interface and code should largely be cross-platform.

On changing direction

The ideal of being able to bundle and run the Python-based backend wallet server and have a completely cross-platform user interface working on desktop, mobile and the web, is probably infeasible. So, what is the alternative?

I think there's a compelling argument for sticking with Ionic, and using React on the desktop, mobile and web. We can start with it using a remote wallet server you run yourself, just like the way we plan the web-interface and desktop interface to work.  And as we get more time we might flesh out Javascript wallet backend code to run directly on the mobile applications. I suspect the largest piece of work will be the code for the secure key storage on the devices, but that's just speculating.

On Windows builds

In the past, ElectrumSV (and Electrum Core and Electron Cash) have had problems with malware because the packaging tool we all use is also used by malware. This packaging tool is PyInstaller. For a while we solved the problem, as someone involved with Electron Cash came up with some code that changed the signature of the PyInstaller startup code. But it appears that every Windows build we make now gets flagged again in a range of different malware detection products.

I've spent a day prototyping a new custom Windows build, and it works and runs, but one problem.. it's over 200 megabytes in size. It turns out that PyInstaller has an analysis pass that strips out the unused parts, and restructures things so that the builds it makes with the same inputs come out to lower than a quarter of the size (and lower than one sixth compressed). Reproducing that code would be prohibitive.

The next step for the prototype is to try and invoke PyInstaller, and have it package the build, then see it it's feasible to replace it's startup executable with an generic embedded Python interpreter that uses our icon and invokes our replacement startup script.


The theory is that in the short term before we switch to very likely Electron-based Ionic wallet releases, this provides us with a way to do Windows releases that won't be classified as malware. If our code signing certificate comes through, this will mean that we should also be able to distribute a signed MSIX installer via the Windows store. For those that don't want to use the Windows store, we'll likely provide a zipped archive they can extract and run, and perhaps a signed downloadable installer.

And beyond that, we should be able to take the new build process and bundle it in the Electron-based release and run it alongside the Ionic UI which would use it as a local wallet server.

Summing up

So the loose plan for the specific topic of the future direction of release packaging for ElectrumSV currently looks the following:

  1. Decouple from PyInstaller's startup executable to solve the malware false positive problem hopefully once and for all. The Windows experience should be more polished and professional.
  2. Look to start prototyping an Ionic-based cross-platform UI.
  3. Get a wallet client APK working for Android as a proof of concept based on Ionic.
  4. Get Windows and MacOS Electron-based releases working as a proof of concept based on Ionic.
  5. Work out what is involved in accessing secure key stores on both Android and iOS platforms.

But as usual, we have a lot of things to work on and it gets done slowly. A lot of the things we have planned have been backlogged. The main focus is making sure the wallet as-is continues to work as reliably as possible.

-- rt12

powered by powpress
link Tip
Share
tx
translate
kamk tipped:
0.25 USD
1 year ago
mx1up tipped:
0.14 USD
1 year ago
musiq tipped:
0.04 USD
1 year ago
unwriter tipped:
0.06 USD
1 year ago
ben tipped:
6.01 USD
1 year ago
Have a beer on me as you just rock Roger!
This sounds like a very exciting initiative regardless of what tech is used. Looking forward to it!
If you're gonna do react on desktop why not just use react native on mobile?
electrumsv replied:
The whole point is to find a solution that minimises work on different platforms. We do not have the time to do two solutions.
musiq replied:
Yeah that's why i brought up react. There are ways to share code between react and react native https://codeburst.io/reusing-code-between-react-js-and-react-native-effectively-12bb4fbf7a70 You just need to replace components. I guess ionic can be good too. Just sharing in case you do react on desktop.
electrumsv tipped:
0.12 USD
1 year ago
electrumsv replied:
Ionic is mostly react already I think, so if we can get away with using react in a standard way between platforms it helps us effectively balance limited resources. Thanks for the link, even if we don't plan to do react native, it is very likely that we would benefit from leaving the door open to react native in how we use it (if possible in Ionic). --rt12
musiq replied:
No problem! Oh I had no idea ionic uses react nowadays. Just looked it up and it looks like it really is! I remember them being based on Angular in the early days.
cog replied:
I have used react native on mobile. It isn't perfect and you do end up with two code bases but you get 95% of the way there so it is not bad.
Flutter Windows (alpha) just got announced.. :) https://medium.com/flutter/announcing-flutter-windows-alpha-33982cd0f433 The initial reason I got interested in Flutter was because I was looking for a Qt+QML alternative with a bigger eco system :)
electrumsv replied:
I like Flutter and HandCash show what is possible with it. But unfortunately it's too niche, Javascript, Typescript, babel, CSS, node and so on have a very compelling base to build on. -- rt12
What exactly "backend wallet server" should do? For database there's https://pouchdb.com and ElectrumX has support for websockets (https://electrumx.readthedocs.io/en/latest/environment.html#services)
electrumsv replied:
Everything but the GUI to start with. Key storage, signing, coin management, etc. -- rt12