Secure Retail Deals in Digital Currencies

Roman Wiligut
The Dark Side
Published in
7 min readNov 9, 2023
Photo by Markus Spiske on Unsplash

Authors: Dr. Ilya Evdokimov (Everscale), Alex Shternshis (Global Payments Solutions), Roman Wiligut.

Adoption Challenges

Nigerian eNaira is the very first digital currency launched in a relatively large free-market economy with a democratic political system. Besides Dinero Electrónico (as reported by Arauz et al [1]) it sets another example of an experiment failing to meet expectations. According to central bank statistics released in the Summer of 2022, only about 700,000 customers have used eNaira wallets since they were introduced in 2021, even though there are about 55 million bank accounts in the country [2].

Simultaneously with the introduction of CBDC, the Central Bank of Nigeria conducted a massive campaign against cryptocurrencies and there is evidence of the opposite effect. Data from research firm Chainalysis shows that shortly after the central bank’s ban, dollar volume of cryptocurrencies sent out of Nigeria rose to $132 million in March 2021, a 17 percent increase from the previous month. In addition, the number of transactions in June 2022 jumped 25% compared to the same month a year earlier [3]. Adoption data by Chainanalysis suggest that Nigeria is amongst the countries with the highest adoption rate for cryptocurrencies [4].

The IMF’s Staff Report for Nigeria’s 2022 Article IV Consultation noted that the uptake of the Central Bank of Nigeria’s eNaira in the first year has been slow with retail wallet downloads amounting to 942,000 at the end of November 2022 — which adds up to only 0.8 percent of active bank accounts. Also, the total number of eNaira retail transactions since the project’s inception (around 802,000) is less than the number of eNaira wallets, indicating that the wallets are not being actively used. The IMF report recommended that the eNaira be integrated into the existing mobile payment system to facilitate interoperability between mobile money operators and optimize the last-mile delivery of social assistance.

Technological and business issues aren’t the only factors that hinder adoption. High inflation numbers (almost 26% year-over-year, see S. Hanke Table) for Nigeria in particular (and fast growth of M2 money supply aggregate) devalue savings and push people towards avoiding getting local currency at any cost. An opposite situation may arise in the case of widely adopted digital currency: it may push other better money out of circulation (Gresham’s Law). Due to adoption challenges and events of nationwide eNaira outages Nigeria reportedly seeks a replacement of eNaira providers.

The Central Bank of Nigeria reportedly wants to develop its own software for the digital currency due to failure to meet adoption targets and outage events of the existing system supplied by Bitt. Supposedly a new platform for eNaira is going to be developed with New York-based technology firm R3 [6,7].

https://twitter.com/steve_hanke/status/1650235594788970496

In the present article, we explore rather technological ways to increase adoption and propose new convenient use-case-specific protocols for smart-contract-based digital currency. Our main thesis is that with the existence of centralized authority setting up universal standards for industry participants may be easier and full interoperability will be achieved faster.

Secure Delivery and Currency Exchange

This idea was initially developed during our participation in the BIS Rosalind TechSprint, which provided participants with access to APIs developed through Phase 1 of that project. Our project scope was intentionally limited to online payment escrow versus goods delivery and buying and selling other forms of money consumer domains, with the developed protocol being chain-agnostic since it relies on Hash-Time-Locked-Contracts for which specific API endpoints of Rosalind Project were explored and tested.

Figure: Escrow is a common weak point of online marketplaces

Parties

We will omit possible payment interface providers (PIPs), who fulfill the role of marketplaces. We focus on possible PIP on the consumer, merchant side and the third one, shipping companies. When the tradeable item is being selected by the consumer, the special DvP contract may be deployed with such parameters as: time lock, representing maximum time for money to be refunded in uncooperative case; transfer condition with regard to Oracle message signature (outcome) or possible hash lock to user’s secret on transfer to supplier’s account. At this point locking funds and refunding buyers may be facilitated through the well-known concept of Hash-Time-Locked-Contracts (HTLC).

HTLC has been a popular solution for exchanging bitcoins on altcoins since the early era of the cryptocurrency market because the contracts were facilitated between Bitcoin and its forks. “Atomic exchanges” execute trades of different assets via simultaneous parallel HTLC contracts on both chains. At this point, this is probably the most used “smart contract” in the wild thanks to Bitcoin’s Lightning Network which entirely operates using HTLC. Although our proposed solution for conducting Delivery-versus-Payment (DvP) and Payment-versus-Payment (PvP) relies on HTLCs, a way for conducting automated exchanges, it is not limited by them.

Digital Currency URL

Fully functional smart contracts running on decentralized protocols demand user-specific skills. Despite that, the wallet ecosystem of such protocols as Ethereum currently allows to obfuscate complexity in some special cases workflows and interfaces aren’t simple enough and services aren’t tightly integrated due to the permissionless nature of the protocol and free open-source development. Digital currency projects may approach the development of the convenience protocol in a more centralized and coordinated fashion.

We propose a Digital currency URL format that could be adopted across banks and financial organizations and supported by public key cryptography to ensure data validity and privacy and hide complex interactions behind a user interface similar to LNURL standard. Let’s consider a complex link https://service.io/?q=2f58ae64-eb75-4c4a-bfae-c8e2a51ccd43.

Here we use only a single query parameter but it may be not limited by only one string. The link may be arbitrary and generally consist of any components the Service wants to have in its links.

Since we limit ourselves to quite specific use cases, we could propose only two prefixes: dvp and pvp which would mean “delivery versus payment” and “payment versus payment”. The customization of the protocol may allow more specific payload fields on the service interaction level and custom escrow and recovery procedures.

By applying base64 encoding scheme (without = symbol) and concatenating string with prefix we may obtain short string dvpaHR0cHM6Ly9zZXJ 2aWNlLmlvLz9xPTJmNThhZTY0LWViNzUtNGM0YS1iZmFlLWM4ZTJhNTFjY2Q0Mw. With this DCURL service may construct easy-to-read QR codes or even transmit these strings as another query parameter somewhere else.

Figure: DCURL dvpaHR0cHM6Ly9zZXJ 2aWNlLmlvLz9xPTJmNThhZTY0LWViNzUtNGM0YS1iZmFlLWM4ZTJhNTFjY2Q0Mw encoded into QR

The Protocol

The DCURL link has no use on its own. It merely serves as a single entry point into a complex protocol for initialization of the HTLC contract which normally demands a couple of rounds of communication and exchange with non-intuitive hashes that look like “rubbish” strings. On the scheme, we provided a more general form corresponding to LNURL protocol. Too general payment details and metadata objects may be more specialized and consist of payment amounts and shipping addresses along with preimage for the DvP case and payment amount and receiving address for more typical currency swap in the PvP flow.

The proposed idea should allow a seamless flow of DvP deals between 3 incentivized parties. The buyer wants to get the item shipped, the seller wants to receive money and the shipping company takes fees. While 2-side escrow contracts also may allow some degree of trustlessness, they are prone to non-cooperative endings where one of the sides may get an advantage. This is why all 2-side escrow schemes normally require reputation mechanisms that transform non-cooperative, non-repeatable games into non-cooperative interactions with repetitions.

Conclusion

Convenient protocols facilitating important interactions of services in the background may significantly improve the user experience from using smart contract platforms. Digital currencies could adopt developments from decentralized protocols and reuse some of them for the benefit of the users while experiencing a significantly lower burden of coordination in proposing new industry standards.

References:

  1. Andrés Arauz, Rodney Garratt, Diego F. Ramos F., Dinero Electrónico: The rise and fall of Ecuador’s central bank digital currency, Latin American Journal of Central Banking, Volume 2, Issue 2, 2021, 100030, ISSN 2666–1438, https://doi.org/10.1016/j.latcb.2021.100030. https://www.sciencedirect.com/science/article/pii/S2666143821000107
  2. Concerns Over Lost Fee Income Prompt Nigerian Lenders to Slow CBDC Adoption, Bloomberg
  3. Crypto trading thrives in Nigeria despite official disapproval, Reuters
  4. “The 2022 Global Crypto Adoption Index: Emerging Markets Lead in Grassroots Adoption, China Remains Active Despite Ban, and Crypto Fundamentals Appear Healthy”, Chainanalysis blog.
  5. Nigeria: 2022 Article IV Consultation-Press Release; Staff Report; and Statement by the Executive Director for Nigeria, IMF
  6. The Greatest Finance Podcast with Mr Ayo, a banker in WEMA bank Nigeria. Source
  7. Nigeria Seeks Partners for Tech Revamp of Its eNaira Digital Currency, Bloomberg
  8. Project Rosalind Phase 2 TechSprint — Invitation for Expressions of Interest (EOI), BIS
  9. LNURL RFC, GitHub

--

--

Roman Wiligut
The Dark Side

Growth Hacker, tech enthusiast, journalist, futurist, entrepreneur. I believe in technical progress.