BTCpay Implementation Guide: Accept Crypto as a payment method in the Caribbean.

Welcome to the how-to guide for implementing BTCpay within the Caribbean. For a complete overview of all solutions and more guides: CBN Medium

Guide Implementing a BTCpay server

The requirements to implement BTCPay are the following :

  • Online webshop
  • Paypal / credit card (for hosting)
  • Cloud hosting (AWS or Azure, Vulte, VPS etc)
  • Bitcoin wallet (Such as, Copay Wallet, Mycelium Wallet, Airbitz Wallet,Electrum Wallet, Bitcoin Core Wallet, Bitcoin.com Wallet,BRD Wallet (breadwallet), Trezor, Ledger nano)
  • Technological skills and understanding
  • Some time ( around 1–2 hours)

Step 1: Choosing a VPS hosting service

The first thing that you need to do is get a subscription on a Virtual Private Server (VPS) hosting platform. A VPS is a virtualized server that mimics a dedicated server with a shared hosting environment. You can look at it as a computer that is in the cloud, which you virtual access to and which you can use as either a desktop environment or just a server.

A VPS hosting service is service which allows you to utilize some computing space and power at a cost. There are many VPS hosting services out there but it is advised to do some research and find out which suits your needs depending on which payment channel you are trying to use . The prices start at around 5 USD per month. Depending on the operating system (e.g. linux, Mac, Windows etc.) system you are using, the amount of memory you want use and the amount of storage.

In this guide we use a VPS hosted at www.vultr.com with the following specs:

  • CPU: 1vCore
  • RAM: 2048 MB
  • Storage: 40 GB
  • Bandwidth: 2000 GB
  • OS: Debian (9 x)

Step 2: Set up SSH

Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Using SSH will allow you to gain access to your VPS through a terminal. Generally an SSH porting software is required in order to connect with your vps. A common application that is used for SSH porting is Putty. There are other ones that you can utilize, you can find them here:

In our example we are using Putty, you can download from this link. After you have installed go to vultr.com, login in and on go to the servers page by clicking on the VPS you created (ours is VPS_btcpay_test).

Once you have open your VPS, you arrive at the following page:

Now, write down or type out the IP address of your VPS you will need it in the next steps. Also, write down your password as you will need it in the following steps as well.

Next, click on the computer Icon on the top right of the screen, this will open up a new window that looks like this:

Now type at Login, type in:

root

You will be prompted to enter your password, this is where you enter the password that you have written down before:

Once you are in, your terminal should look like this:

If the password is too long or to difficult to remember you can enter the following command in order to change it:

passwd

A message will appear which will ask you for a new login password, type it in and press enter. Now you have changed your password.

Now you need to create an ssh key and so that you can use when connecting on your VPS through putty, this can be done by typing the following command:

ssh root@< YOUR VPS IP ADRESS >

The IP address is the address you have written down in the previous steps. This is what it should look like.

You will be prompted with a message, just type in yes and then press enter. After that you will be asked to enter a password, enter the one that you have written down. Once this is done, close the windows, and you can even logout of your VULTR account.

Next, open up PUTTY, in the hostname box enter your VPS IP address and in the saved sessions you can give it a name (any name you want), leave the port box as it is:

Click save and then open. Once you click open a terminal will pop up, click accept, then enter your login and password. Type in root as the login and for the password, the password that you have used in the previous steps. If everything is ok, you should be logged into your VPS.

Congratulations you are successfully connected to your VPS via your SSH client (Puty, in this case).

Step 3: downloading and setting up your BTCpay server.

Now that you are in your VPS, it’s time to download the necessary files for running your BTCpay server.

First of all, git needs to be installed on your system so that you can download the BTCpay “installation” files on your VPS. In order to do that you need to type the following line:

apt-get update && apt-get install -y git

Like so:

Then press enter and the program git should start installing

Once git is installed, you can now download the folder (repository) that contains all of the files that are required for installing and initiating the BTCpay server on your computer.

So type the following command in and press enter:

git clone https://github.com/btcpayserver/btcpayserver-docker

When its done downlaoding it should look like this:

Now you need to move into the folder that contains the BTCpay server files, this can be done by typing in the following command:

cd btcpayserver-docker/

The way you can know whether or not you are in the folder is when the name of the folders appears next to your username:

Ok so now that we are in the btcpay server-docker folder let’s enter the following command:

export NBITCOIN_NETWORK=”mainnet” && export BTCPAYGEN_CRYPTO1=”btc”

With this command you are choosing to use the bitcoin mainnet, note that in for this to work you need to have sufficient SSD storage capabilities. For this example, we are using 40 GB of SSD storage capacity but you would need at least 80 GB, this is only when you select the option for a pruned node. In this guide we installed a pruned node, and the option for that in the second command entry below — — → BTCPAYGEN_ADDITIONAL_FRAGMENTS

If you want to install the complete btc blockchain however, that will cost you more, depending on the hosting package and the os you chose.

now press enter.

Furthermore, you can also choose to use the lightning network, in order to do that you need to type in the following command:

export BTCPAYGEN_LIGHTNING=”lnd”

Press enter:

You will notices that nothing is happening when you are pressing enter after each command. Don’t worry, that’s is what it is supposed to do, if there is an error then a message will pop up.

Now, let’s continue. You need to get the right certificates in order to stage the application on to your server. And you also need to give SSH access to BTCpay. Type in the following command:

export ACME_CA_URI=”https://acme-staging.api.letsencrypt.org/directory" && ssh-keygen -t rsa -f /root/.ssh/id_rsa_btcpay -q -P “” && echo “# Key used by BTCPay Server” >> /root/.ssh/authorized_keys && cat /root/.ssh/id_rsa_btcpay.pub >> /root/.ssh/authorized_keys && export BTCPAY_HOST_SSHKEYFILE=/root/.ssh/id_rsa_btcpay && export BTCPAYGEN_ADDITIONAL_FRAGMENTS=”opt-save-storage-s”

Like so:

Press enter, if everything is good, nothing should happen.

Next, type in the following command and press enter:

export BTCPAY_HOST=”<YOUR VPS SERVER IP>

In between the quotes you need to enter your unique VPS IP, which is the one you had written down in earlier steps, like so:

You also have the option to set up your email address so that you can get notified if something goes wrong with the verification of your certificates. In order to do that you need to type in the following command:

export LETSENCRYPT_EMAIL=”<YOUR-EMAIL-ADDRESS>

Like so:

In order to complete the following steps, you need to have docker installed on your VPS server. Now it’s not important to know what docker is, we will show you how to get it installed. Now different OS have different requirements and uses different installation metrics for docker. In the case of this example, we are using debian. In order to install docker we need to first install a package called libltdl7. In order to do that type in the following command:

apt-get update && apt-get install libltdl7

Like so:

After its done installing you should see this:

Now we need to download the version of docker that is compatible with the OS system debian. You can do this by first moving out of the current directory (folder). Then, creating a folder in which to store the docker installation file. Afterward downloading the file into the folder you have just created. In order to achieve that,

type in the following command:

cd .. && mkdir docker-installation && cd docker-stallation/ && wget ‘https://download.docker.com/linux/debian/dists/jessie/pool/stable/amd64/docker-ce_18.06.1~ce~3-0~debian_amd64.deb'

Like so:

This is the result:

Now the installation files for docker are downloaded and you can now run the .deb file in order to start the installation.

Type in the following command and press enter:

dpkg -i docker-ce_18.06.1~ce~3–0~debian_amd64.deb

Like so:

Now docker will start installing once it is done, you should have the following outcome:

Now docker is installed. You can check to verify whether docker is installed or not typing in the following command:

docker run hello-world

Like so:

And the outcome should be like this:

Now that docker is installed onto your VPS, you can start running the BTCPay server. In order to do that you need to move back into the BTCPay installation folder and then run the initialization command.

Type in the following command:

cd ~ && cd btcpayserver-docker/ && . ./btcpay-setup.sh -i

Like so:

With the following outcome:

Now for the final step, you need to run your BTCPay server. Some VPS hosts don’t let you sustained use of 100% CPU. you can circumvent this by typing in the following command. Vultr does allow this, but for the sake of this example, we will run the BTCPay server using 80 % of CPU. the “ — cpus .8” in the command below refers to the 80 % CPU usage.

Type in the following command and press enter:

docker update btcpayserver_bitcoind — cpus “.8”

Like so:

With the following output:

CONGRATULATIONS! you have now successfully installed your BTCPay server and it and initialize an instance of it. Now you can enter your VPS IP in the address bar of your internet browser like so:

And you should be able to surf to your BTCPay service app.

note : Be aware that BTCPay is free because of its open source nature; it does not cost a dime, you’re paying your VPS provider here for the server which will keep your node online 24/7.

Setting up BTCpay account

Once you have completed setting up BTCpay server you can now start registering for an account.

The requirements for setting up a BTCPay account are the following :

  • Email address
  • Strong password
  • Bitcoin wallet with a XPub (Public key). Bitcoin wallets We always recommend hardware wallets due to the extra layer of security that comes with this.

Step 1: Register

After entering your VPS IP address and you are on the BTCpay main page you can click register on the upper right corner of the screen. Here you will receive the option to add your email address and create a strong password. Once you complete this you will now see four tabs in the upper right corner:

Step 2: Add your store

  1. Click on the tab “stores”.
  2. Click on the button on the left side “+ create a new store”. You can create multiple stores under one account.
  3. Name your store:

Step 3: Add bitcoin wallet

Once your store is created click on settings:

Once you are at the settings page you want to now fill in the derivation scheme text box (destination of where your funds(bitcoin) goes) with the extended public key of your wallet.

You can find the public key in your Bitcoin wallet. (do not use the xpub key presented in the image below) Electrum wallet example:

Note:If you don’t know where to find it please contact the community or read the forum of the wallet which you are using so you can access your xpub key.

Copy and paste your public key (xpub) into the derivation scheme text box and add the needed text of your address type at the end of the xpub string, see image 1&2 below:

Image 1:

Image 2:

Note: this is the address type of an electrum wallet

Remember that each HD wallet may have a different bitcoin address types. To know your bitcoin address type you can most likely find it online at the HD wallet websites. Here are some examples of how to identify your address type:

There are currently three address formats in use:

P2PKH which begin with the number 1, eg: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2.

P2SH type starting with the number 3, eg: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy.

Bech32 type starting with bc1, eg: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq.

To make sure your xPub is correct click check “extPubKey” this will generate a list of addresses that are created with the extended Public Key of your wallet check if one of these addresses is the same as the one in the Bitcoin HD wallet you used.

If this is the case, click “save”.

Good job! now your store has an Bitcoin addresses attached to it where customers can send bitcoin to!

Step 4: Manually creating an Invoice

Once you have completed the previous step you can now manually create invoices to clients of your store.

Click on “invoices” top left menu bar:

Click on “create a new invoice” :

Now you will see different options which you can add in your invoice for your client including the price, click “create” once you have filled in the necessary text boxes:

After this is completed you can proceed and click “checkout”:

Note: there is also a search bar to find specific invoices that have taken place

The point of sale interface is presented for the client or buyer where the payment can be done:

Guide implementing BTCpay WooCommerce plugin

Now that the BTCpay account is all set up you can now implement it on your WordPress e-commerce website. This is one of the many plug-ins of BTCpay.

Requirements:

  • BTCpay account/ store
  • Wordpress Admin
  • Woocommerce plugin

Step 1: Download & install BTCpay WordPress plugin

The first step is to download the Woocommerce BTCpay plugin on the Github page of BTCpay which you can find here.

Once this is done, you can just go to Wordpress’s Administration Panels > Plugins> Add New

> Upload Plugin,

>select the downloaded archive(.zip) and click Install Now:

After the plugin is installed, click on Activate.

WARNING: It is good practice to backup your database before installing plugins. Please make sure you create backups

Step 2: Pairing with your BTCpay server store

Now that the plugin is activated go to settings:

Once in settings move to the API Token and enter the URL of your BTCserver:

After you have copy and pasted the URL, click on the pairing code text box. Now it will show you a link below the textbox as shown here:

Click on it. Now the link will take you to your BTC server pairing permission page, Choose your storeID (Creating a label is optional) click on request pairing:

Now click on Approve:

And copy the pairing code that is presented on your screen:

Paste it in the pairing code text box in WordPress BTCpay woocommerce plugin settings page and click pair:

Step 3: Check API Token ID

Now that BTCpay server is paired with your wordpress site:

Please, double check if the API ID is found within your BTCpay server API token ID’s:

If you see your API Token ID you have completed your pairing and can now accept Bitcoin in your wordpress website store!

IMPORTANT: This guide is intended for small business owners who wish to help promote Bitcoin by accepting it as payment for goods and services in the Caribbean region. It’s written with the assumption that you operate a regular business that sells goods or services for regular national currency, and that you wish to accept Bitcoin as another legal way to pay, and that you intend to pay taxes on your Bitcoin income just like any other income.


Created by Ruben Russel
Please consider leaving some claps if this guide was helpfull to you!

If you have any questions or require assistance you can reach out to info@caribbeanblockchain.net

Website: https://www.caribbeanblockchain.net/


Sources

BTCpay Server. (2017, December 10). BTCPay — Introduction [Video file]. Retrieved September 12, 2018, from https://www.youtube.com/watch?v=xh3Eac66qc4

BTCpay Server. (2018a, August 18). Hosting BTCPay Server for cheap. Retrieved September 8, 2018, from https://medium.com/@BtcpayServer/hosting-btcpay-server-for-cheap-2b27761fdb9d

CardCollector1, U. (2018, April 26). The Ultimate Guide to BTCPay — The free and open-source Bitcoin

Payment processor. Retrieved September 8, 2018, from https://www.reddit.com/r/Bitcoin/comments/8f1eqf/the_ultimate_guide_to_btcpay_the_free_and/

Pav (2018, July 19). The Ultimate List of BTCPay Server Merchants. Retrieved September 6, 2018, from https://bitcoinshirt.co/btcpay-stores/

Scott, A. (2017, December 27). BTCPAY IS A BETTER (AND CHEAPER) BITPAY, SAYS CORE DEVELOPER NICOLAS DORIER. Retrieved September 5, 2018, from https://bitcoinist.com/btcpay-core-developer-better-bitpay/