Digital Currency Payment Systems can be Used for Instant Local Currency Transactions

Ken Alabs
9 min readSep 13, 2017

--

I used a Bitpay Visa card at the Post Office this week to pay for postage using bitcoins. However, I paid in US dollars. The Post Office does not accept digital currencies, just like majority of businesses currently. I preloaded the card with bitcoins, so it was functionally a debit card. The payment provider converts the bitcoins in the card into US dollars at the prevailing rate with a little commission taken by Bitpay for the conversion. I did not have to wait for a Bitcoin block to be written confirming my transaction; which kind of provides a way to have a bitcoin transaction completed in seconds indirectly. Being familiar with payment processing, I decided to delve into the technical details of how this is completed. A little background on blockchains and how transactions are written is assumed but a short summary will be provided here.

How Blockchains are Created

A blockchain is a ledger of transactions, with an immutable character because each new block builds on the prior one by linking to the transactions and balances before it. As a result, any transaction or balance can only exist and can be traced from prior transactions that gave rise to that balance. In bitcoins, any balance that can be spent is an unspent transaction output UTXO of a prior transaction in a prior block. Once it is spent, it can no longer be spent in future because a prior block will show it has been spent.

The process of creating these blocks involves thousands of processing nodes collating all new transactions transmitted across the network, verifying them to make sure they were appropriately signed by the account owners and that the amounts being spent are validated by the history, as accessible in prior blocks. Eventually, only one of the nodes; the first to solve a time consuming computational problem; gets to write each next block. The block must then be signed by the node. The time consuming process, termed the proof of work, is introduced to ensure that it is hard to create a new block. This is necessary to maintain the integrity of the system by making sure it is not possible for a rogue actor to rewrite past blocks and create a new history, because the time required to do so would be too prohibitive.

The side effect of this arrangement is that it takes about 10 minutes to write a new block. This effectively means that the time for confirming a transaction could be as much as 10 minutes, which for in-person transactions is a deal breaker as virtually no customer and no merchant would accept the idea of customers waiting 10 minutes at the checkout line for their transactions to clear. (For online payments or money transfer the confirmation time has not been as much of detraction comparatively.) Consequently, much research and conversations have been invested into the issue of how to bring the speed and capacity of digital currency transactions to one that is acceptable for in-person store payments. In fact, this is one of the stated motivations behind the Segwit implementation in Bitcoins that saw the coin recently split into bitcoins and bitcoin cash. One argument made in justifying Segwit is that it facilitates implementing the Lightning network on the Bitcoin network, thus allowing high volume transactions that are confirmed in seconds. But yet here I was essentially spending bitcoins at a merchant’s with confirmation in seconds. So how does that work?

Payment Provider Operating on top of a Digital Currency Blockchain

To make this easy, I’ll explain first what did not happen:

- The bitcoin transaction was not completed in seconds or written to the blockchain in that time

- The merchant did not receive bitcoins

- Visa did not convert my bitcoins into US dollars or any local currency I might be spending on the card

Short of merchants accepting the digital currency, the ideal process that allows that bitcoins as an example; and any digital currency in general; to be used for every day, in person transaction in local currency is shown below.

Schematic of an instant digital currency payment provider translation process

1. I preload bitcoins into the payment provider (PP) card. This is done by transferring the bitcoins from my blockchain account to a blockchain address provided for me by the payment provider to represent my new card account. This is no different than depositing funds into your bank account that you have a debit card for.

a. The new bitcoin address of my digital currency debit card is essentially the payment provider’s address on the blockchain. I do not have the private key to the address so I cannot spend it without using the payment provider’s debit card, any more than I can spend my money with my bank without using their debit card or check book provided for me.

b. This pre-load transaction is written to the blockchain and has to clear (in about 10 minutes or 20 minutes to get a few confirmations from several nodes.)

c. Once the payment provider card’s address has the bitcoins, I can now spend that bitcoin at any merchant that accepts Visa card.

2. I purchase a $280 TV at a merchant store. The payment provider’s conversion rate is $2800:1BTC which is set to, say 98% of the market exchange rate. (This is done to insulate the payment provider from losses from price volatility and for profitable operations.)

a. The payment provider debits its own US dollar reserves and credits the merchant’s account in dollars using Visa’s network, via a dollar payment processor. This part functions just like with any other typical Visa debit card operation.

b. The payment provider debits my internal Bitcoin account with them of that amount of bitcoins, which is 0.1 BTC

c. The transaction is completed in seconds

d. At the same time or later, the payment provider sells that amount of bitcoins at the prevailing exchange rate to replenish the USD reserve account.

e. The procedure could accomodate a transaction fee without altering the process flow.

3. I pay $580 for a hotel stay

a. Similar steps as in (2) follows

b. The transaction is completed in seconds

4. The speed of the transaction is about the same as any Visa transaction

5. There is no need to wait for the transaction to be written to the blockchain because the entire balance is already blocked off on the blockchain into the payment provider’s custody soothe debit card holder cannot turn around and double spend the balance on the blockchain.

a. Essentially, the payment provider has created an off-chain network by moving that balance of bitcoin moved into the debit card’s address on the blockchain, and all subsequent sub-transactions and accounting of it is done internally or off-chain on the payment provider’s network.

b. The only time the Bitcoin network would need to be updated, or have anything added to the blockchain would be if the card owner returned some of my balance back to another Bitcoin address outside of payment provider’s network.

c. This is very similar to how a bank account and amount deposited in it works. Transactions take seconds when using the bank’s debit card, but an attempt to move the funds to a different bank’s account belonging to the same user requires clearing that could take days. (Because digital currency deposits are not FDIC insured, and the funds are actually in their custody, on behalf of the customer, users are advised to not leave large amounts in there, same as on Exchanges.)

How the Bitpay Debit Card Worked

It turns out that the Bitpay debit card did not actually go that far. It simply converted and blocked off the entire balance deposited in the debit card at the exchange rate at the top off time. All subsequent transactions were then completed in dollars. Here is the flow of the process:

Process flow screen shots for using my bitcoin funded debit card

This is like a skinny version of the instantaneous conversion and spending of actual bitcoins off the debit card described in the ideal situation. The process here stops from the point of topping up the card and simply defaults to a basic dollar debit card from that point on (Figure 3.) This is obviously easier to implement, and easier to insulate the payment provider from exchange rate volatility. At the same time, it removes any potential gains from the digital currency appreciation from both the payment provider and the customer.

Support for Multi-Currency Transactions

To support conversion between several digital currency and a local currency, the instantaneous conversion procedure described above is converted into vector implementation of the formulation. For multiple digital currencies to multiple fiat currencies the implementation will be a vector formulation. While presentation of the formulation is outside the planned scope of this current short writing, it is actually quite straightforward, and lends itself to a simplified algorithm and code. In fact, I was able to write a test code in Solidity and web3.js based on the formulation in a relatively short time, to test the framework or idea.

Conclusion

The implication of an implementation and fully deployed instantaneous digital to fiat currency conversion system such as this is that the last mile issue that allows the use digital currencies in a local economy is actually already feasible. For instance, using the debit card pin code, I could even withdraw cash from a regular ATM. So essentially I do not have to wait for a Bitcoin ATM to be installed close to my location.

Secondly, the issue of blockchain transactions being unable to scale to potentially thousands of transactions a seconds, or needing minutes for confirmation becomes a bit mute. An implementation of the ideal scenario described here allows the digital currency to be used at merchants that do not accept the digital currency; and for in-person transactions at any local store.

After nine years, Blockchain technology, or preferably public distributed ledger technology is likely here to stay; although it is still evolving. Its initial deployment has seen it applied towards creating digital currencies; albeit with a first version that utilizes a lot of electricity solving computationally intensive puzzles to assure trust across its distributed network. However, innovations continue to pour into the space. For instance, with developments such as those that use a directed acrylic graph, DAG, the future dominant form of distributed public ledger technology might not even be based on chained blocks after all. In a few years, application of the technology will also probably change significantly. Payment systems that allow some of the assets in that ecosystem to interface and interchange easily with the currently much larger traditional system may be one of the major sectors (or next killer app in the space) that would emerge in time. It is possible that we may even see traditional payment processing companies, utilizing the advantage of their infrastructure and regulatory licenses, participate and play a significant role in this space in time. Many of them are already taking part in enterprise alliances such as the EEA and Hyperledger. Such development might bring more choices to consumers in time and allow the technology to reach more people, and be applied to more use cases; with ultimately beneficial results.

(Much of this was put together in leisure over the holidays in Dec 2016. However, the recent emergence of some payment card systems, some of which are likely using similar technology and methods prompted the sharing of this. At some point, time permitting, a review and comparison of some of these new projects, such as Shiftcard, TokenCard, TenX, Monaco, Centra might be interesting. This area could shape up to be one of the major segments of cryptographically-secured digital asset technology. Clap for this article if you’d like to see this review or more articles like this.)

Simplified version of a digital currency funded debit card that basically just converts to USD card on top up

References

  1. Ken Alabs, May 25 2017, “Why Cryptocurrencies are not yet Making a Big Impact in Payment Processing“, Published on Medium, https://medium.com/@alabs.ken/why-cryptocurrencies-are-not-yet-making-a-big-impact-in-payment-processing-3ea1f71d2dee
  2. Ken Alabs, July 2017, “Digital blockchain networks appear to be following Metcalfe’s Law”, Electronic Commerce Research and Applications, Volume 24, July–August 2017, Pages 23–29
    https://doi.org/10.1016/j.elerap.2017.06.003
  3. Ken Alabs, Jun 16, 2017, “A Macro-Mathematical Model for the Observed Value of Digital BlockChain Networks”, Published on Medium. https://medium.com/@alabs.ken/a-macro-mathematical-model-for-the-observed-value-of-digital-blockchain-networks-23cc8e0dc7ea /

--

--

Ken Alabs

Ph.D Engineering, Stony Brook, M.Sc Computer Aided Engineering, University of Strathclyde, PMP. IT professional, programmer, researcher.