Author

Topic: Understanding bitcoin mining (Read 243 times)

newbie
Activity: 16
Merit: 2
April 03, 2021, 02:33:23 AM
#12
Please what are this basis for bitcoin mining, what is it all about
jr. member
Activity: 33
Merit: 8
April 02, 2021, 11:54:47 AM
#11
This is all good stuff, thank you everyone!
legendary
Activity: 4466
Merit: 3391
April 02, 2021, 04:35:41 AM
#10
How will transactions be recorded after the last block is mined in 2140?

That is another common misconception. Mining does not stop in 2140. The subsidy is reduced to by half every 4 years approximately (the "halving"), and it will be reduced to 0 by the year 2140, and block rewards after that will consist of only transaction fees.
legendary
Activity: 3472
Merit: 10611
April 01, 2021, 10:24:52 PM
#9
The amount in mempool is manually adjustable?
Mempool is the pool of transaction in each bitcoin full node's memory (RAM). Depending on how much memory they have available or want to dedicate to their full node the size of it can be different. Normally they set it to a value that can contain all transactions most of the time, but it can change to bigger or smaller value. When it is smaller they usually drop low fee transactions and only keep the high paying ones that have a higher chance of being confirmed.

Quote
10 minutes later when the next block is mined, are outstanding transactions prohibited from going into the previous block if there is still room?
When the block is found it can no longer be modified otherwise it will change the third field called "Merkle Root" and make the block invalid.

Quote
How will transactions be recorded after the last block is mined in 2140?
The same way they are today assuming Bitcoin protocol doesn't change in 100 years from now.
jr. member
Activity: 33
Merit: 8
April 01, 2021, 01:18:42 PM
#8
3 newb questions on bitcoin mining.

First, do all bitcoin miners, regardless of what pool they are attached to, mine the same single block?

Nope, each pool is free to include into candidate block any unconfirmed  transaction from its mempool. At any time the content of candidate block   which miners  mine depends on the pool. There is competition between miners attached to   different  pool in solving cryptographic puzzle for their own  candidate blocks.

Thank you!  You uncovered 3 more questions lol, hope you don't mind Smiley

The amount in mempool is manually adjustable?

10 minutes later when the next block is mined, are outstanding transactions prohibited from going into the previous block if there is still room?

How will transactions be recorded after the last block is mined in 2140?
legendary
Activity: 3472
Merit: 10611
April 01, 2021, 01:07:14 AM
#7
One more question regarding the block header.

Of all the 6 elements, is it the Block Time alone that guarantees everyone is working on a random hash?  To ask another way, if Block Time wasn't part of the header, would everyone be working on the same hash making it a contest of which miner is the fastest?
Code:
Version --> has to be bigger than a certain value (currently >=4) but can be anything up to 4.2 billion
Previous Block Hash --> same for everyone
Merkle Root --> different for each miner depending on transactions in that block
Block Time --> different for each miner depending on miner's computers time and how often it is updated in header
Target --> same for everyone
Nonce --> different for each miner

How many transactions can fit into a single block?
There isn't exactly any tx count limit, the actual limit is the size (or weight) of the block (sum of all transactions' weight). So the block can contain a single transaction that fills its entire size (1 MB) or 2 with a total of 4MB weight, or it can have thousands of smaller ones each taking smaller space to a total of 4 MB weight. Usually blocks are full and contain around 2000 transactions.

Quote
How does the miner decide which transactions will go into his mined block, is it automatic like an auction where the highest fees get in first?
Mostly based on fees, meaning they prefer transactions that pay them more so they can increase their profit.
jr. member
Activity: 33
Merit: 8
March 31, 2021, 01:43:10 PM
#6
Thanks everyone.

How many transactions can fit into a single block?  How does the miner decide which transactions will go into his mined block, is it automatic like an auction where the highest fees get in first?
legendary
Activity: 4466
Merit: 3391
March 31, 2021, 10:08:44 AM
#5
First, do all bitcoin miners, regardless of what pool they are attached to, mine the same single block?  For example, if a miner is solo or several miners are in a pool and the block is solved, do all miners everywhere in the world stop work and then start mining a new block (next in sequence), ie one block at a time?  Or can miners choose from a variety of blocks to mine?

Every miner works on the next block, but the contents of the next block is different for each miner. Miners are free to choose which transactions to include and exclude from a block. Miners race to make their block the next block.

Second, my layman's understanding of mining says that the input to create the hash is somewhat random? and largely based on the preceding attempts output hash.  For example, an output hash is generated and that output is then used as input for the next attempt by the miner.  Is this essentially correct?

The input for the hash is the block "header", which contains information about the block. The header also contains the previous block's hash. This chain of hashes determines the sequence of the blocks and also is why it is called a block chain.

Third, is the difficulty level based on the amount of leading zeros in the output hash?  For example if the bitcoin algorithm is calling for a high difficulty level, then the amount of preceding zeros required in the output hash is much higher, but if the algorithm is calling for a lower difficulty then the amount of preceding zeros in the output has is lower?

No, that is a common misconception. While counting the number of leading zeros was mentioned in the whitepaper, Bitcoin was never implemented using that. In the actual implementation, the block's hash must be less than a "target" hash (compared as numbers) in order to qualify. The difficulty is computed from the target hash value (it is the inverse). It is used as a metric by people but it is not used by the protocol.

Of all the 6 elements, is it the Block Time alone that guarantees everyone is working on a random hash?  To ask another way, if Block Time wasn't part of the header, would everyone be working on the same hash making it a contest of which miner is the fastest?

The nonce field is also used for varying the hash. In fact, that is its only function.

In addition, the merkle root can be varied by modifying the contents of the block. Since the coinbase transaction pays a different address for each miner, its hash will be different for each miner, and thus the merkle root will be different for each miner, and the block's hash will be different for each miner even if everything else is the same.
jr. member
Activity: 33
Merit: 8
March 31, 2021, 08:36:01 AM
#4
One more question regarding the block header.

Of all the 6 elements, is it the Block Time alone that guarantees everyone is working on a random hash?  To ask another way, if Block Time wasn't part of the header, would everyone be working on the same hash making it a contest of which miner is the fastest?
jr. member
Activity: 33
Merit: 8
March 28, 2021, 06:24:29 PM
#3
First, do all bitcoin miners, regardless of what pool they are attached to, mine the same single block?  For example, if a miner is solo or several miners are in a pool and the block is solved, do all miners everywhere in the world stop work and then start mining a new block (next in sequence), ie one block at a time?  Or can miners choose from a variety of blocks to mine?
All miners mine the same block - though this is a problem that most don't understand - that you must indeed switch blocks as quickly as possible, when someone finds a block.
Running a home bitcoin and a home miner pointed at it, is much more likely to lose the block, than mining to a high performance pool.

Quote
Second, my layman's understanding of mining says that the input to create the hash is somewhat random? and largely based on the preceding attempts output hash.  For example, an output hash is generated and that output is then used as input for the next attempt by the miner.  Is this essentially correct?
https://kano.is/index.php?k=minedet

Quote
Third, is the difficulty level based on the amount of leading zeros in the output hash?  For example if the bitcoin algorithm is calling for a high difficulty level, then the amount of preceding zeros required in the output hash is much higher, but if the algorithm is calling for a lower difficulty then the amount of preceding zeros in the output has is lower?
Yes
See the bottom of the page I linked.

Thank you, will try and absorb that Smiley
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
March 28, 2021, 05:58:18 PM
#2
First, do all bitcoin miners, regardless of what pool they are attached to, mine the same single block?  For example, if a miner is solo or several miners are in a pool and the block is solved, do all miners everywhere in the world stop work and then start mining a new block (next in sequence), ie one block at a time?  Or can miners choose from a variety of blocks to mine?
All miners mine the same block - though this is a problem that most don't understand - that you must indeed switch blocks as quickly as possible, when someone finds a block.
Running a home bitcoin and a home miner pointed at it, is much more likely to lose the block, than mining to a high performance pool.

Quote
Second, my layman's understanding of mining says that the input to create the hash is somewhat random? and largely based on the preceding attempts output hash.  For example, an output hash is generated and that output is then used as input for the next attempt by the miner.  Is this essentially correct?
https://kano.is/index.php?k=minedet

Quote
Third, is the difficulty level based on the amount of leading zeros in the output hash?  For example if the bitcoin algorithm is calling for a high difficulty level, then the amount of preceding zeros required in the output hash is much higher, but if the algorithm is calling for a lower difficulty then the amount of preceding zeros in the output has is lower?
Yes
See the bottom of the page I linked.
jr. member
Activity: 33
Merit: 8
March 28, 2021, 01:19:37 PM
#1
3 newb questions on bitcoin mining.

First, do all bitcoin miners, regardless of what pool they are attached to, mine the same single block?  For example, if a miner is solo or several miners are in a pool and the block is solved, do all miners everywhere in the world stop work and then start mining a new block (next in sequence), ie one block at a time?  Or can miners choose from a variety of blocks to mine?

Second, my layman's understanding of mining says that the input to create the hash is somewhat random? and largely based on the preceding attempts output hash.  For example, an output hash is generated and that output is then used as input for the next attempt by the miner.  Is this essentially correct?

Third, is the difficulty level based on the amount of leading zeros in the output hash?  For example if the bitcoin algorithm is calling for a high difficulty level, then the amount of preceding zeros required in the output hash is much higher, but if the algorithm is calling for a lower difficulty then the amount of preceding zeros in the output has is lower?

Thanks, just trying to understand how it works.
Jump to: