Whenever you are hearing about the bitcoin mining then you are envisioning coins as being dug out from the ground. However, you know that bitcoin is not physical and then why we are calling it as a mining.
Because it is very similar to the gold mining. In this, the bitcoins are existing in the protocol very similar like gold to be dug. The protocol of the bitcoins are stipulating 21 million bitcoins that are existing at the same point. The miners are bringing few them into the light at a time.
They are getting this as a reward for creating the blocks of transactions which are validated and which includes the blockchain https://atriark.com.
When we are backtracking a bit and then let talk about the nodes. The node is a very powerful software, which is running the bitcoin software and is helping in running the bitcoin by participating in the information which is then relayed. Anyone is able to run the node you need to just download the bitcoin software and leave the certain port open. The main drawback is that it is consuming energy and storage space. It is taking up to 145 GB of the network time when writing. The nodes are spread across the bitcoin transactions around the network. Then one node will send the information to few nodes whom they know. In this way, it will end up very quickly by getting around the full network.
There are some nodes which are mining nodes and which is referred as miners. These are grouping into the outstanding transactions in the blocks and adding them to the blockchain. This are done by solving the complex mathematical puzzle, which are the part of the bitcoin program, and all the answer are included in the block. Solving the puzzle would require to find the number that are when merged with the data in the block and is passed from a hash function which produces the result which is written in certain range. This is very hard than it sounds.
The trivia lovers are knowing this number as nonce, which is the concatenation of the number, which are once used.
How to find this number? By guessing randomly? There is a hash function, which make this impossible to predict the exact output. So there are miners who are guessing the mystery number and applying the hash function for combination of the guessed number and the data present in the block.
Resulting hash has to start with the pre-established number of the zeroes. There is now way in which we can know that which number would work because the two consecutive integers will give very varying results. There are several nonce, which are producing the desired results, or there are not any. In every case, the miners would always keep on trying but from configuring from different blocks.