1

When a miner validates a block, does the block contain all transactions in Bitcoin for that time period? So does a miner validate an individual transaction between two parties, or are they validating transactions between all the parties in Bitcoin for that time period.

When you read examples about a transaction in Bitcoin, it makes it seem like each individual transaction (e.g. 1 Bitcoin from Bob to Alice) is its own block, validated by a miner.

1

3 Answers 3

4

The process of a transaction being created and included in the blockchain is as follows:

  1. The sender creates, signs, and broadcasts the transaction
  2. All Bitcoin full nodes, including miners and regular users, receive the transaction and validate it by making sure it follows the Bitcoin protocol rules
  3. Nodes temporarily store the unconfirmed/yet-to-be-mined transaction in a database called the "mempool" (each node has its own copy of the mempool)
  4. Miners combine many transactions from their mempool into a single block. They will put as many transactions as they can fit into a single block (based on the Bitcoin protocol rules)
  5. Miners begin hashing the block until they come up with an acceptable hash (this is proof-of-work mining)
  6. Once they have successfully "mined" the block by getting an acceptable hash, they broadcast the block to the network
  7. All full nodes receive the block and check to make sure the block and the transactions within it are all valid with regard to the Bitcoin protocol
  8. If the block is valid, nodes add it to their copy of the blockchain. They also remove the transactions within the block from their version of the mempool
  9. Non-mining nodes sit and wait for more transactions/blocks to come in for them to validate. Mining nodes go back to step 4, bundle more transactions into a new block, and repeat the mining process
4
  • After step 8 when the block is determined valid, will all transaction fees be awarded to the miner? So if there are 100 transactions, each with a transaction fee, they are all awarded to the miner? Commented Feb 9, 2020 at 5:38
  • Good answer, but note that this order of steps is not absolutely true. For example, a miner can create a tx broadcast it to nobody, but then include it in a block in the future. If it is valid, the block will be accepted (assuming it is otherwise still valid, of course).
    – chytrik
    Commented Feb 9, 2020 at 8:30
  • @W. Churchill: Yes, but miner must wait 100 blocks (most of a day) before they can spend it: bitcoin.stackexchange.com/questions/40655/… Commented Feb 9, 2020 at 8:40
  • @W.Churchill yes that is correct, the miner creates a "coinbase" transaction that they include in the block before they start mining/hashing it. The coinbase includes the block subsidy (currently 12.5 BTC) + all of the transaction fees for the transactions in that block. The coinbase transaction sends those bitcoins to the miner. Commented Feb 18, 2020 at 23:05
2

When a miner validates a block, does the block contain all transactions in Bitcoin for that time period?

See this question for info about the structure of a block.

A block can contain up to 4,000,000 weight units worth of transactions. So the miner can select transactions to include in the block, up to this limit. Generally, the miner will select the transactions that pay them the largest amount in fees.

So does a miner validate an individual transaction between two parties, or are they validating transactions between all the parties in Bitcoin for that time period.

A full node checks all transactions it hears about on the network, to ensure they are valid. If they are not valid, they will be discarded and ignored. When mining a block, a miner will use a full node to select only valid transactions to be included in the block template.

0

No. For example, I can make a TX now, a block can be found after the network pretty much all sees it but the miner doesn't include it (many reasons why this can happen, most likely one being it's a low fee TX and the block is already filled with higher fee TXs). It will then remain in mempools for varying amounts of time until a miner does include it in a block at some point in the future. (Sometimes it will never end up in a block. If the TX fee is 1s/b and the network is clogged for days on end it will probably being to drop out of mempools and never be included).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.