Arcartera Limited is the developer of the Arcartera Protocol, a blockchain infrastructure for Governments and Corporations. Among General Blockchain Services, one of our Core Aspects is the creation of Payment Gateways for the AEC Industry.

Our first project was HKD Token, a stable coin for the Hong Kong market. It gave us the experience to create a general protocol, that also served as a knowledge base when we consulted with the HKMA, Hong Kong’s Monetary Authority.

Preceeding the first Arcartera Stable Coin or better to say it’s first application the electronic Hong Kong Dollar, we made extensive research on the Stable-Coin market. This page shares a list of information from external sources. They immensely helped us during our research – individual sources are available on request.

As a side note, the research below was originally mentioning the TRON Blockchain as potential base for a HKD Token. Arcartera is only mentioning the below sources as part of our shared research. We have decided to develop our own Blockchain for HKD Token as well as for our clients, and our own ARCA Coin, which is used to pay for network fees is based on the Ethereum Network.

In summary, the below is a collection of research sources that we gathered during our first Stable Coin project. We still would like to share it with you to indicate the process and also sources that we went through in our journey to build the Arcartera Protocol.

ABSTRACT 

In recent years, blockchain and cryptocurrency has been popular. The market has grown exponentially. People started looking at the possibility of adopting it as a new way of electronic payment. As Bitcoin and most other Altcoins have high volatility, the market hesitates on the risk. Stablecoin has become a new variation under cryptocurrency which is pegged to some fiat currency with stable exchange rate. Tether, also known as USDT, is one of the most popular examples that has a 1:1 exchange ratio with USD. While Tether set its company in Hong Kong, there are no existing stablecoins pegged to HKD. This project will be constructed with TRON, the blockchain platform which charges zero transaction fee, to develop a new stablecoin on HKD named the Hong Kong Dollar Token(HKDT). Moreover, a crypto wallet will be developed in React Native at the same time to provide cross-platform experience for non-technical users on peer-to-peer HKDT transactions. Besides the basic transaction function, additional features such as blacklist on dishonest spending will be researched. At the time of this report, the basic prototype has been developed and is waiting for testing to evaluate the performance. Utility features such as QR code generation and scanning is provided. In the next phase of development, more advanced features such as blacklist will be provided

INTRODUCTION

Overview of Cryptocurrency

Cryptocurrency is the first application of blockchain and one of the successful examples of digitalized assets. Ever since Nakamoto issued the first Bitcoin, its total value has risen by over US$657 billion by January 2021. For the cryptocurrency market, there are more than 17000 cryptocurrencies in the market and carrying a total market value over US$ 1 Trillion. There are at least 5 million users actively involved in cryptocurrency trading. All these figures indicate an active market that has been growing rapidly and is full of potentials. Many research studies have summarised the main features and advantages of cryptocurrency like Bitcoin. It is decentralised, transparent and flexible. Conventional currencies would usually have a centralized party overseeing the whole currency system and step in when needed, while Bitcoin would be peer-to-peer. Bitcoin broadcasts transactions to every miner, who contributes their processing power to verify a transaction. The algorithms are open-sourced as well. An account can be generated mathematically. The transaction address and authentication process are then handled with asymmetric encryption with the account as cryptographic keys. Therefore, everyone will have access to the records and integrity is ensured by algorithm and maths. In addition, transactions happen fast with low fees. In fact, as there are no authority to handle transaction verification, the transaction fee is actually paid to a special role in cryptocurrency, the miners. The action of mining is referring to the heavy amount of computation work for validation and appending new transactions to the blockchain network. The transaction fee is then provided as the incentives for miners. The transaction fee for Bitcoin is around US$2 for each transaction in October 2020. People may purchase cryptocurrency for investment only while some shops accept bitcoin for buying goods or services. For example, Bitcoin is accepted as a payment method on overstock.com, an American e-commerce retailer, or digital contents from Microsoft. Another research shows that 52% of the company participants in the study provide service for processing cryptocurrency payment with merchants. However, Bitcoin has not been accepted in the mainstream finance system or as a decentralized payment method due to its high volatility. The price of Bitcoin fluctuates over a wide range from day to day. The Bitcoin dropped to around US$5,000 in March 2020 and the current price has reached US$35,000. This is the main reason for most of the merchants accepting Bitcoin as payment, they would exchange it immediately to fiat currency once received. The volatility undermines cryptocurrencies’ potential to be used in online payment and therefore a new variation of cryptocurrency was proposed, the stablecoin.

Stablecoin

As its name, stablecoins are stabilised cryptocurrency with constant exchange rate. They are pegged to fiat assets or fiat currencies, but can be using different collaterals. The mechanism is classified to four types. The first type, fiat-collateralized stablecoin is collateralized to fiat currencies such as US dollars or pounds. The unavoidable disadvantage is that a centralized custodian has to be introduced and make sure the exchange can be made at a fixed rate. One famous example is Tether, the USDT, having the total market value of US$ 15 billion is the biggest stablecoin in the market. The exchange rate stays at 1 USDT to 1 USD. The second type, commodity-collateralized stablecoin, is very similar to the first type. They use different collaterals of commodity types such as gold or oil and share a similar disadvantage with the previous type. The third type is crypto-collateralized. It uses other cryptocurrencies as collaterals. Anonymous custodians is possible under this setting. The Dai is an example for crypto-collateralized stablecoin, that is pegged to 1:1 USD, but users are using Ether, the second popular cryptocurrency, as a deposit. The last type is a non-collateralized stablecoin. That is, they stabilise the purchasing power algorithmically. For example, when the purchasing power increases, the balance or payment amount are adjusted correspondingly that users pay at a lower price for the product. However, there are no existing mechanisms that could ensure both the stability and decentralization. Despite all the challenges, a stablecoin still has the potential to be a fast and secure payment alternative. However, there are no existing stablecoins that are directly pegged to HKD. When one has the incentive to issue a new cryptocurrency, one needs to at least implement a smart contract.

Smart Contract

Smart contract is a predefined set of logics and rules. It is implemented as a script that executes automatically when received a message or transaction as input. Transactions can then be carried out peer-to-peer. For example, a smart contract may have a “transfer” function that will send X units of crypto coins to the receiver and deduct the same amount from the sender. Moreover, it has the following characteristics. Firstly, a smart contract should be properly designed to handle all possible conditions. For example, the transfer action should not be made when the sender does not have the amount to pay. Secondly, the output should always be the same when given the same input. As in blockchain, it uses a consensus rule that only the execution result is agreed by the majority of the blockchain network. If the smart contract is non-deterministic and gives unpredictable results for each run, it is impossible to reach a consensus when the transaction is broadcast to all the nodes on the network. Thirdly, a smart contract is deployed on the blockchain. In this distributed way, every internet user can access the content. Fourthly, all actions taken by the smart contract are irreversible. One cannot roll back any transaction after it is sent to the smart contract. There are a few popular platforms and standards that help developers to easily set up and establish their cryptocurrency to the blockchain network. This study is going to use TRON. A more detailed analysis will be provided in the methodology chapter. For users with no knowledge in blockchain or smart contract, a crypto wallet is required as an interface for managing their cryptocurrencies. It is the mid-term aim to create our own Arcartera Blockchain.

Crypto Wallet

Crypto wallet is the application that handles buy, sell and transfer of the cryptocurrency. The provided features differ by needs. When building a crypto wallet, the most important consideration is about securely storing the private key. As in blockchain networks, the private key is used to generate signatures and authenticate all operations. The key must be kept secret. Otherwise, malicious users can access the digit assets stored in the corresponding address and all the lost cannot be reverted. In addition, if the user loses the private key, he or she loses the access to the wallet. Some wallets have wallet seeds for recovery. That is a set of vocabularies or alphanumeric for generating the private key. Compared to private key samples in Ethereum, which is 64 hex characters in the form like “0xFF00…00FF00FF00”, wallet seeds are relatively easier to remember and therefore can be used to recover the private key. Consequently, protecting the wallet seed is as important as protecting the private key. With use of the crypto wallet, even the users have no knowledge about the blockchain, they can use a set of simple controls to handle the trading of cryptocurrencies. The users of the crypto wallet only need to know how to use the UI of the wallet provided.

Payment Method

As mentioned in our Arcartera WhitePaper, Hong Kong has a lot of payment methods, such as Cash, Octopus Card, Credit Card or FPS. Compared with those in operate payment methods, HKDT payment, or stablecoin payment has outstanding behaviors. Even stablecoin payment requires a trusted third party to issue the stablecoin, transaction of stablecoin payment work likes the Cash payment where the transaction will not involve any third party. In other words, third parties can be ignored if the user does not require a deposit or withdrawal. Moreover, stablecoin will do and store all the transactions in the distributed blockchain system. Thus, the trusted third party cannot know what transaction you have involved apart from the one that you used to receive the stablecoin sent from the third party. Also, the transaction recorded in the blockchain system can be no dispute and this unique behaviour can ensure the data integrity.

Objectives

Since stablecoin payment has a potential market, this project aims to establish the stablecoin for Hong Kong Dollar (HKD) that is called Hong Kong Dollar Token (HKD Token) for promoting the HKD Token payment in Hong Kong. This project aims at solving two technical parts including building the smart contract of HKDT on the blockchain and building an user-friendly mobile application for non-blockchain users to enjoy the HKD Token services.

Project Contribution

Hong Kong, as an international financial centre, has a unique advantage in promoting the usage of cryptocurrencies. In fact, Tether, the issuer of the most popular stablecoin USDT, set its company in Hong Kong. Although there are not specific regulatory measures on cryptocurrencies, Hong Kong Monetary Authority (HKMA) and Securities and Future Commission (SFC) have recognised Bitcoin as a virtual commodity. Other crypto coins are likely to fall into similar aspects. Currently, transfer of cryptocurrencies between individuals is allowed as far as it does not involve money laundering activities. No license is required for trading or owning cryptocurrencies. Moreover, the government has planned to encourage financial innovation in the city. For instance, Hong Kong has approved a cryptocurrency fund for the first time on 20th April 2020. Although with uncertainties on future regulations, the legal and social environment is friendly to embrace blockchain applications. Studying the feasibility of having a stablecoin in HKD aligns with the future trend of fintech. It turns cryptocurrency into a topic that is related to everyone. Although the legal environment has not recognised cryptocurrency as electronic money, the potential has to be highlighted.

Outline of the report

The report contains four chapters. The first chapter introduces the motivations for building a stablecoin in HKD and classifies the existing stablecoin. Moreover, it explains the technology and concepts that are required to build a new cryptocurrency and illustrates the goal and significance of this project. Chapter two examines the methodology. That includes the two major frameworks adopted for the crypto wallet side and smart contract side, and the advantages brought to this project. Chapter three describes the current progress, which includes system design and techniques. It defines two focuses when testing the deliverable. Project timeline and next steps are covered and limitations and challenges are analysed. Chapter four concludes the report. It summarises the progress and future works presented in Chapter three.

METHODOLOGY

Introduction

In this chapter, two important methodologies will be introduced. First is React Native, which is the application framework that will be used to build the crypto wallet. Its performance and capability could profoundly affect the user experience with HKD Token. Second is TRON, which has the potential to make free transactions possible. It is a growing blockchain platform but with potential to compete with the more famous Ethereum and Bitcoin.

The Development Framework: React Native

React Native is a cross-platform mobile application framework. It was released by Facebook in 2015[17]. Before React Native, if a developer wants to establish a mobile application on the two most common platforms Android and iOS, the developer needs to write two sets of code respectively in Java and Swift. Moreover, extra effort is required to ensure both versions have the same view and behaviour for consistent user experience. The main idea of React Native is to allow developers to only maintain one piece of code for multiple platforms[17]. It is noteworthy that React Native is built in a similar technical structure as ReactJS, a Javascript framework widely used in web development also created by Facebook. That implies the potential for code developed with React Native be reused on web application. Having a crypto wallet that is available for devices of any platforms will help users to adopt the new payment method, this cross-platform ability is highly valued.

Rendering in React Native

The above figure demonstrates the internal structure of a React Native application. The React Native side handles the structure, the logic and functionalities of the application. The native side is responsible for visualisation and user gestures. They run on two separate threads with an 12 asynchronous bridge between them for communication. For example, when the user opens the application, the React Native is first activated and informs the native side of how the elements should be displayed. When the user presses a button, the native side will send this message to the React Native side and the application will decide what to do based on the logic flow in the code implementation. The React Native will automatically determine what native function it should call and what native type of data should be sent. This structure allows instant refresh and easy event handling[18][19]. In this way, the React Native application can be easily migrated to different platforms. In addition, research[19] shows React Native application and native application have similar performance in terms of memory usage, frames per second measurements, response time and size. Furthermore, React Native resembles almost identical user experience. As React Native is open-sourced and the community has been actively updating and contributing to new features, it has great potential to look for in the future.

A POTENTIAL CHOICE: TRON

Introduction

TRON is a decentralized blockchain platform established in March, 2014. It is one of the popular blockchain systems in the world. The total market value ranked 20th in all existing cryptocurrencies. It is also believed to be the second most popular token development platform after Ethereum. TRON is adopting the smart contract standard compatible with Ethereum as well to attract developers. The main difference between TRON and Ethereum, the more popular blockchain platform, is that TRON adopts another unique mechanism to make zero transaction fee possible.

Transaction Fee in Blockchain

The developed objective is promoting the Decentralized Applications (HKDT smart contracts), the alias of smart contract in TRON, in the TRON ecosystem, so TRON applied the concept of Bandwidth. Before introducing the Bandwidth system in TRON, one should know that every blockchain user needs to pay transaction fees whenever they create a new transaction. The transaction fee can prevent some adversaries broadcasting lots of useless transactions to the blockchain system and cause Distributed Denial-Of-Service (DDOS) attack problems because the miners need to solve the cryptogram puzzles so that other miners can confirm the new block reward is belonged to the corresponding miner. Therefore, the number of transactions can be confirmed is limited by the number of blocks can be confirmed in one period. If there is overflow of useless transactions in the transaction pool, the real transaction is less likely to be picked up by the miner to create blocks. This essential measurement results in even if someone is using the smart contract, he or she has to pay the transaction fee in the blockchain. For example, if there is one smart contract with token AToken in the blockchain system with coin BCoin, whenever users want to trade 1 AToken to other users, they may need to pay some BCoin as the transaction fees. That is not good news for stablecoin. According to the example in the next figure, if there is a HKD Token smart contract in blockchain system Ethereum with a coin named Ether, users need to hold some Ether so that when they want to trade HKDT, they have some Ether to pay for the transaction fee. The contradiction is that users want to hold some stable cryptocurrencies, but at the same time they must hold some unstable cryptocurrencies so that they can do the trading.

Flow of Smart Contract Blockchain

Bandwidth System in TRON

The Bandwidth System can alleviate the situation of stablecoin by providing a transaction fee pool. Each user has a Bandwidth Pool with free 5000 bandwidth per day and the bandwidth in the Bandwidth Pool is used as the transaction fee. Users need to buy the bandwidth when all the free bandwidth is used to pay for the transaction fee instead of directly paying the transaction fee. Since a normal transaction required around 200 to 300 bandwidth, everyday the users can enjoy around 20 zero transaction fee trading. That means stablecoin users using the HKDT smart contracts in TRON can prevent the paying of the transaction fee. They can create several addresses, that is the alias of an account in the blockchain, and get 5000 free bandwidth per day in every address. If a stablecoin holder has 10 addresses in TRON that means he or she can have around 200 zero transaction fee trading per day. Of course, to prevent the DDOS attack mentioned before, creating a new address required 1 TRX, the coin in TRON, as the registration fee. If someone is willing to pay enough TRX to register lots of accounts, DDOS attack is still possible but they cannot earn from the attack, so it can be safe while TRON users can earn the registration fee from doing enough zero transaction fee trading. To conclude, TRON increased the possibility of DDOS attack, but the benefit of zero transaction fee is decisive for applying HKDT in TRON

Energy System in TRON

Apart from the bandwidth system, another resource, the Energy System, is important to the HKDT smart contracts. If bandwidth is treated as the transaction fee, the energy system is monitoring measurement. HKDT smart contracts have a high degree of freedom because the HKDT smart contracts only need to ensure it is using valid Solidity, a programming language for smart contracts. Thus, the contract may have loopholes that may crush the blockchain platform such as the most popular issue, unbounded looping. For example, there is one loop in the contract used to check the total supply handed over.

getSupply(): Init supply as 0 For each address in the address_list: supply = supply + the balance in address return supply

According to the coding above, it gets the total supply handed over by sum up the balance in each address. The program is valid, but if there are 1 millions addresses in the address_list and there are thousands of users calling this function frequently, it definitely increases the workload of the blockchain provider because users are willing to get information from the blockchain provider which is more credible. Thus, the Energy System is proposed for HKDT smart contracts to prevent users using the high workload HKDT smart contracts freely. With the Energy System, according to the next figure, every HKD Token smart contracts transaction is required to pay both bandwidth and energy as the transaction fee if the transactions are valid. However, if the HKDT smart contracts transaction is invalid, such as timeover, it will use up all the energy stored as a penalty.

TRON Smart Contract Example

Freeze Balance in TRON

Since HKDT smart contracts transactions require energy which is not freely given as the bandwidth, freeze balance service in TRON can be used to earn the free energy for achieving zero fee HKDT smart contracts transactions. Freeze balance service is freeze TRX, the name of the Coin in TRON, to get energy while the energy obtained from the service is equal to the number of TRX frozen divided by the total amount of frozen TRX from different users times 50000000000. energy obtained = user’s TRX frozen amount / total amount of frozen TRX in TRON * 50_000_000_000 The total amount of energy is shared between all the users in TRON, so the more the TRX is frozen, the more free energy can be obtained. Since the energy obtained can be automatically charged within 24 hours by the way of reducing the consumed energy. For example, Amy used energy and there is no consumed or obtained in the coming 24 hours. Then, the consumed energy becomes after one hours, no matter how much energy Amy has. Therefore, the HKDT smart contracts can achieve zero transaction fee by using the free bandwidth and free energy obtained from frozen TRX in the contract. According to the example in the figure, the energy consumption can be fully beared by the HKDT smart contracts, in such a situation, the user can ignore the Energy System to enjoy the zero fee transactions.

Shasta Testnet in TRON

Although zero fee HKDT smart contracts trading can be achieved in TRON, this project is not going to use the Mainnet in TRON because of some compulsory payment such as registration fee, which is explained in the challenges. Every blockchain system would have multiple subnets and there must be one Testnet provided for users who want to test the reliability of corresponding blockchain systems or developers who want to test the HKDT smart contracts before publishing to the other subnets. Testnet is just totally copied from the mainnet, but they will have different blocks and chains. The unique feature provided in Testnet is providing free faucet services. In TRON, that means, all TRON users in Shasta Testnet can get free TRX, the coin in TRON, to do the trading. With the use of Shasta Testnet, this project can test the HKDT smart contracts freely and different situations that may be faced after publishing the HKDT smart contracts in the Mainnet.