Skip to content

A Python program to simulate how much it would take for your CPU to mine a Bitcoin block in 2009.

Notifications You must be signed in to change notification settings

alessio-ds/mining-btc-in-2009

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Mining BTC in 2009

A Python program to simulate how much it would take for your CPU to mine a Bitcoin block in 2009.

Description

As you might know, to mine BTC you will need to find a SHA256 hash starting with 19 zeroes to get 6.25BTC ($215k, July 2021)

In 2009, only 8 zeroes were needed to mine a block and get 50BTC ($1.7m, July 2021)

However, this doesn't mean it's easy.

This program is made to mimic how much it would take to mine a single block in 2009.

How does it work?

To randomly generate SHA256 hashes, I decided to use this method:

  1. Set a counter that starts from 0
  2. I add this number to a random int going from 0 to 1 million
  3. I take this sum and cipher it into an hex value
  4. I finally encode this hex value into SHA256 using hashlib
  5. If the hash doesn't have enough 0's, the counter will add 1 to itself and start all over again.

About

A Python program to simulate how much it would take for your CPU to mine a Bitcoin block in 2009.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages