## What is HACD?

The full name of HACD is Hacash Diamond, is a string of data that is compressed and calculated by a 32-bit hash value to meet a specific format. Each block can only contain at most one diamond (or not, depending on the computing power). The production algorithm is:

hash256((genesis_block_hash || prev_diamond_block_hash ) + belong_user_public_key + nonce_number) ==> length_16_string

Specifically, the genesis block hash or the previous block hash containing diamonds plus the public key of the target owner, plus any nonce number is hashed to get a 64-bit string value, similar to:

35534631f31dfcf12200cdbad65c66ffb9d3fbd3ac985aa8a401bc4c3616bab3

Perform a special compression operation on the result derived in the previous step, and map every 4 bits to the character list 0WTYUIAHXVMEKBSZN to obtain the following 16-bit string result:

0NMSAK0ZYNSNBAZM 、 00000000IXVKHNHZ or 0000000000UKNWTH

When the result satisfies the requirement that at least the first ten digits are 0 and the last few digits do not contain 0, a diamond is produced. Based on the above result, we call the literal value (Identifier) of this diamond UKNWTH, and the literal value is unique and unrepeatable.

At this time, the diamond is packaged into a block and broadcast. All diamond producers stop the previous calculations, and use the hash value of this new block to restart the calculation of the literal value of the next diamond. If multiple diamonds are generated in the same block time, the miner chooses one to pack into the block (maybe the one with the highest handling fee).

The literal value of the Hacash Diamond is composed of 16 characters of WTYUIAHXVMEKBSZN.

The total limit of Hacash Diamond is 16^6 = 16777216.

It takes about 25 minutes to mine a Hacash Diamond for every 5 blocks. Regardless of the surge in difficulty, to mine all diamonds takes at least:

16777216*5*5 / (60*24*365) ≈ 800 years

Up to 60*24 / (5*5) (about 58) diamonds can be dug every day, and a maximum of about 21,000 can be produced every year.

Every time one is excavated, the overall difficulty of excavation will increase correspondingly. As the number of excavations increases, it increases exponentially, and eventually approaches infinity.

The calculation difficulty is adjusted every 3277 diamonds (3277 = 16^6 / 256 / 20). When the first 20 bits of the 32-bit hash value are all 0, the mining difficulty reaches the maximum and all diamonds will be dug out at this time.

However, due to the characteristics of hash calculation, the difficulty of mining will increase exponentially. In fact, it is impossible for all diamonds to be dug out.

Depending on the level of computing power, after a certain balance point (for example, several million), mining a new diamond needs to consume a large amount of computing power of the entire network, which will make the marginal output of diamond mining smaller and smaller.