[Ethereum] Does Ethereum use Ethash or KECCAK-256 (an alias to SHA3) as hash function

ethashhashkeccak

Ethdoccs says that the PoW algorithm Ethereum is using is Ethash. While I was searching around for information about Ethash, I ran across this post, which indicates KECCAK is the one. So what is Ethereum actually using?

Best Answer

A hash function is different to a proof-of-work algorithm. Much of the effort in following a proof-of-work algorithm involves making hashes, but they're distinct things.

Ethash is the proof-of-work algorithm. Keccak-256 is the most commonly-used hash function. Keccak-256 is used internally in places like when making hashes for block headers, but the place you're most likely to run into it, and the place discussed in the post you link, is when making hashes of things in your own Solidity contract. It's possible to implement other hash functions in Solidity for use in Ethereum contracts, but it's most common to use Keccak-256 (which the Ethereum community used to refer to as SHA3.)