# ERC 1918: Standard for SHA3 Ethereum Miners
#### License: Apache 2
## Purpose:
This ERC 1918 exists as a supplement to ECIP1049, changing Ethereum Classic's proof of work to SHA3. All references to SHA3, refer to the Keccak-256 variation.
ERC-1918 provides a clear standard for those creating mining hardware and software for a SHA3 Ethereum Proof of Work system. ERC-1918 is the set of best practices to implement ECIP-1049. This is non-binding and intened to help provide clarity to consumers and businesses.
**Any piece of hardware or software that comply with Test 1 and 2 below can utilize the "SHA3 Ready" badge below.**
All questions should go to the [telegram room here](https://t.me/sha3etc)

## Summary
As a reference implementation we have created the SHA3 Toy Miner. This is an open source CPU miner written in Python3 that follows the ECIP-1049 standard. The toy miner gives diagnostic information that is useful.
The toy miner can do 200,000+ hashes per second on a single Digital Ocean vCPU. All strings are UTF8.
A very useful Ethereum System Schematic is [here](https://cdn.discordapp.com/attachments/223675625334898688/534597157693685760/eth.jpg).
## Installation of the Toy Miner
First step is to install an Astor Testnet node. This information is found [here](https://astor.host/node/#running-an-astor-node-30-minutes).
The next step is to run the toy miner. The instructions for this are found [here](https://astor.host/node/#running-a-sha3-miner-5-minutes).
Make sure you have the node running locally when you run the miner. You need Python 3.6 to run the miner.
## Test 1
```
$ python3.6 miner.py http://127.0.0.1:8545 -n 1000000000000000
_____ _____ _____ ___ _____ _____ _
| __| | | _ |_ | |_ _|___ _ _ | |_|___ ___ ___
|__ | | |_ | | | | . | | | | | | | | | -_| _|
|_____|__|__|__|__|___| |_| |___|_ | |_|_|_|_|_|_|___|_|
|___|
KECCAK256 CONTROL HASH OF "ETC": 49b019f3320b92b2244c14d064de7e7b09dbc4c649e8650e7aa17e5ce7253294
```
The first step is to confirm that your miner can prodcue the control hash. If you can Keccak256 hash a UTF8 version of "ETC", it should produce```49b019f3320b92b2244c14d064de7e7b09dbc4c649e8650e7aa17e5ce7253294```. If it doesn't then the hashing function is not working. This is the same version of Keccak256 used throughout the Ethereum architecture.
## Test 2
```
**Got Work**
Difficulty: 6874890894458655032438639040107511393966887994239455036801738053625385
Block Number: 274361
Hashes Done: 46735342
Block Mining Time: 197.47705793380737
**Done Mining Block**
NONCE IS: 0x0000000002c91fee
BLOCK HASH IS: 0x25040f4720a8cc986f1c8bc8f8459d02394180d835cd8c5d13df1841c8bc54e5
MIX IS: 0x5985598559855985598559855985598559855985598559855985598559855985
WORK LIST: ['0x0000000002c91fee', '0x25040f4720a8cc986f1c8bc8f8459d02394180d835cd8c5d13df1841c8bc54e5', '0x5985598559855985598559855985598559855985598559855985598559855985']
VERIFICATION HASH OF NONCE: 2c482faff7cb437f6f1490e1bf7a05c09086c074e6c862fcfda0e409eb36df5f
VERIIFCATION HASH OF MINING HASH: ad84577f334ae59393e9795d24528a6cd8abe083e1730f40de3e597040cfb0c8
VERIFICATION HASH OF MIX: a80da2a4fd0387046b9c315bc5c3d3e3b258241e40e1dd03488c88d9390d37f8
VERIFICATION HASH OF WORK LIST: 037abd1568e4cc0d1ee52be395739aed739d52f07bd1d19be2de180e5a2f7219
**Submit Answer**
```
* `**Got Work**` indicates the CPU miner is connected to the node and is actively hashing.
* `Difficulty` is the current difficulty to mine a new block. The hash of the block, when cast to an integer needs to be less than the difficulty.
Anything after this shows up when a block is miend.
* ``Hashes Done`` is the number of hashes done to mine a block.
* ``Block Mining Time`` the amount of time in seconds it took to find the right hash.
### Now we get to the actual contents of the block:
-- `NONCE IS` this is the 64-bit nonce Integer that is chosen for the block. This goes into the header of the block itself.
-- `BLOCK HASH IS` this is the actual header hash of the block itself. This is a Keccak256 hash of the header's proof of work.
-- `MIX IS` this is a 256-bit Mix. This is where a miner can drop in metadata like worker-id, ip-address, and other things. For the toyminer we fill it with a random string repeated. Be creative!
-- `Work List` this is the entire work submission that gets fed to Web3 to hand off the node. It is is an array of the three elements above.
--- `Verification HASH OF NONCE` this is a Keccak256 hash of the nonce above.
-- `VERIFICATION HASH OF MINING HASH` this is a Keccak256 hash of the Block Hash above.
-- `VERIFICATION HASH OF MIX:` this is a Keccak256 hash of the MIX above.
-- `VERIFICATION HASH OF WORK LIST:` verificaiton hash of the work list above.
And then the block is submitted to the Parity node via Web3 and then to the rest of the network blockchain.
This is not mining pool software and is intended to demonstrate SHA3 functionality, not perform production mining.