The high security levels offered by cryptocurrencies, via the blockchain technology, offer an ideal financial ecosystem for minting national currencies. A recently published paper introduced an innovative application that utilizes the blockchain technology to transform fiat money into a cryptocurrency; ether. This technology can become a part of a much bigger system, so that, after travelling outside his/her country, a user can exchange remaining foreign currency for its local denomination.
On the other hand, another application could be to transform fiat currency into a cryptocurrency to help implement a demonetization scheme, similarly to what has been implemented lately in India. Within this context, the paper discussed the development of the proposed blockchain application and the consequences of demonetization and whether or not, the Indian government could have benefited from a technology such as that proposed through the paper. The paper analyzed the reasons why the Indian government has not resorted to such measure, which led to a discussion of how the Indian economy can benefit from minting its own cryptocurrency. Even though converting fiat currencies to cryptocurrencies is technically feasible, the authors of the paper believe that the Indian government is unlikely to do it, mainly due to issues related to monetary sovereignty.
The architecture of a prototype of an application for converting fiat currencies to cryptocurrencies:
Via means of lean software development terminology, the application is described as a “minimally viable product”. In other words, the script of the application is not suitable yet for a production environment; however, it has enough functionalities to showcase the ideas presented within the paper. Moreover, the paper did not aim at listing every small detail of the application, but it focused on the key code that illustrates the “post-cash” aspects of the application. Nevertheless, the application’s code is available upon request as it is stored in a private GitHub repository.
The application is comprised of the following architecture.
1. Ethereum’s blockchain.
2. A smart contract which is coded using the programming language “Solidity”. This smart contract is responsible of exchanging physical fiat currency to ether. A smart contract represents an addressable script that reflects the verifiable logic of the application on the blockchain.
The application’s development environment:
The smart contract for exchanging fiat to crypto:
The smart contract, which handles currency exchange, has to be funded with ether so that it can manage the procedure of converting fiat currency to cryptocurrency. The below figure illustrates the execution flow of the funding procedure. In case, whenever a contract is called, no function matches those identified by the function identifier, Solidity will automatically execute a random defined unnamed function. Afterwards, if the function is successfully executed, any sent ether will be linked to that contract. The unnamed function must not include any arguments and should not return anything. Ethereum introduces the “gas” concept, which represents the internal price needed for executing code. An unnamed function must not exceed 2300 gas, which means that it cannot write to the blockchain or undergo any form of complex calculations.
The rate of exchange of fiat currency to ether is determined by the smart contract function shown below. It relies on three parameters:
1. The currency’s code which is a three letter identifier that corresponds to the ISO 4217 standard currency code.
2. Ether’s exchange rate with respect to that fiat currency.
3. The time at which the exchange rate is obtained.
The function utilizes the sha3 hash function to formulate a 32 byte value using the currency’s code, which is used as a key for the hash-table that stores the exchange rate.
“placeOrder” and “completeOrder” are the functions that actually exchange fiat money to ether. The workflows of both “place” and “complete” are similar to the behavior of Kraken, the cryptocurrency exchange platform. The currency orders are saved within a Struct, and they can be either “completed”, “open” or “deleted”.