Accepting Bitcoin — Do you need a payment gateway ?

Accepting Bitcoin — Do you need a payment gateway ?

So you created a bitcoin wallet, did a few transactions and are loving the cryptocurrency memes and financial freedom. Surely its time now…

Mar 13, 2019 • 3 min read

So you created a bitcoin wallet, did a few transactions and are loving the cryptocurrency memes and financial freedom. Surely its time now to accept bitcoin payments on your online store!

Do you really need a bitcoin payment gateway? How about a bitcoin payment processor? Isn’t having a bitcoin address enough? Why use a custodial payment gateway for a currency meant to regain monetary control?

NO.

While we at Blockonomics offer our own bitcoin payment gateway, it’s not always necessary. Let’s try to build bitcoin payment processing capability step by step from scratch.

Step 1

Show a bitcoin address with QR Code

This is the simple and the most effective way to receive donations. Users can pay to the given bitcoin address, whatever amount they like.

This looks easy, however the scenario is a bit different for merchants that get orders on online shop. The below question is asked a lot:

Why not just always show my bitcoin address on cart checkout?

The problem is bitcoin transactions can publicly be seen on any blockexplorer. So any customer can claim that he sent bitcoin to you just by quoting a publicly known txid matching the cart value. Also there is a privacy problem - All of your shop payment history is now known to the whole world.

Step 2

Create unique bitcoin address for each order ICOBench gives each customer unique bitcoin address for payment

To create multiple bitcoin addresses, you don’t need to keep opening your wallet each time. Bitcoin provides HD wallets; so you can create receive payment addresses easily using wallet xpub. Here are the recommended tools for doing this:

  1. PyCoin Library — Python
  2. BitWasp / HD-Wallet-Derive — PHP
  3. BitcoinJS — Javascript
Generating unique bitcoin addresses for receiving payments using pycoin library

There is a common concern of creating too many addresses

Would my wallet be able to handle so many addresses, should I recycle them?

Recycling addresses is generally a bad idea. Bitcoin clients are able to handle millions of addresses . Unless you have order volumes of the scale of Amazon, no need to worry about this.

Step 3

Invoice Automation

When crypto order volume start picking you would cannot manually verify each order in your wallet / blockexplorer. More automation is required:

  1. Show exact BTC amount to pay depending on current BTC price
  2. Auto detect payment and show order confirmation in real time
  3. Update order status when BTC transactions confirms
A BTC payment invoice updated in realtime (Source: Btcpay Wiki)

For this, you can choose from various open source tools. Some of these require a bit of setup including running a bitcoin node to avoid calls to third party APIs:

  1. Cashier BTC — Self-hosted Node.js Bitcoin payment gateway. Depends on Nodejs v8+, Bitcoin Core, Couchdb for storage.
  2. BTCPay Server — Built in C# and conforms to the invoice API of BitPay. Pulls transaction information from its own bitcoin node
  3. Electrum Merchant — Uses electrum daemon as a watch only wallet to enable merchants to accept bitcoins

If you are using e-commerce platforms like Wordpress / Prestashop, there are plugins available [1] [2] that integrate easily with your order / checkout flow.

Step 4

Conversion to Fiat
I need to immediately convert received BTC to fiat

No! Please skip this step!

Be aware that you are virtually contributing nothing to the bitcoin ecosystem if you instantly convert BTC to fiat. However, merchants do need to pay bills and cannot risk holding BTC in bear market. You can convert to fiat/stablecoin by sending funds to your local exchange regularly. For this you can also use a bitcoin payment forwarding service

To summarize, it is not necessary to depend on a payment processor to accept bitcoin. Various open source tools / projects are available according to the complexity of merchant workflow. Cheers to bitcoin adoption!


This is a companion discussion topic for the original entry at https://insights.blockonomics.co/accepting-bitcoin-do-you-need-a-payment-gateway/