Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: victorkimba17 on August 28, 2018, 03:31:54 AM



Title: bitcoin transaction confirmation and mining
Post by: victorkimba17 on August 28, 2018, 03:31:54 AM
one technical question:

when i send out a bitcoin to the recipient, the transaction is included in a block. The transaction is confirmed by miner.

Is the block fully utilized, as in is its capacity fully used ? For other transaction, is it included in the same block if the block is not full ?

how does miner check which block is the latest, if the same block is being mined to confirm new transactions ?



Title: Re: bitcoin transaction confirmation and mining
Post by: ranochigo on August 28, 2018, 03:43:07 AM
Is the block fully utilized, as in is its capacity fully used ?
Depends on the miner. They can choose to include every transaction that they see or not. The block doesn't necessarily have to be full at all.
For other transaction, is it included in the same block if the block is not full ?
The miner will decide which transaction they wish to include before they even start to mine and solve the block. When they get the block that corresponds to the target, they cannot change any variable in the block or the whole hash will be changed.
how does miner check which block is the latest, if the same block is being mined to confirm new transactions ?
Blocks are propagated across the network and the miner runs a node. When they detect a node that is mined at the current height, they will discard the current block header (containing merkle root, last block hash, block height) and adjust it such that the block height, block hash corresponds to the correct one and the transactions aren't included twice.

The miner builds the chain on top of the last block.


Title: Re: bitcoin transaction confirmation and mining
Post by: victorkimba17 on August 28, 2018, 03:45:55 AM
The miner will decide which transaction they wish to include before they even start to mine and solve the block. When they get the block that corresponds to the target, they cannot change any variable in the block or the whole hash will be changed.

Does it mean once the block is mined with transactions, the same block cannot be mined to add new transactions to it ?

Thanks.


Title: Re: bitcoin transaction confirmation and mining
Post by: ranochigo on August 28, 2018, 03:51:31 AM
Does it mean once the block is mined with transactions, the same block cannot be mined to add new transactions to it ?

Thanks.
Nope. The set of transaction is hashed and included as merkle root. The merkle root is included in the block header which is hashed again. If you add transactions, the merkle root will be changed and the whole block header will be changed. You can do it, but the block won't meet the target anymore and nodes won't accept it.


Title: Re: bitcoin transaction confirmation and mining
Post by: victorkimba17 on August 28, 2018, 04:59:26 AM

Nope. The set of transaction is hashed and included as merkle root. The merkle root is included in the block header which is hashed again. If you add transactions, the merkle root will be changed and the whole block header will be changed. You can do it, but the block won't meet the target anymore and nodes won't accept it.

very clear reply. Thanks a lot.