Skip to content

Commit

Permalink
translate mining articles
Browse files Browse the repository at this point in the history
  • Loading branch information
KaKeimei committed Jun 3, 2024
1 parent 048dab7 commit 4db590d
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docs/mining/concepts/acceptable-fee-rate-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,29 @@ sidebar_position: 7
---

# Acceptable Fee Rate Config

The acceptable fee rate refers to the minimum fee rate that miners are willing to accept during the mining process. If
the transaction fee rate is lower than the acceptable fee rate, miners will not include that transaction. The acceptable
fee rate is a crucial parameter for miners as it directly impacts their revenue.

Configuring the acceptable fee rate is an important mining strategy. Miners can set different acceptable fee rates based
on their circumstances. If the acceptable fee rate set by the miner is too high, they might miss out on some low-fee
transactions, thereby affecting their revenue. If the acceptable fee rate is set too low, they might accept some low-fee
transactions, but these transactions might reduce the connectivity between miners and increase the risk of orphaned
blocks. For more details, please refer to [Reorg and Orphaned Blocks](reorg-orphan-51attack.md).

Therefore, configuring an acceptable and reasonable fee rate is one of the important strategies for miners to
participate in the network game and maximize their revenue.

## Fee Rate Configuration Methods

In the [node startup command](../../nodes/installation/start-up-command.md), there are two parameters related to
transaction fee rates: `-blockmintxfee` and `-minrelaytxfee`.

- `-blockmintxfee`: The minimum transaction fee rate accepted for mining, measured in satoshis. Transactions with a fee
rate lower than this configuration will not be included in the block by the node. The default value is 500 sat/KB.
- `-minrelaytxfee`: The minimum transaction fee rate accepted by the node, measured in satoshis. Transactions with a fee
rate lower than this configuration will not be forwarded by the node. The default value is 250 sat/KB.

To improve node connectivity and balance network performance, it is recommended to use the default configuration during
mining.
134 changes: 134 additions & 0 deletions docs/mining/concepts/asic.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,137 @@ sidebar_position: 9
---

# ASIC

Introduction to the evolution of POW mining equipment.

## Evolution of Bitcoin Mining Equipment

The evolution of Bitcoin mining equipment reflects technological advancements and increased competition. From the
initial use of CPUs to GPUs, and eventually to Application-Specific Integrated Circuits (ASICs), each type of equipment
represents a different technological stage with its own characteristics.

### 1. CPU (Central Processing Unit)

**Significance**: When Bitcoin first emerged, mining primarily relied on the CPUs of ordinary computers. This was
because Bitcoin's computational difficulty was low, and there were few participants, allowing substantial rewards even
with CPU mining.

**Characteristics**:

- **High Availability**: Almost all computers have CPUs, making the initial entry barrier low.
- **Versatility**: CPUs can perform various computational tasks, not just mining.
- **Limited Computational Power**: CPUs have weaker parallel computing capabilities, resulting in lower mining speed and
efficiency.

**Hash Rate Range**:
Early CPU hash rates were very limited, typically ranging from a few MegaHashes per second (MH/s) to several hundred
MegaHashes.
Modern multicore CPUs can reach tens of MegaHashes per second, but they still lag significantly behind later mining
devices.

### 2. GPU (Graphics Processing Unit)

**Significance**: As Bitcoin gained popularity and mining difficulty increased, miners began seeking more efficient
solutions. GPUs, with their powerful parallel computing capabilities, gradually replaced CPUs as the mainstream mining
equipment.

**Characteristics**:

- **Strong Parallel Computing Ability**: GPUs have numerous computational cores, allowing them to handle multiple tasks
simultaneously, which is well-suited for Bitcoin mining's proof-of-work algorithm.
- **High Efficiency**: Compared to CPUs, GPUs perform hash calculations faster and with lower power consumption.
- **Wide Application**: Besides mining, GPUs are widely used in graphics rendering, scientific computing, and machine
learning.

**Hash Rate Range**:
GPUs' hash rates are significantly higher than CPUs, especially in parallel computing.
Early GPUs had hash rates around 100 MH/s to several hundred MH/s.
Later high-performance GPUs can reach hash rates of several GigaHashes per second (GH/s).

### 3. ASIC (Application-Specific Integrated Circuit)

**Significance**: To further enhance mining efficiency, ASIC devices specifically designed for Bitcoin mining emerged.
ASICs have taken Bitcoin mining's specificity and efficiency to the extreme, fundamentally changing the mining market
landscape.

**Characteristics**:

- **High Efficiency**: ASICs are custom-designed for specific tasks, and their computational power and energy efficiency
far exceed those of CPUs and GPUs.
- **Strong Specialization**: ASICs can only perform specific algorithm calculations, making them suitable for mining
Bitcoin and other specific cryptocurrencies.
- **High Cost**: Developing and manufacturing ASICs require significant investment, and the equipment is also expensive.
- **Market Concentration**: Due to ASICs' high efficiency and cost, the mining market has gradually become dominated by
a few professional miners with substantial capital.

**Hash Rate Range**:
ASIC devices are designed specifically for mining, with hash rates far surpassing CPUs and GPUs.
Early ASIC devices had hash rates of several GigaHashes per second (GH/s) to hundreds of GigaHashes.
Modern efficient ASIC devices, like Bitmain's Antminer S19 Pro, can reach hash rates of 200 TeraHashes per second (TH/s)
or higher.

Currently, MVC's mining algorithm is the same as Bitcoin's SHA-256, using ASIC devices.

## Introduction to ASIC

### Principle of ASIC

ASIC stands for Application-Specific Integrated Circuit, designed for specific uses. Unlike general-purpose CPUs and
GPUs, ASICs are specifically designed for particular computational tasks. In Bitcoin mining, ASICs' primary task is to
perform the SHA-256 hash algorithm, the core of Bitcoin's proof-of-work mechanism.

ASICs directly implement the steps of the SHA-256 algorithm through hardware circuits, avoiding the complex instruction
decoding and pipeline control needed by general-purpose processors, thereby significantly improving computational
efficiency and energy efficiency. This allows ASICs to perform the same tasks faster and with less power consumption
than CPUs and GPUs.

### Design Philosophy

1. **Specialization**: The design goal of ASICs is to focus on specific computational tasks. In Bitcoin mining, this
means ASICs are dedicated to performing SHA-256 hash calculations. The design team optimizes the circuits, removing
all unnecessary functions to maximize hash rate and energy efficiency.

2. **High Efficiency**: ASICs achieve extremely high computational efficiency through hardware-level optimization. Since
they do not need to handle other tasks, ASICs can complete massive hash calculations with minimal power consumption,
giving them an edge in the competitive mining market.

3. **Customization**: Each ASIC chip is meticulously designed and tuned to meet specific performance and energy
efficiency requirements. This customized design philosophy ensures significant performance improvements with each
generation of ASIC devices.

### Implementation Overview

1. **Circuit Design**: The first step in designing ASICs is circuit design. Engineers design efficient logic circuits
based on the SHA-256 algorithm's requirements, including arranging logic gates, registers, and clock signals. The
goal of the circuit design phase is to ensure that each hash calculation step can be completed in the shortest time.

2. **Logic Simulation**: After completing the circuit design, engineers use simulation tools for logic verification.
Through simulation, they can confirm the correctness and performance of the circuit design. This stage is crucial as
it can detect and correct design errors, ensuring the final chip's functionality and performance.

3. **Layout Design**: Following logic verification, the process moves to layout design. This involves translating the
logic circuit into a physical circuit layout, ensuring each component's actual position and connection on the chip.
Layout design must consider signal delay, power distribution, and heat dissipation to ensure the chip's stability and
high performance in real-world operation.

4. **Manufacturing and Testing**: After completing the layout design, the design files are sent to a semiconductor
manufacturing plant for chip production. Once manufactured, the chips undergo rigorous testing, including
functionality and performance tests, to ensure each ASIC chip meets design requirements.

5. **Packaging and Deployment**: Chips that pass testing are packaged and integrated into mining devices. Packaging not
only protects the chip but also provides necessary interfaces for installation and use. Finally, the packaged ASIC
chips are deployed in mining farms, starting efficient Bitcoin mining operations.

## Conclusion

The emergence and application of ASICs have ushered Bitcoin mining into an era of efficiency and specialization. Through
specialized circuit design, hardware-level optimization, and precise manufacturing processes, ASIC devices achieve
extremely high hash rates and energy efficiency, far surpassing traditional CPUs and GPUs. In the future, as
semiconductor technology continues to advance, ASIC performance and efficiency will further improve, providing more
robust support for Bitcoin and MVC mining and other specialized computing tasks.

The evolution from CPUs to ASICs also illustrates continuous technological progress and innovation, laying a solid
foundation for the development of cryptocurrencies and blockchain technology. The application of ASICs not only propels
Bitcoin mining forward but also offers new ideas and solutions for specialized computing in other fields. In the future,
ASIC devices will continue to play a crucial role, injecting new vitality into the development of blockchain and
cryptocurrencies.
161 changes: 161 additions & 0 deletions docs/mining/concepts/asicboost.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,164 @@ sidebar_position: 11
---

# ASICBoost

Introduction to a method to optimize mining power—ASICBoost.

In the field of Bitcoin mining, as competition becomes increasingly fierce, various optimization techniques have
emerged. Among them, ASICBoost is a technology that can significantly improve the efficiency of mining machines. This
article will analyze what ASICBoost is from a professional technical perspective, its implementation principles, why it
can improve the efficiency of mining machines, and how mining pools support ASICBoost.

## What is ASICBoost

ASICBoost is a technology proposed by Dr. Timo Hanke in 2016 that improves Bitcoin mining efficiency by optimizing the
SHA-256 hash calculation process. ASICBoost reduces the power consumption and time required for each hash calculation by
eliminating certain repetitive steps in the hash computation. This optimization can be implemented on existing ASIC
hardware without requiring physical modifications to the chip.

For a detailed understanding of the ASICBoost technology, please refer to the
paper: [AsicBoost - A Speedup for Bitcoin Mining](https://arxiv.org/pdf/1604.00575).

## Introduction to ASICBoost Principles

The core idea of ASICBoost is to utilize intermediate states of the SHA-256 hash calculation. The SHA-256 algorithm is
an iterative process where each round of computation depends on the output of the previous round. ASICBoost reduces the
total computation by introducing "intermediate state reuse" in the hash calculation.

Specifically, ASICBoost can be implemented in two ways:

1. **Explicit ASICBoost**:
- Explicit ASICBoost is a public and transparent method that optimizes proof-of-work (PoW) calculations by modifying
specific fields in the Bitcoin block header. This method requires changes to a part of the Bitcoin protocol and
can be detected by other nodes on the network.
- Explicit ASICBoost is mainly achieved by modifying the version field in the block header. This method requires
miners to make specific optimizations in their mining equipment and software. By adjusting the version field in
the block header to produce the same intermediate state, it reduces the computational load. Different version
numbers can map to the same intermediate hash state, allowing the reuse of previously cached intermediate states
when calculating new hashes.

2. **Covert ASICBoost**:
- Covert ASICBoost is a concealed method that optimizes PoW calculations without altering significant fields in the
block header. This method is difficult for other nodes on the network to detect, hence the term "covert."
- Covert ASICBoost is more complex and typically requires specific circuit design and optimization at the hardware
level to reduce the computational load.

**Differences**:

- **Transparency**: Explicit ASICBoost is open and transparent, easily detectable; covert ASICBoost is concealed and
hard to detect.
- **Implementation**: Explicit ASICBoost mainly involves modifying the version field in the Bitcoin protocol; covert
ASICBoost involves optimization through hardware circuit design.
- **Community Reaction**: Covert ASICBoost, being hard to detect and considered potentially unfair, is controversial
within the community. Explicit ASICBoost, being transparent, faces relatively less controversy.

Currently, the mainstream implementation of ASICBoost is explicit ASICBoost because it is relatively simple and easy to
implement, and it is also more detectable by other network nodes.

## Reasons for Increased Efficiency

The primary reasons ASICBoost can improve mining machine efficiency are:

1. **Reduced Computation**: By reusing intermediate states, ASICBoost reduces the total computational load required for
each hash calculation. This means that mining machines can perform more hash calculations in the same amount of time,
increasing overall hash power.

2. **Lower Power Consumption**: With fewer unnecessary computational steps, mining machines consume less power for each
hash calculation. This is particularly important for large-scale mining farms, as electricity costs are a significant
part of their operating expenses.

3. **Hardware Optimization**: ASICBoost does not require physical modifications to existing ASIC hardware and can be
implemented through firmware or software updates. This allows existing mining machines to quickly deploy and utilize
this technology to improve mining efficiency.

## How Mining Pools Support ASICBoost

To support ASICBoost, mining pools need to make some adjustments and configurations. This mainly involves the
verification and management of the work submitted by miners. Specifically, mining pools need to:

1. **Work Task Generation**: When generating work tasks, the mining pool needs to create tasks that can utilize
ASICBoost. This includes adjusting the version field in the block header to fit the ASICBoost computation model.

2. **Work Verification**: The solutions submitted by miners need to be verified by the mining pool. The mining pool must
be able to recognize and validate the hash calculation results using ASICBoost to ensure their legality and validity.

3. **Software Compatibility**: The mining pool needs to update its software to ensure compatibility with miners using
ASICBoost. This includes protocol adjustments and optimizations to support ASICBoost features.

4. **Collaboration and Coordination**: Mining pool operators need to collaborate with miners and ASIC manufacturers to
ensure the smooth implementation and deployment of ASICBoost technology. This includes providing technical support
and assistance to help miners implement and optimize ASICBoost.

## Stratum Protocol Changes

The [Stratum protocol](stratum-protocol.md) is a commonly used communication protocol between miners and mining pools.
To support ASICBoost technology, mining pools can make corresponding adjustments and optimizations through the Stratum
protocol. This includes:

**Protocol Extensions**: Mining pools can extend the Stratum protocol to add support for ASICBoost. This includes
defining new message types and fields to transmit ASICBoost-related information. Compared to the ordinary Stratum
protocol, ASICBoost extends the following plugins:

* "version-rolling"
* "minimum-difficulty"
* "subscribe-extranonce"

**mining.configure**: The mining pool can send ASICBoost-related configuration information to miners via the
mining.configure message. This includes specifying the method of using ASICBoost and version field adjustments, among
other things. This is also a way to distinguish ASICBoost miners from ordinary miners.

```json
{
"method": "mining.configure",
"id": 1,
"params": [
[
"minimum-difficulty",
"version-rolling"
],
{
"minimum-difficulty.value": 2048,
"version-rolling.mask": "1fffe000",
"version-rolling.min-bit-count": 2
}
]
}
```

**Using the version-rolling Plugin**: The version-rolling plugin is a crucial part of ASICBoost, used to adjust the
version field in the block header. Mining pools can send version field adjustment information to miners via the
version-rolling plugin to support the ASICBoost computation model.

```json
{
"method": "mining.configure",
"id": 1,
"params": [
[
"version-rolling"
],
{
"version-rolling.mask": "1fffe000",
"version-rolling.min-bit-count": 2
}
]
}
```

The mask field specifies the mask for the version field, and the min-bit-count field specifies the minimum number of
bits for version adjustment. These two fields determine the range that the version can be adjusted.

When handling work submitted by ASICBoost miners, the mining pool needs to adjust and verify the block header
accordingly based on this configuration to correctly package the transactions.

For more details, please refer
to [Stratum Extensions](https://github.com/slushpool/stratumprotocol/blob/master/stratum-extensions.mediawiki).

## Conclusion

As a technology to optimize Bitcoin mining efficiency, ASICBoost significantly improves the computational efficiency and
energy efficiency of mining machines by reducing repetitive steps in the SHA-256 hash calculation. Its implementation
principle mainly relies on reusing intermediate states, which can reduce computation and lower power consumption. Mining
pools can support ASICBoost technology through appropriate adjustments and configurations, providing a more efficient
mining environment for miners. As the Bitcoin network continues to develop, innovative technologies like ASICBoost will
play an important role in improving mining efficiency and reducing operational costs.
Loading

0 comments on commit 4db590d

Please sign in to comment.