Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate info on pow-mining from ethdocs and eth.wiki #5897

Merged
merged 18 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Mining algorithms
description: A detailed look at the algorithms used for Ethereum mining.
lang: en
sidebar: true
incomplete: false
---

This section includes detailed information about two Etheruem mining algorithms: Dagger Hashamoto and Ethash. Dagger Hashamoto is no longer used to mine Ethereum. It was superceded by Ethash, an upgraded version of Dagger-Hashamoto, several years ago. However, it has historical significance and is included here because it was an important innovation in Ethereum's development. Proof-of-work mining itself will be deprecated in favour of proof-of-stake during the merge which is expected to happen in summer 2022. To understand the information in this page it is recommended to first read our introductory pages on [proof-of-work consensus](/pow) and [mining](/mining).
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

The basic idea of both algorithms is that the miner tries, using brute force computation, to find a nonce input so that the result is below a certain difficulty threshold. This difficulty threshold can be dynamically adjusted so block production proceeds with a regular tempo.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

## Dagger Hashimoto {#dagger-hashimoto}

Dagger Hashamoto was a precursor research algorithm for Ethereum mining that was superceded by Ethash. It was an amalgamation of two separate algorithms: Dagger and Hashimoto.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We inconsistently are use

  • Dagger Hashamoto (no dash)
  • Dagger-Hasamoto (with a dash)

Any preference?

jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

[Dagger](http://www.hashcash.org/papers/dagger.html) involved the generation of a [Directed Acyclic Graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph), random slices of which were then hashed together. The core principle is that each individual nonce only requires a small portion of a large total data tree, and recomputing the subtree for each nonce is prohibitive for mining - hence the need to store the tree - but okay for a single nonce’s worth of verification. Dagger was meant to be an alternative to existing memory-hard algorithms like Scrypt, which are memory-hard but are also very hard to verify when their memory-hardness is increased to genuinely secure levels. However, Dagger was proven to be vulnerable to shared memory hardware acceleration and was then dropped in favor of other avenues of research.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

[Hashimoto](http://diyhpl.us/%7Ebryan/papers2/bitcoin/meh/hashimoto.pdf) is an algorithm that adds ASIC-resistance by being i/o bound (i.e. making memory reads the limiting factor in the mining process). The theory is that RAM is in principle inherently a much more generic ingredient than computation, and billions of dollars of research already go into optimizing it for different use cases which often involve near-random access patterns (hence “random access memory”); hence, existing RAM is likely to be moderately close to optimal for evaluating the algorithm. Hashimoto uses the blockchain as a source of data, simultaneously satisfying (1) and (3) above.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

Dagger-Hashimoto used amended versions of the Dagger and Hashimoto algorithmms. The difference between Dagger Hashimoto and Hashimoto is that, instead of using the blockchain as a data source, Dagger Hashimoto uses a custom-generated data set, which updates based on block data every N blocks. The data set is generated using the Dagger algorithm, allowing for the efficient calculation of a subset specific to every nonce for the light client verification algorithm. The difference between Dagger Hashimoto and Dagger is that, unlike in the original Dagger, the dataset used to query the block is semi-permanent, only being updated at occasional intervals (eg. once per week). This means that the portion of the effort that goes toward generating the dataset is close to zero, so Sergio Lerner’s arguments regarding shared memory speedups become negligible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sergio Lerner’s

who? what arguments?

jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

A detailed explanation is provided on our [Dagger-Hashamoto page](/developers/docs/consensus-mechanisms/pow/mining-algorithms/dagger-hashamoto).
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

## Ethash {#ethash}

Ethash is Ethereum's current mining algorithm. Ethash was effectively a new name given to a specific version of Dagger-Hashamoto after the algorithm had been updated in some fairly substantial ways, but still inheriting the fundamental principles of its predecessor.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

A detailed explanation is available on our [Ethash page](/developers/docs/consensus-mechanisms/pow/mining-algorithms/ethash).
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Mining
description: An explanation of how mining works in Ethereum and how it helps keep Ethereum secure and decentralized.
lang: en
sidebar: true
incomplete: true
incomplete: false
---

## Prerequisites {#prerequisites}
Expand All @@ -14,7 +14,11 @@ To better understand this page, we recommend you first read up on [transactions]

Mining is the process of creating a block of transactions to be added to the Ethereum blockchain.

Ethereum, like Bitcoin, currently uses a [proof-of-work (PoW)](/developers/docs/consensus-mechanisms/pow/) consensus mechanism. Mining is the lifeblood of proof-of-work. Ethereum miners - computers running software - using their time and computation power to process transactions and produce blocks.
The word mining originates in the context of the gold analogy for crypto currencies. Gold or precious metals are scarce, so are digital tokens, and the only way to increase the total volume is through mining. This is appropriate to the extent that in Ethereum too, the only mode of issuance post launch is via mining. Unlike these examples however, mining is also the way to secure the network by creating, verifying, publishing and propagating blocks in the blockchain.

Mining ether = Securing the Network = Verifying Computation
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

Ethereum, like Bitcoin, currently uses a [proof-of-work (PoW)](/developers/docs/consensus-mechanisms/pow/) consensus mechanism. Mining is the lifeblood of proof-of-work. Ethereum miners - computers running software - using their time and computation power to process transactions and produce blocks. The Ethereum blockchain is in many ways similar to the Bitcoin blockchain, although it does have some differences. The main difference between Ethereum and Bitcoin with regard to the blockchain architecture is that, unlike Bitcoin, Ethereum blocks contain a copy of both the transaction list and the most recent state (the root hash of the merkle patricia trie encoding the state to be more precise). Aside from that, two other values, the block number and the difficulty, are also stored in the block.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

<InfoBanner emoji=":wave:">
Proof-of-stake will replace mining and proof-of-work over the next year. You can start staking your ETH today. <a href="/staking/">More on staking</a>
Expand Down Expand Up @@ -60,6 +64,12 @@ Watch Austin walk you through mining and the proof-of-work blockchain.

<YouTube id="zcX7OJ-L8XQ" />

## The mining algorithm

The Ethereum mining algorithm has undergone several upgrades since its inception. The original algorithm, "Dagger Hashamoto" was based around the provision of a large, transient, randomly generated dataset which forms a [Directed Acyclic Graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph) (the Dagger-part), with miners attempting to solve a particular constraint on it, partly determined through a block’s header-hash. This algorithm was novel because it had high memory-access bandwidth requirements but could be run using a modest processor, making it GPU-friendly but resistant to the type of ASIC-driven hardware arms race that could pose a centralization risk. After substantial upgrades to the algorithm, it was renamed to "Ethash". Ethash is the mining algorithm Ethereum miners use today.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

More information on these mining algorithms is available at our [mining algorithms page](/developers/docs/consensus-mechanisms/pow/mining-algorithms/).
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

## Further reading {#further-reading}

- [What does it mean to mine Ethereum?](https://docs.ethhub.io/using-ethereum/mining/) _EthHub_
Expand Down
8 changes: 8 additions & 0 deletions src/data/developer-docs-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
items:
- id: docs-nav-mining
to: /developers/docs/consensus-mechanisms/pow/mining/
items:
- id: docs-nav-mining-algorithms
to: /developers/docs/consensus-mechanisms/pow/mining-algorithms/
items:
- id: docs-nav-dagger-hashamoto
to: /developers/docs/consensus-mechanisms/pow/mining-algorithms/dagger-hashamoto
- id: docs-nav-ethash
to: /developers/docs/consensus-mechanisms/pow/mining-algorithms/ethash
- id: docs-nav-proof-of-stake
to: /developers/docs/consensus-mechanisms/pos/
- id: docs-nav-ethereum-stack
Expand Down
3 changes: 3 additions & 0 deletions src/intl/en/page-developers-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"docs-nav-mev": "Miner extractable value (MEV)",
"docs-nav-mev-description": "How value is extracted from the Ethereum blockchain beyond the block reward",
"docs-nav-mining": "Mining",
"docs-nav-mining-algorithms": "Mining algorithms",
"docs-nav-dagger-hashamoto": "Dagger-Hashamoto",
"docs-nav-ethash": "Ethash",
"docs-nav-networks": "Networks",
"docs-nav-networks-description": "Implementations of Ethereum including test networks",
"docs-nav-nodes-and-clients": "Nodes and clients",
Expand Down
2 changes: 2 additions & 0 deletions src/intl/en/page-developers-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"page-developers-mev-link": "Miner extractable value (MEV)",
"page-developers-mining-desc": "How new blocks are created and consensus is reached",
"page-developers-mining-link": "Mining",
"page-developers-mining-algorithms-desc": "Information on Ethereum's mining algorithms",
"page-developers-mining-algorithms-link": "Mining algorithms",
"page-developers-networks-desc": "An overview of Mainnet and the test networks",
"page-developers-networks-link": "Networks",
"page-developers-node-clients-desc": "How blocks and transactions are verified in the network",
Expand Down
7 changes: 7 additions & 0 deletions src/pages/developers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ const DevelopersPage = ({ data }) => {
<p>
<Translation id="page-developers-mining-desc" />
</p>

<Link to="/developers/docs/consensus-mechanisms/pow/mining-algorithms/">
<Translation id="page-developers-mining-algorithms-link" />
</Link>
<p>
<Translation id="page-developers-mining-algorithms-desc" />
</p>
</Column>
<RightColumn>
<h3>
Expand Down