[Devember 2021] Multi-currency Crypto Wallet (Open Source)

EDIT: GitHub repo here: https://github.com/jquindlen/commandwallet

Long time Tek Sy Level1Techs fan, first time caller. I’ve been consuming the Level1News every week since early 2017. Thanks for the work and the contest!

I’m a few weeks into this project already, but haven’t made the first git commit yet.

Lately, I’ve been paying the bills with crypto and have used most of the major wallets (and developed some preferences along the way.) I’ve also been doing blockchain development. In order to further my understanding of practical blockchain applications, I want to code a multi-crypto wallet.

Here are my project highlights:

  • Support at least the Ethereum, Bitcoin, and Nano networks.
  • Support at least ETH, BTC, and NANO by end of December 2021.
  • Allow new wallet creation, either on it’s own or with a specified private key.
  • Open wallets using a private key or mnemonic phrase.
  • Send from wallet.
  • Receive to wallet with QR code generation.
  • Wallet address book to save public keys to.
  • Portfolio view with a pie chart or something similiar.
  • Regularly pull down BTC, ETH, and NANO prices.
  • Implement an API proxy server on Linode to cache API requests to the various crypto networks and crypto information APIs that the wallet will rely on.

I’m an old programming veteran and I’ve completed projects far more ambitious in scope than this little walk around the park.

Anyway, I could ramble on but I’ll save that for some “meat and potatoes” posts here once I’ve got some actual progress to share.

3 Likes

Dear dev dairy: why is procrastination so addicting?

Still no git commit, but once I have my MVP done I’ll upload here:


So for full disclosure I started this project on September 23, 2021. Not sure if that is too early or not. I am a month into the project (not a few weeks as I estimated in my first post.) The current build runs well on Linux, connects to whatever Ethereum provider you want and looks sexy (at least to me, you can judge from the screenshots for yourself.)


The project is licensed under the MIT license. All libraries and 3rd party code is also MIT licensed to keep it simple.

The Windows build is currently broken. I don’t have a Mac to try that. Looking at supporting Windows 10 and Linux at first, with greater compatibility as time progresses.

Here is a list of what works today:

  • The most important feature: dark mode (need to fix the notifications though.)
  • Settings works. Notifications work. Dialog boxes work and are easy to call.
  • Connecting to the Ethereum network using user configurable settings.
  • Opening and/or creating new Ethereum wallets.
  • Command console displays console.log() and other console messages.
  • UI is still rough and has display anomalies and errors, but basic premise is there.

THE HERETICAL DEV DIARY OF WRONGTHINK:

I’ve made some controversial development decisions that I feel like I need to explain. In fact, I’m about to go against 3 holy doctrines of modern javascript development that are going to get me demonetized and #hashtag cancelled.

Yes this is a javascript/HTML desktop app. The natural thought is Electron/node.js right?

Well, sure, why not? I do love node.js for a lot of reasons and Electron is very powerful. In fact, before Electron was a thing I would use Internet Explorer WebView or embed XULRunner or Chromium into desktop apps in order to present web programs as desktop apps. Many clients had use cases where this made the most sense and when Electron came along it made my life easier.

However, node.js and Electron are not exactly lightweight and they add a significant overhead both in filesize and resource usage. If I were using Electron my wallet could be over a 200MB+ download for end users.

So instead of Electron I am using Neutralinojs. My wallet is less than a 2MB download currently.

No Electron or node.js. What further heresy dare I confess to?

Yeah, I love object orientated programming and all. Works really well in languages like C++ but not so much in languages like lets say PHP where they hacked OOP in after the fact.

Well, OOP is great for code organization and keeping code modular, one in one out type of architecture works great with OOP.

Right now, I have different functionality split into files like ui.js and wallet.js but I didn’t follow the OOP pattern. Why?

Well at the end of the day, what I care about is maintainability. Maybe down the line it will make sense to refactor the codebase in the OOP pattern. It would be easy to do, because all the function names basically start with the namespace, then the class, then the method name. The only difference is that they’re stand alone functions, not methods in a class to be instanced. But again, why?

Let’s say I made everything a class, well now I’ve got constructors to write, visibility to define, and probably a bunch of static methods that kind of break the OOP pattern in this case. What do I gain from this structural overhead? Encapsulation, sure but that’s about it.

It’s just not worth it to shoehorn the OOP pattern onto this code except to look cool. Maybe as I develop the codebase over time I will see a practical reason to refactor but right now I just can’t see any real-world reason to do so.


I am long winded and boring. Sorry you just read all of that, but also thank you for taking the time. Please feel free to chime in with your unsolicited advice that I will promptly ignore. However, once the source code is public I am open to your patches, submissions, bug reports, feature suggestions, criticisms, mockery, insults, personal threats, and other such common internet nonsensory.

2 Likes

This will be my last post before I start posting binary builds on Github along with the full source code. Please note that this program is in Alpha stage development and should not be used with real crypto currency at this time.

I am using the following tools to run small local blockchain nodes:

  • Ganache (simulated Ethereum network with automining)
  • Polar (simulated Bitcoin node with multiple simulated Lightening networks)

In my next post I will include full instructions on using Ganache with my wallet so that you can test out my wallet app without actually interfacing with a live Ethereum network. You can also use the real Ethereum test networks such as Ropsten if you want.

The first build and source commit will be made once my app functions as a basic Ethereum wallet. After that, I will be turning my attention towards integrating Bitcoin and Nano in later releases.


Here is my changelog since last devlog:

  • Windows x64 build is fixed. Windows 10 x64 and Windows 11 x64 support only. Windows 8.1 and below still do not work and no 32-bit Windows binary at this time.
  • Search bar has become a shortcut to all functionality of the app and is now fully functional with autocomplete.
  • Added some UI feedback such as disabling the Send Now button until all required fields are filled in.
  • For UI consistency across platforms, switched from using OS supplied fonts to using Manrope-Regular.woff2 (48 KiB.)
  • Exiting the app now functions correctly (previously you had to exit through the app menu.)
  • Fixed most visual and UI errors or anomalies.
  • All console activity is now logged to the Command Console and all errors now pop up as a notification toast that must be manually dismissed.

It’s a functional barebones Ethereum wallet. Currently only have Windows 10/11 installer available for download. Linux builds coming later.

This is alpha software, so only useful for testing. Don’t use real crypto with this wallet yet.

Windows 10, 11 x64 build 0.0.2 available here: https://github.com/jquindlen/commandwallet/releases/tag/0.0.2

Full changelog:
https://github.com/jquindlen/commandwallet/issues?q=is%3Aissue+milestone%3A0.0.2+is%3Aclosed

EDIT:
Currently for Ethereum the Command Wallets connects to Infura using the Ropsten testnet.

While you can do tests on the Ropsten testnet, I prefer to have a local node to play with, but don’t want to spin up an entire real node. This is where Ganache comes in handy. Just grab the binary for your platform and then run it when you want to develop or test a wallet like Command Wallet.

When Ganache is running in the background with a workspace set up, you can use the RPC Server settings (usually http://127.0.0.1:7545 for Ganache) to connect Command Wallet to Ganache.

In Command Wallet:

  • on the top menu go to Advanced >
  • then select Settings & Options >
  • now click on the Network > tab
  • and for Ethereum Network Provider select JSON-RPC API (specify details below)
  • and in the JSON-RPC Node URL setting put http://127.0.0.1:7545
  • now click the Save Settings button.
  • Next, we need to reconnect to the Ethereum network. On the left global menu bar, click the big Ethereum symbol and then select Ethereum Network
  • A prompt will appear asking you to confirm that you want to reconnect, click the Reconnect button to finish.

With that done, you can now use Command Wallet with Ganache to almost instantly interact with a local Ethereum network. You can send ETH, receive it, open wallets, test transactions, etc.

In a later post I’ll address Polar which is similar but for Bitcoin and Lightening networks. If any one needs help with Ganache let me know.

So here was my first post checklist. As of version 0.0.2 here is how far I’ve gotten:

:heavy_check_mark: = Not implmented
:white_check_mark: = At least barebones MVP implemented in current public release

  • :heavy_check_mark: Supports at least the :white_check_mark: Ethereum, :heavy_check_mark: Bitcoin, and :heavy_check_mark: Nano networks.
  • :heavy_check_mark: Support at least :white_check_mark: ETH, :heavy_check_mark: BTC, and :heavy_check_mark: NANO by end of December 2021.
  • :white_check_mark: Allow new wallet creation, either on it’s own or with a specified private key.
  • :white_check_mark: Open wallets using a private key or mnemonic phrase.
  • :white_check_mark: Send from wallet.
  • :white_check_mark: Receive to wallet with QR code generation.
  • :white_check_mark: Wallet address book to save public keys to.
  • :white_check_mark: Portfolio view with a pie chart or something similar.
  • :white_check_mark: Regularly pull down BTC, ETH, and NANO prices.
  • :white_check_mark: Implement an API proxy server on Linode to cache API requests to the various crypto networks and crypto information APIs that the wallet will rely on.

With all that said, there are problems with almost everything I’ve checked off. I really hate the user experience but I just wanted a working first draft to revise from. I am already thinking of refactoring the code into an OOP pattern just to make the functions or then method names much easier to read and encapsulated in my own namespace.

Documentation is so important too, but also this MVP needs to be rethought, optimized and polished, so early documentation will be barebones until development matures on the project.


More Snark, More Confusing Dev Log:

About my previous defensive snark, I’m just going to double down. I’ve been a solo lonewolf freelance writer as well as developer for decades and I write code the same way I write anything else. With complete anger.

I stream of conscious the first draft because I don’t want to get lost in the weeds. I want to see my vision chiseled in low poly before I spend the time to render it at the server farm. Or, how about some other off brand analogy, like I just want to build my house out of particle board before I commit to pouring the foundation and framing it. Yeah!

So this first draft of my crypto wallet is just me avoiding writers block by pounding away at the keyboard with my barbarian rage until something vaguely resembling a crypto wallet emerged for me to immediately hate and thus thrust upon me the conviction that this piece of shit collection of code might clean up to be a respectable app one day if I just treat her right… get her all the fancy unit testing she needs to be stable.

Ahh… a developer can only dream. And write long bitter dev blogs about how everything was better back when Solaris was powering my servers. Down here in the coding basement, it’s nice to remember the light of SunOS every now and then, just to end a confusing dev log.

2 Likes

Devlog update:

Version 0.0.2 Linux binary releases are now on GitHub along with the previously available Windows installer. See notes below.

Mac OS binaries are also provided, but are as yet untested. There may be missing dependencies.

0.0.3 is in the works and it adds Nano network and Binance Smart Chain.

So I did get a chance to create a bunch of Linux VMs to test the Linux 0.0.2 binaries. Specific instructions are included for common package managers.


:stop_sign: WARNING: This software is in early alpha stages of development and should only be used for testing.

Do not use real cryptocurrency with these early preview builds.

Installing Command Wallet

If you are looking to use Command Wallet or test it out as an end user, then download the Windows, Linux, or Mac OS release from the Release section of this repository.

Windows

Currently, only 64-bit (x64) Windows 10 and Windows 11 are supported. To install Command Wallet on Windows 10 or 11:

  • Download the latest CommandWalletWindowsX64.exe from the Release section of this repository.
  • Run the CommandWalletWindowsX64.exe installer that you downloaded by double-clicking it.
  • During installation, run the included MicrosoftEdgeWebview2Setup.exe (checked on by default in the installer.)

Linux

Command Wallet has x64, ia32, and ARM binaries available to download from the Release section of this repository. The single archive CommandWalletWindows-linux.zip with version number appended contains all 3 binaries.

After extraction, simply run:

x64

./CommandWallet-linux_x64

ia32

./CommandWallet-linux_ia32

ARM

./CommandWallet-linux_armhf

The following distros work out of the box with no setup directly after OS installation:

  • Manjaro 21.x
  • Pop!_OS 20.04
  • Pop!_OS 21.04
  • Garuda Dr460nized Linux Zen

The following distros produce this error when launching from a fresh OS install:

./CommandWallet-linux_x64: error while loading shared libraries: libappindicator3.so.1: cannot open shared object file: No such file or directory

  • Fedora Workstation 35
  • Ubuntu 21.10
  • OpenSUSE 15.3 Leap
  • OpenSUSE Tumbleweed

You can fix that error by installing libappindicator-gtk3 or whatever that is called depending on your distro and package manager. Here are the commands to use:

OpenSUSE Tumbleweed + 15.x Leap:

sudo zypper install libappindicator3-1

Fedora 35 Workstation fix:

sudo yum install libappindicator-gtk3

Ubuntu 21.10:

sudo apt-get install libappindicator3-1

The following distros partially work, but have a rendering, javascript, or other misc issue:

  • Ubuntu 20.04 (most things work, but pulling in API data does not which has cascading issues)

Just signed up for Linode using the level1techs link: $100 Linode Credit | Linode

Thanks for the credit. Will be using this for command.ws which is my API cache for all things crypto.