As the title my question is how they earn bitcoin by mining?
Is it only from the block rewards or they also get btc for the validation of transactions?
Miners earn Bitcoin mainly through two sources:
1.
Block Rewards: This is the primary incentive. When a miner successfully adds a new block to the blockchain, they receive a fixed number of newly created bitcoins. This reward halves roughly every four years (halving event). As of now, the block reward is [insert current reward, e.g., 3.125 BTC if it’s post-2024 halving].
2.
Transaction Fees: In addition to the block reward, miners also collect all the transaction fees from the transactions included in the block. These fees are paid by users who want their transactions confirmed faster.
So yes,
miners earn both from the block reward and the transaction fees. Over time, as the block reward continues to decrease due to halvings, transaction fees are expected to become a more significant part of miner income.
Hope that clears it up!