What is X16R that TRVC 2.0 uses after the fork

Tan Ji Sheng
Aug 10 · 5 min read

Before we get into what is X16R hashing algorithm, we need to understand why is the hash algorithm being used. The hash algorithm is used in a process called the Proof-of-Work. Proof-of-Work is a concept where computers require a feasible amount of work in order to deter malicious uses of computing power such as launching denial-of-service (DoS) attacks or sending spam emails. Although it had already existed before Bitcoin, the coin became the first actualization of this concept on a large commercial scale.

Trivechain utilizes a digital distributed ledger technology known as a blockchain which serves as the foundation. The blockchain contains a record of all Trivechain transactions, assets transaction and other meta data which are arranged in sequential blocks, preventing any users from spending their holdings twice. In order to circumvent tampering or alterations, the ledger is publicly accessible and shared by all users, so a modified version would be easily detectable and rejected by other users.

Tampering with the ledger is detected through hashes, long strings of numbers that also serve as proof of work. Place a given set of data through a hash function (such as X16R), and it will only generate one hash. Due to the cascading effect, however, even a small change to any portion of the original data will result in a totally unrecognizable hash. Also, whatever the size of the original data set, the hash generated by a chosen function will always be the same length. The hash is a one-way function; it cannot reverse engineered to obtain the original data. It can only be checked to determine whether the data that generated the hash matches the original data.

The proof-of-work also solves the dispute of determining fair representation in majority decision making. If the majority were based on one-IP-address-one-vote, it could be subverted by anyone able to allocate many IPs. Proof-of- work is essentially one-CPU-one-vote. The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of CPU power is controlled by honest nodes, the honest chain will grow the fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of- work of the block and all blocks after it and then catch up with and surpass the work of the honest nodes. The probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added. To compensate for increasing hardware speed and varying interest in running nodes over time, the proof-of-work difficulty is determined by a moving average targeting an average number of blocks per hour. If they’re generated too fast, the difficulty increases.

The fight against ASIC miner

Every proof-of-work algorithm with the aim of preventing the existence of ASIC will fail because there is no absolute way of preventing it but there are ways to slow down the existence by making it harder to create such as using different types of algorithm. The Scrypt algorithm was introduced to prevent the use of SHA-256 ASIC miner. The X11 algorithms were introduced to prevent the use of the Scrypt ASIC miner. As long as the coin price is high enough, it will definitely lead to the appearance of ASIC miners.

The X11 is a hashing algorithm utilizes an unconventional approach also recognized as algorithm chaining. X11 contains all of 11 SHA3 candidates algorithm, wherein the chain, the calculation of each hash is submitted to the very next algorithm. Despite the complex chaining of hash algorithms, the D3 ASIC miner from Bitmain has made X11 mining with GPU and CPU not profitable. And that only people that bought the ASIC miner are able to maintain the honesty of the public blockchain instead of decentralized computers.

What is X16R?

Trivechain 2.0 will be using another hashing algorithm to ensure that the hobbyists are able to mine the TRVC with Central Processing Unit (CPUs) and Graphics Processing Units (GPUs).

The X16R hashing algorithm is based on the X11 philosophy of the X11 hashing algorithm to chain the basic hashing algorithms in an effort to thwart the move to ASIC mining. X16R algorithm uses 16 chained algorithms including the 11 hashing algorithm introduced in X11 with 5 more addition: BLAKE, BMW, Groestl, JH, Keccak, Skein, Luffa, Cubehash, Shavite, Simd, Echo, Hamsi, Fugue, Shabal, Whirlpool, Loselose, Djb2.

X16R is more than just chaining 5 more algorithms

The X16R algorithm improved more than just chaining of 5 additional algorithms. If the 5 algorithms are added to the chained hashing algorithm after the 11 algorithms included in the X11 algorithm. The ASIC manufacturers could be created easily by simply extending 5 more ASIC hashing algorithms to the machine.

Hence, the X16R solves the problem by constantly disrupting the hashing algorithm’s chaining order. The series order of 16 hashing algorithms is dynamically changed based on the hash value of the previous block.

This dynamic change of order does not make designing ASIC impossible but it will require the ASIC to make more adaptations to additional inputs and not all ASIC chipset will be used in finding a particular block. These operations are easy and do not require much modification for the CPU and GPU besides the software changes.

Principle of work of X16R

The X16R hashing algorithm consists of 16 hashing algorithms operating in chain fashion with the ordering dependent on the last 8 bytes (16 nibbles) of the hash of the previous block.

The algorithms are as follows:

Hexadecimal : Hashing algorithm
0: Blake
1: BMW
2: Groestl
3: Jh
4: Keccak
5: Skein
6: Luffa
7: Cubehash
8: Shavite
9: Simd
A: Echo
B: Hamsi
C: Fugue
D: Shabal
E: Whirlpool
F: SHA-512

Example:

Previous block hash: 0000000000000000007e8a29f052ac2870045ae3970270f97da00919b8e86287

The last 8 bytes: ​0x7da00919b8e86287

Each byte is consisting of 2 hexadecimals.
Hence, the last 8 bytes = the last 16 hexadecimals

Each hexadecimal determines which algorithm to use next.
cubehash -> shabal -> echo -> blake -> blake -> simd -> bmw -> simd -> hamsi -> shavite -> whirlpool -> shavite -> luffa -> groestl -> shavite -> cubehash

Given the example above, the algorithm 3,4,5,b,c,d,e,f are not being used in the calculation of the block hash and an ASIC miner will be idle during until the next block. Hence, the Miner is harder to be created.

Trivechain 2.0 core team have decided that in the event that X16R ASIC miner is created, there will be another hard fork for TRVC to move to a hashing algorithm that could provide more decentralization capability.

We welcome all of you reading this post to use your computer and start mining TRVC at one of the mining pool below:

Note: This article was initially posted on trivechain website as a blog post and now being moved to Medium official page

Trivechain

Trivechain (TRVC) is a games and entertainment public blockchain protocol. Visit https://trivechain.com to learn more.

Tan Ji Sheng

Written by

Main maintainer of Trivechain Protocol

Trivechain

Trivechain (TRVC) is a games and entertainment public blockchain protocol. Visit https://trivechain.com to learn more.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade