POW NFT — Intro to Mining

What is mining?

Mining is a basic process which is the foundation of all blockchains. It was first described in Satoshi Nakamoto’s Bitcoin whitepaper over a decade ago. Mining is essentially a process of running a relatively simple calculation called a hashing algorithm millions of times, with slightly different data each time, until you get a desired result.

What is a hashing algorithm?

In the simplest terms, a hashing algorithm is a set of instructions (algorithm) that can take any data and can scramble it all up together and spit out some other data that just looks like junk (we call this output a hash, and it isn’t actually junk — it can be quite useful!)

Hashes in proof-of-work mining

Now that you know how hashes work, you might be wondering how this applies to mining. Ethereum, Bitcoin and many other blockchains all use a process called Proof-of-Work. POW mining basically means running a hash over and over again until the number it outputs is below a specific number called the block target.

  1. All the transactions that people currently want to make*
  2. An extra transaction with the miner’s address, saying “give me all the transaction fees as a prize”
  3. The hash of the previous block
  4. The nonce (the number they add to if the last hash wasn’t small enough)

Mining NFTs

POW NFT is the first NFT ever to require mining to mint tokens. People hoping to get their hands on a new token need to run a hash over and over until they find one bellow the current target. The three things that go into the hash are:

  1. The hash of the previous token
  2. The Ethereum address of the person mining
  3. A nonce
hash = uint(keccak256(abi.encodePacked(address miner,bytes32 previous_hash ,uint nonce)));
difficulty = BASE_DIFFICULTY / (DIFFICULTY_RAMP**generation);
if(generation > 13){
difficulty /= (tokenId - 2**14 + 1);
uint BASE_DIFFICULTY = uint(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)/uint(300);
generation = floor(log2(tokenId));

The Difficulty Bomb

From the start of generation 14, every time a token is mined the difficulty will increase, asymptotically approaching a level of infinite difficulty. This sets an approximate limit on how many tokens will ever be mined, without forcing hard caps on token supply.

Start mining NFTs in your browser



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Parker

Andrew Parker

Codeslinger. Melbourne based Solidity developer for hire.