forked from sovanpanhavathseng/eth-words
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ethash
7 lines (4 loc) · 913 Bytes
/
Ethash
1
2
3
4
5
6
7
Ethash is a Proof-of-Work (PoW) algorithm used in the Ethereum network to mine new blocks and validate transactions. It is a memory-hard algorithm that requires a significant amount of memory to solve the cryptographic puzzle, making it more resistant to ASIC mining and promoting decentralization.
The Ethash algorithm uses a combination of hashing and random number generation to create a unique "nonce" value that miners can use to solve the puzzle. The algorithm also requires a dataset called the DAG (Directed Acyclic Graph) that is stored in the memory of mining nodes.
Here is an example of the Ethash algorithm implemented in Python:
This code uses the mix function to create a new hash value from two input values, and the ethash function to generate a sequence of hash values based on a seed value and a number of iterations. This sequence can then be used as the nonce value for mining new blocks.