The topic of the development of Shanzhai coins (what is the mining mechanism of virtual currency?) )

Source: Internet
Author: User
Blockchain Enthusiast (qq:53016353)
As the cottage currency is officially running, more and more friends are asking how the ether is digging. This article combines the information we currently know and hopes to help you. As the design and improvement of mining algorithm is still in progress, the following information is for reference only.


The mining mechanism of the etheric coin


Design goals


Resistance mining Machine (ASIC resistance). The advantages of using specially optimized chips should be as small as possible, so small that even mining with ordinary CPUs can generate revenue.
The light client can be verified. The light client should be able to verify the authenticity of each block. The goal is to run a C-implemented verification algorithm on a normal desktop computer, with a validation time of less than 0.01 seconds, less than 0.1 seconds with Python or JavaScript, and no more than 1MB of memory.
Mining algorithm


The mining algorithm of the etheric currency (ether) is called Ethash, aka Dashimoto (Dagger-hashimoto), which is a variant of Hashimoto algorithm combined with Dagger. It is characterized by the efficiency of mining is basically independent of the CPU, but is positively correlated with memory size and memory bandwidth. The requirement for memory size and bandwidth means that miners ' chips, which are deployed on a large scale through shared memory, do not have linear or ultra-linear (super-linear) growth in mining efficiency.


Let's take a look at the basic flow of Dashimoto:


For each block, one seed (seed) is calculated first. The seed calculation relies only on the information of the current block, such as block number and block headers.
Uses a seed to produce a pseudo-random data set of 32MB, called the cache. The light client needs to save the cache.
The cache is regenerated into a 1GB-sized dataset called the DAG. Each element in the dataset relies on only a few elements of the cache, in other words, a cache can be used to quickly calculate the element in the specified position in the DAG. The full mining-able client needs to save the DAG.
Mining can be summarized as the process of randomly selecting elements from a dag and then hashing them. The same is true of the validation process, except that the element is not selected from the DAG, but rather the element of the specified location is computed based on the cache, and then the hash result of this element collection is less than a certain value. Because the cache is small and the DAG element at the specified location is easy to calculate, the verification process requires only the normal CPU and normal memory to complete.
The cache and DAG are updated once for each cycle, and the length of a cycle is 1000 blocks. This means that the 1000 blocks produce the same cache as the DAG, so the main job of mining is to read the data from the DAG instead of updating the cache and DAG. The size of the DAG grows linearly over time, starting from 1GB, which increases annually about 7gb– so that to December 2015 is approximately 8GB, to December 2016 about 15GB.
Note: The figures in the above steps have been adjusted with the development of the progress, the exact value please refer to the source code.


Mining software


We expect to have at least two mining methods at the time of launch:


Use the Mist client (the official client implementation, based on the Go language) for CPU mining.
GPU mining is done through a combination of the Shanzhai daemon (ETH daemon) and the Sgminer. The data communication before the daemon and Sgminer can be done through the JSON-RPC API. There are currently two APIs associated with mining: Eth_getwork and Eth_submitwork.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.