A guide to run an open source based e-store that accepts Litecoin, Bitcoin and fiat
Author: Ricardo Sodré Andrade (Twitter)
This guide is not finished yet (I expect to put images and describe everything step-by-step). At this stage you can get good ideas and directions to build your own e-store. If you consider this useful, contribute with some lites to LTC address: LdMwrnsBoggWVcHcM7yeg242e8QqetYAzU
Short URL to this guide: http://xadrez.yndexa.com
I personally run an online bookstore which uses Xadrez to give the option for customers pay with Litecoin and Bitcoin: 9Bravos. At same time that e-store let me validate what I've documented here. The store is in Brazilian Portuguese.
- Introduction
- Components
- Wordpress
- WooCommerce plugin
- BTCpay Server
- "Wordpress-Woocommerce-BTCpay" plugin
- Fiat2LTC-WooCommerce plugin
- Electrum (desktop and mobile wallet)
- Electrum-LTC (desktop wallet)
- Samourai Wallet (mobile wallet)
- Loafwallet (mobile wallet)
This tutorial expect to give directions and tools to anyone who want to setup an ecommerce store that accepts Litecoin (LTC) and Bitcoin (BTC). Is possible to accept payments over Lightning Network. Old payment methods like credit card and stuff can be enabled too. All components in this solution are open source software and can be obtained at their websites.
This setup is called Xadrez just to be easier to anyone who want to refer the proposal presented here. Xadrez is Chess in portuguese language and we will change the pieces (the components) on the board until we reach a very nice full featured setup for a stable and definitive ecommerce store (the Checkmate).
The e-commerce store setup need to use stable software, be easy to configure by merchants with no more than basic tech skills and be able to show products, handle carts, inventory, customer accounts, generate reports and others expected capabilities. All the Litecoin and Bitcoin received need to go directly to the merchant's (preferable mobile) wallets.
I personally run an online bookstore which uses Xadrez to give the option for customers pay with Litecoin and Bitcoin: 9Bravos. At same time that e-store let me validate what I've documented here. The store is available just in Brazilian Portuguese but I will find time to make something in english to validate the Xadrez for you all.
Currently setup of Xadrez is formed by the components listed and described below.
"WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on millions of sites and seen by tens of millions of people every day."
Wordpress is a popular Content Management System (CMS) used to run portals, websites, blogs and many different kinds of websites. We will use it to run the store. A plugin (Woocommerce) will convert this content management system into a full featured ecommerce store as described below.
The minimum infrastructure to setup this can be purchased at Digital Ocean. You can create your Droplet for Wordpress using an One-click apps
image called Wordpress 4.9.1 on 16.04
or higher on the plan described as 1 GB, 1 vCPU, 25 GB, 1 TB
- that will costs $5/mo.
WooCommerce is an open-source, completely customizable eCommerce platform for entrepreneurs worldwide. Go beyond the confines of traditional eCommerce solutions, and be limited only by your own imagination.
This is the plugin mentioned above. WooCommerce is widely used and offer a bunch of good quality addons to improve your store.
*BTCPay Server is a free and open source server for merchants wanting to accept Bitcoin for their business. The API is compatible with Bitpay service to allow seamless migration.*BTCpay Server will will turn the merchant into a self sovereign one. The merchant (or some merchants who trust themselves) will run a payment gateway and link the store (Wordpress + WooCommerce) to it using a Woocommerce addon plugin from BTCpayServer project.
The minimum infrastructure to setup this can be purchased at Digital Ocean. You can create your Droplet for BTCpay Server (check about BTCpay below) using an One-click apps
image called Docker 17.12.0~ce on 16.04
on the plan described as 2 GB, 1 vCPU, 50 GB, 2 TB
- that will costs $10/mo.
You will need to prune the bitcoind
including a new line with argument prune=2500M
at BITCOIN_EXTRA_ARGS in docker-compose.btc-ltc-clightning.yml
file. Do not prune litecoind
.
Create an .env
file at ./Production folder:
NBITCOIN_NETWORK=mainnet
BTCPAY_HOST=btcpay.example.com
[email protected]
ACME_CA_URI=https://acme-v01.api.letsencrypt.org/directory
BTCPay Server can enable Lightning Network capabilities and I think this is awesome! But this has a cost: you can't prune your bitcoind to make it works. Use the right yml file and choose a name for you node at your .env file adding the line LIGHTNING_ALIAS=an_alias_for_your_LN_node
.
You can read a lot of additional information about BTCpay Server at The Merchants Guide to accepting Bitcoin directly with no intermediates through BTCPay.
You should follow the BTCPay Server Twitter account too.
Add the ability to accept Bitcoin and Litecoin in WooCommerce via BTCpay Server.
This plugin will link BTCpay Server and Wordpress+WooCommerce.
This is a plugin for WooCommerce/Wordpress to display live Litecoin (and Bitcoin/Ethereum) prices in your shop.
This handy plugin will help your customers to know the price in fiat (USD, EUR, BRL...) and BTC or LTC (ETH too but Xadrez do not support this crypto).
You can check our test e-store 9Bravos how it works. You can put a widget anywhere to let people change between Bitcoin or Litecoin or put the price switcher below every price of each product.
Fiat2LTC-WooCommerce will let you show prices in BTC/LTC format or bits/lites format.
Don't forget to disable ETH in Fiat2LTC Price Settings
at Wordpress Dashboard.
Electrum is a lightweight Bitcoin wallet.
At this moment Electrum is the best choice of Bitcoin wallet for Xadrez and fulfill all the needs of store manager and the best choice. The addresses generated at invoices will use the Segwit native Bech32 format.
You need to create a new Segwit wallet or just use any you already have and copy the Master Public Key from the menu Wallet
> Information
and paste it at BTCpay Server at Stores
> Settings
(if you already added a store) > Add or modify a derivation scheme
.
Another change is the gap limit of wallet. The standard gap limit is low but to reach the best peace of mind level we will change it to a higher number like 200. You will need to observe this number because it counts how many unpaid invoices inbetween occurs - if you do not want to pay attention on this details and want to be very sure will not be a problem, set it as 2000.
Go to menu View
and be sure the last submenu is Hide console
if it isn't click at Show console
. Open the Console tab
and use the following commands at prompt: wallet.change_gap_limit(200)
and press enter at your keyboard, wallet.storage.write()
and press enter again.
Electrum-LTC is a simple, but powerful Litecoin wallet. A twelve-word security passphrase (or “seed”) leaves intruders stranded and your peace of mind intact.
Electurm-LTC is a fork of Electrum and handle with Litecoin. At this moment Electrum is the best choice of Litecoin wallet for Xadrez. The addresses generated at invoices will use the Segwit native Bech32 format.
You need to create a Segwit wallet or just use any you already have and copy the Master Public Key from the menu Wallet
> Information
and paste it at BTCpay Server at Stores
> Settings
(if you already added a store) > Add or modify a derivation scheme
.
Another change is the gap limit of wallet. The standard gap limit is low but to reach the best peace of mind level we will change it to a higher number like 200. You will need to observe this number because it counts how many unpaid invoices inbetween occurs - if you do not want to pay attention on this details and want to be very sure will not be a problem, set it as 2000.
Go to menu View
and be sure the last submenu is Hide console
if it isn't click at Show console
. Open the Console tab
and use the following commands at prompt: wallet.change_gap_limit(200)
and press enter at your keyboard, wallet.storage.write()
and press enter again.
A modern bitcoin wallet hand forged to keep your transactions private, your identity masked, and your funds secure.
Samourai Wallet is not recommended yet to used as the merchant's BTC wallet
Samourai currently provide the Derivation Scheme necessary to inform BTCpay Server but we still has a issue that not let us to use it. The fixed gap limit
of Samourai Wallet is limited to 20 addresses (we recommend a number between 200 to 2000).
Until Samourai Wallet feature the option to change the gap limit
to any number, we do not recommend this wallet for Xadrez setup.
Loafwallet is the best standalone Litecoin wallet built for iOS and Android. It is available to download for free on the Apple App Store and Play Store!
Loafwallet is not recommended yet to used as the merchant's LTC wallet
Loafwallet will be the best choice for accept LTC in Xadrez setup as soon it archive some requirements as listed below:
- Be fully compatible with Segwit - it do not scan Bech32 and generated addresses are non-segwit
- Let the users get the Derivation Scheme
- Has an option to set the
gap limit