But the mining difficulty is really hard today, so it requires a lot of hashpower (lots of electricity costs and lots of machines running) to be able to successfully mine a block. If you don’t have lots of mining hardware, you will probably never be able to mine a block. That’s why you have mining pools. So many people can join together the find the correct nonce for this candidate block all together. And when someone finds the right nonce and the block is accepted, the money gets divided among all people in that mining pool
Today on every successfully mined block, the miner gets 6.25BTC + all transactions fee’s of all transactions that the miner includes in his block. The first transaction in a block is called the coinbase transaction, wich is the block subsidy + all fee’s that get send from nowhere to a bitcoin address of the miner.
Every 210,000 blocks, The block subsidy is cut in half, so bitcoins will become more scarce over time. If you calculate every block subsidy from the genesis Block (1st bitcoin block) at a rate of 10 minutes per block (that difficulty adjustment wants to assure) there will be maximum 21 million bitcoin ever in existence!
(and a lot of bitcoin is already lost by people who lost their private keys etcetera, so in reality, there will be much less bitcoin in circulation)
I thought I knew about Bitcoin and yet on this basic course I learned so much and yet it was easy to understand and to do. I really appreciate this academy.
I am struck by the nature of the blockchain how it is so consistent with valuing the individual action and the fact that it can’t be removed only added to. This is such a metaphor of a life philosophy where the individual has value as they are unique and no one ever can be that person, however, they may add to their life through experience. It is quite beautiful really. The entire simplicity is remarkable and the trustless environment it creates will change society if we allow it. Quite remarkably, this small digital world can be a seed that shifts society to the degree that we altogether begin to level the playing field for people from all walks of life, all educational backgrounds and all socio-economic backgrounds by the nature that they form their own bank and that they do not have to go through a third party to effect their transactions. I could write about this for a long time. for now I will leave it at that.
Question regarding mining difficulty:
When the target is lower, the difficulty to solve is higher: why can’t miners set their computers to only explore the range between 0 - target number?
I guess then this would only reverse the situation, in that the lower the target number the easier to solve etc.
I’m not sure I filly understand what you mean. Hash numbers are random numbers, you can’t just explore lower ranges. You have to calculate the hash and then compare it to the target.
It could be reversed so that the target hash had to be higher, but its just not how it was implemented.
The more miners (or technically more hashpower) the faster blocks will be produced. So every 2016 blocks difficulty gets adjusted to maintain an average of 2016 blocks mined in 2 weeks (= 10 min per block on average) . If 2016 blocks get mined quicker than 2 weeks, difficulty goes up, so the target will go down, so less possible block hashes are valid. A lower target means that the blockhash must have more leading zero’s. Wich is hard to find. So if you construct a block that contains valid information and transactions, when you hash that block, the hash needs to start with a bunch of leading zero’s. So you must keep changing a random number (the nonce) and hash it again until the hash is lower than target. If you check the block explorer, you will see that all bitcoin blocks their hashes starts with a bunch of zero’s
Try playing here:
Thanks for the detailed response and link, Fabrice
Thanks @Alko89 There’s no way to program the random number generator to randomly explore within a number range because the nonces it randomly chooses are just guesses as to what new hash number it will generate when added to the main hash - it doesn’t know what the result will be by adding the new random number, so it has to keep guessing. If it knew how to do this, the system would fall apart because it would know which numbers to add every time…I think this makes sense, right?
It’s the nature of Sha256. Change 1 character, and the hash is completely different, so you basically brute force it by changing the nonce, hash again an check if the hash is now starting with enough leading zero’s (below target) and change nonce again, hash again and check… repeat and repeat until you’re lucky enough and have a valid block that you can broadcast to the network and get rewarded
Correct, the beauty of hash functions is that the result is always seemingly random and there is no way of finding some pattern in what way to add or remove certain characters to influence the output.
If this would be the case it could mean the hash function is broken.
Regarding how miners select transactions for their block
Will they search multiple mempools and cherry pick which transactions have the highest fees until the essentially maximize value through fees? Or do they generally select entire mempools that have cumulatively the highest fees and remove duplicate transactions before moving on to the next highest Mempool fee sum?
Essentially, what is the current game theory on building a block? Do miners maximize fee profit by building blocks that have only transactions with the highest fees vs saving time in building a block to begin finding a nonce? Insight with how much block rewards make up the reward and currently tie into the current game theory is appreciated.
As always, a general thanks to this community as well!
Each node has its own mempool and when a miner is building a block it only picks transactions from its own mempool.
Before miners can begin finding a correct nonce for the block they must fill it with transactions. From those txids they construct a merkle tree which root is then used in combination with the nonce to find the correct hash to be able to put it on the blockchain.
Mostly miners are choosing transactions with the highest fee, but some might be programed in a way to prioritize transactions from specific addresses or have their own rules in general.
Thank you for your answer.
thank you for mining simulator link.
As i understood from Ivan , there is only one private key for every wallet which can have many customers funds inside. So the users use an application from the exchange , which tells the exchange server what you want to do with your funds. Then the Exchange server which stores the wallet private key where your funds are , what to do for example sending any amount you wish whereever you want.
Hey,
What happens with miners reward in the event of a stale block being dropped?
The reward is dropped like any other transaction. Because the block reward is just a special kind of transaction called a coinbase.
I thought that the miner is rewarded with block reward and TX fee when his block is added to the blockchain? When is the miner rewarded? After 6 confirmations?
It is, coinbase is the block reward and is included in the block. The coinbase doesn’t unlock after 100 confirmations. So a miner must wait at least that long to be able to spend its reward.
how much info can there be at most in a block?