Hcash Technology research and development

Technology research and development:

 

1.Firstly, Enclosed developers and researchers have had a full discussion about the goals. Our short-term goal is to get the test net ready by the end of September. We have converted the goal into small tasks and assigned the tasks to different people, so that they can share out the work and cooperate with one another to make sure the R&D progress orderly.

 

2.We have had further detailed discussion about the HCash consensus mechanism, and confirmed that it is not only innovative but also feasible.  We have also had a deep analysis about the security and efficiency of the mechanism. We have proved in theory that it can prevent ‘selfish mining’ (a form of economic attack),  and it has good robustness (fault-tolerance)  and consensus convergence, besides, it supports high throughput.

 

Introduction to HCash mixed consensus mechanism:

 

Before we design the consensus mechanism, we have to make clear which public blockchain technology HCash should adopt. After deep and thorough research, we find blockchain technology has already many achievements in consensus mechanism, extensibility, performance, security and privacy. This technology has proved itself in cryptocurrency or other blockchain applications in the market for a long time. This technology is relatively mature and reliable, even though the performance can be improved, the consensus mechanism can be optimised in innovative ways, and security mechanism can be enhanced further. Compared to blockchain technology, DAG technology has features such as unlimited block size, scalability, much better performance,  performance positively correlated to transaction frequency and flexible message format. Those features have a lot of application scenarios, but DAG technology has not been fully proved by theoretical research or practise. There is no public academic research on public blockchain based on DAG technology so far. Meanwhile, we find distributed ledger system based on DAG technology is immature, e.g., IOTA’s system security mostly depends on transaction frequency, Byteball’s consensus algorithm has flaw and it depends too much on a few witness nodes. We adopt relatively mature blockchain technology to avoid the high risks associated with DAG technology.

 

In 2008,  Satoshi Nakamoto presented a creative way to apply blockchain technology to a decentralised digital currency system in bitcoin white paper.  Since then, people have proposed many new digital currency solution to refine, adjust, extend and improve existing protocols. The most striking idea and implementation includes Ethereum (with a virtual machine layer which supports smart contract), CryptoNodes and ZeroCash (with a different solution to protect privacy), Dash and Decred (which implemented mixed consensus and basic DAO), IOTA and ByteBall (which increases transaction throughput with DAG), Bitcoin-NG (which increases transaction throughput with keyBlock and microBlock dual chain structure),  side chain technology (which bridges different digital currency systems)

 

Bitcoin’s consensus mechanism PoW (Proof of Work) has many advantages, including stability (fully proved in practise), strong fault-tolerance, good incentive mechanism and supporting dynamic nodes joining and leaving. Meanwhile, because PoW has issues such as high energy cost and centralised mining,  a common improvement of bitcoin protocol is to modify its consensus mechanism, e.g., replacing PoW with PoS (Proof of Stake). However, pure PoS has also a lot of issues, e.g., stability has not been proved in practise, security needs to be enhanced. One source of instability in PoS is stake holders can produce timestamp history easily (hence to produce fake blocks)

 

Another disadvantage of bitcoin is that it can process maximum 7 transactions per second only, which imposes a limit on user scale (Maximum 600 thousand users can execute one transaction per day). Improvements on this issue includes:

 

  • Reduce block time
  • Increase block size
  • Adopt dual chain structure
  • Introduce lightening network
  • Adopt DAG

 

Solution (1) sacrafice security. Ethereum (whose block time is 20s to 30s) has proved that reducing block time can affect system security and stability. Ethereum adopts disputed GHOST protocol to inhibit the bad effect of short block time. Solution (2) increases communication cost between nodes. Bitcoin-NG adopts Solution (3). The main idea is: miner produces keyBlock once solving a hash problem and then miner can produce minorBlocks periodically before next keyBlock appears. System security and robustness builds on the PoW mechanism of keyBlock, while system throughput is improved significantly by microBlock. However, Bitcoin-NG has 2 potential security flaws: one is that it cannot prevent selfish mining effectively, and the other is that miner can produce a lot of microBlocks between keyBlocks, so that a lot of forks can happen and seriously affect consensus convergence, and also increases communication cost. Solution (4) is off-chain transaction mechanism, which can be used in high frequency micro payments. Solution (5) can possibly improve performance,  but it has not been proved in theory or practise, and its consensus mechanism has security flaw.

 

So far, mainstream cryptocurrencies either adopt pure PoW (such as Bitcoin, Litecoin, Monero, etc) or mixed PoW/PoS (such as Decred, DASH). These cryptocurrencies have limitations on performance or efficiency. HCash’s goal is build secure, stable and reliable public blockchain with high performance, and achieve quantum resistance, interoperability, smart contract, wallet’s private key protection progressively by iterative research and development.  Therefore, we propose secure, highly performant and flexible new consensus mechanism in HCash. This mechanism has two characteristics: on one hand, mixed PoW/PoS can incentivise miners and stake holders to participate the consensus to improve security and flexibility, and it also provides assurance for basic DAO to do protocol upgrade and community project investment; on the other hand, dual chain structure and dual mining mechanism can improve performance and efficiency greatly without compromising security.

 

Our consensus mechanism not only learns from Decred and Bitcoin-NG but also has  its own innovation. Firstly, we introduces Bitoin-NG’s keyBlock/microBlock dual chain structure to PoW. We propose two level mining to solve Bitoin-NG’s selfish mining issue. We divide PoW difficulty into two levels. Miners who solve high level hash problem produce keyBlock, while those who solve low level hash problem produce microBlock. This way can prevent miners manipulating system by producing  microBlocks arbitrarily, hence improve system performance and efficiency without affecting security. Secondly, we introduce Decred’s voting ticket and voting mechanism (a flexible and pragmatic PoS mechanism) to solve selfish mining, improve consensus robustness (e.g., preventing 51% attack effectively) and flexibility (supporting both PoW and PoS).  We combine the PoW enhanced by dual chain structure and two level mining with the PoS organically to produce a new mixed consensus mechanism. In the new mixed consensus mechanism, keyBlock must gain enough voting tickets to be deemed valid, so both PoW miners and PoS miners can participate consensus and play an important role. We implement basic DAO based on the consensus mechanism, so that all the miners and HCash holders can participate important decision making in the community, including protocol upgrade, community project investment, etc. At the same time, our solution supports SegWit to facilitate future quantum resistant signature and lightening network development. The solution diagram is below:

 

 

 

 

Figure 1. Solution Diagram

 

We compare HCash’s transaction throughput with BTC, BTC after fork Aug 2017, BCC and Decred in table 1. We can get different transaction throughput metrics by adjusting block size and microBlock time (or micoBlock difficulty). Current HCash parameters are in bold font.

 

 

keyBlock

Block time

Block size

microBlock

Block time

Transaction size

Transaction throughput

TPS

BTC

10 min

1MB

--

250B

6.99

BTC (after Aug 2017)

10 min

2MB

--

250B

13.98

BCC

10 min

8MB

--

250B

55.92

Decred

5 min

1MB

--

250B

13.98

Hcash

5 min

2MB

18.75 sec

250B

447.39

Hcash

5min

8MB

18.75 sec

250B

1789.57

 

Table 1. HCash transaction throughput compared mainstream cryptocurrencies

 

Table 2 shows correlation between attacker success probability and attackers’ computing power proportion and ticket pool proportion

   Tiket pool proportion

Computing power proportion

0.0500

0.1000

0.1500

0.2000

0.2500

0.3000

0.3500

0.4000

0.4500

0.5000

0.0500

0.0001

0.0005

0.0014

0.0032

0.0060

0.0102

0.0159

0.0239

0.0348

0.0500

0.1000

0.0001

0.0010

0.0030

0.0068

0.0127

0.0212

0.0330

0.0491

0.0708

0.1000

0.1500

0.0002

0.0015

0.0048

0.0107

0.0200

0.0332

0.0515

0.0758

0.1080

0.1500

0.2000

0.0003

0.0022

0.0068

0.0151

0.0281

0.0465

0.0714

0.1042

0.1464

0.2000

0.2500

0.0004

0.0029

0.0090

0.0201

0.0371

0.0610

0.0930

0.1342

0.1861

0.2500

0.3000

0.0005

0.0037

0.0116

0.0257

0.0472

0.0771

0.1164

0.1662

0.2272

0.3000

0.3500

0.0006

0.0046

0.0145

0.0320

0.0585

0.0950

0.1420

0.2003

0.2697

0.3500

0.4000

0.0008

0.0057

0.0179

0.0394

0.0715

0.1150

0.1701

0.2367

0.3138

0.4000

0.4500

0.0009

0.0070

0.0219

0.0479

0.0863

0.1375

0.2010

0.2756

0.3595

0.4500

0.5000

0.0012

0.0086

0.0266

0.0579

0.1035

0.1631

0.2352

0.3174

0.4069

0.5000

0.5500

0.0014

0.0104

0.0323

0.0699

0.1237

0.1923

0.2732

0.3624

0.4561

0.5500

0.6000

0.0017

0.0128

0.0394

0.0844

0.1476

0.2262

0.3156

0.4109

0.5071

0.6000

0.6500

0.0021

0.0158

0.0483

0.1025

0.1766

0.2657

0.3635

0.4634

0.5602

0.6500

0.7000

0.0027

0.0197

0.0600

0.1255

0.2122

0.3126

0.4177

0.5204

0.6155

0.7000

0.7500

0.0035

0.0252

0.0758

0.1557

0.2573

0.3689

0.4798

0.5825

0.6730

0.7500

0.8000

0.0046

0.0334

0.0986

0.1974

0.3159

0.4380

0.5516

0.6504

0.7329

0.8000

0.8500

0.0065

0.0466

0.1341

0.2584

0.3955

0.5248

0.6354

0.7249

0.7954

0.8500

0.9000

0.0103

0.0721

0.1975

0.3562

0.5096

0.6369

0.7346

0.8072

0.8606

0.9000

0.9500

0.0216

0.1409

0.3419

0.5388

0.6869

0.7873

0.8538

0.8983

0.9287

0.9500

1.0000

1.0000

1.0000

1.0000

1.0000

1.0000

1.0000

1.0000

1.0000

1.0000

 

 

Table 2. Correlation between attack success probability and attacker’s ticket pool proportion and computing power proportion

 

We introduce all the components of HCash mixed consensus solution in detail design document and give deep analysis of security (including selfish mining, robustness, consensus convergence) and performance

 

3.We have successfully established HCash private network environment and experiment environment, based on which we can do iterative code development and functional test.

 

4.We have done functional module definition and division, based on which we can define interfaces between modules.

 

5.We have started implementing HCash dual chain structure and two level mining mechanism based on detailed design of HCash consensus mechanism. We have already implemented block producing and chaining of keyBlock and microBlock.

 

6.We have designed test cases and verification solution. HCash two level block producing and chaining have been verified. Two level block network syncing is still under development.

 

7.We have done code analysis and review of completed functional modules. Meanwhile, we have completed dynamic PoW difficulty adjustment algorithm. PoS module is still under development.