How to add an Altcoin

Altcoins

Bitcoin (and the original electrum) is the primary focus of the developers. When developing, we usually test two currencies just to check that multicurrency checkout works, but we don't check every coin frequently. Each coin's communities should maintain their coins.

For more information, checkout the Altcoin FAQ page.

How do I add an altcoin?

As Bitcart is made with extensibility in mind, it's usually not a hard process, but it depends on the coin you are adding

It all depends on whether there is an electrum fork for that coin

There is an electrum fork for that coin

If so, the process is easy. If that electrum fork is maintained, usually the process is the following:

  1. Add new daemon file, daemons/coin.py, in the main bitcart repository, where coin is your coin's code. Copy the code from the daemons/btc.py file and edit some metadata. Note that the default port for the coin must be in 5XXX range, and that you should increment it by one with each added coin. So find the latest port used, and use the next port number available. Check this diff for an example, but make sure to check the most up-to-date files.

  2. Add a requirements file (requirements/daemons/coin.txt), and pin electrum of that coin to some specific release. See this example

  3. Add the coin's decimal formatting settings, edit the api/ext/moneyformat/currencies.json file and add settings related to your currency. See the example crypto settings at the bottom of that file.

  4. Add the coin to our SDK. Create a file bitcart/coins/coin.py, and edit some metadata. See this example.

  5. Add the coin to our docker deployment:

    Create a docker file for that coin (base on the btc one), a docker-compose component and edit the setup scripts. See this example. Ensure to add COIN_HOST=component line to this file, where COIN is the coin symbol, and component is the name of the docker-compose component you have created

  6. Optionally, add the coin to our lunanode installer

There is no electrum fork for that coin

That's where things get a little bit more complex. You have two ways: either fork the electrum yourself and make it work for your coin, or, if your coin is completely different from btc-like coins, try to create an electrum-compatible daemon. If you do it correctly, you just need to implement the daemons/coin.py file in a completely custom way, plus make sure to have all the daemons dependencies in the requirements file, but otherwise, the process is the same as when there is a fork available for that coin.

Last updated