Bitcoin Forum

Bitcoin => Mining => Topic started by: M. C on April 02, 2024, 05:43:41 PM



Title: Coinbase rewards
Post by: M. C on April 02, 2024, 05:43:41 PM
Hello everyone,

I'm curious about how coinbase rewards work. Could someone clarify the mechanism for me?

I understand Proof of Work but I'm not sure about how miners receive their bitcoins. Is it through a transaction? And how did Satoshi preprogram the code ?

Thank you.


Title: Re: Coinbase rewards
Post by: hosseinimr93 on April 02, 2024, 08:08:36 PM
Every time miners (or mining pools) mine a block, they add a coinbase transaction in the block.
The coinbase transaction is always the first transaction of the block and it includes the newly generated coins.

You can easily check all coinbase transactions on block explorers and see how they work.


Title: Re: Coinbase rewards
Post by: BitMaxz on April 02, 2024, 08:12:10 PM
If this is all about coding  and you are planning to cloning Bitcoin or planning to create software to mine Bitcoin I suggest learn first how it works.
Check this link below to understand how it works.

- https://github.com/openblockchains/awesome-blockchains

Don't forget to try it you can start building your own blockchain by following the DIY guide under that link.


Title: Re: Coinbase rewards
Post by: Uhwuchukwu53 on April 03, 2024, 06:51:23 AM
Mining reward of coinbase refers to the transaction whereby miners receive Bitcoin as a reward for generating a new block through mining.
Bitcoin is only issued through mining and, when it is newly issued, it is given to the successful miners as a reward.

The reward is direct transaction obtained by minner as result of creating new block by mining a successfully, you can also read more through this link: https://help.coinbase.com/en-au/coinbase/getting-started/getting-started-with-coinbase/create-a-coinbase-account



Title: Re: Coinbase rewards
Post by: hosseinimr93 on April 03, 2024, 08:23:15 AM
you can also read more through this link: https://help.coinbase.com/en-au/coinbase/getting-started/getting-started-with-coinbase/create-a-coinbase-account
Did you read the article you shared yourself?
The link you shared has nothing to do with coinbase transactions and what we are talking about here in this thread. That's about how to create an account on coinbase website which is an exchange.


Title: Re: Coinbase rewards
Post by: BlackHatCoiner on April 03, 2024, 10:05:24 AM
I'm curious about how coinbase rewards work. Could someone clarify the mechanism for me?
I presume you refer to the coinbase transaction (https://learnmeabitcoin.com/technical/mining/coinbase-transaction/). There is no "coinbase reward". There is the block reward (https://learnmeabitcoin.com/technical/mining/block-reward/), which is consisted of the block subsidy (https://learnmeabitcoin.com/technical/mining/block-reward/#block-subsidy) and the transaction fees.

The coinbase transaction is the transaction in which the miner pays themselves to claim the block reward. This includes the block subsidy (issuance of new money in circulation) and the transaction fees. In the most recent block, 837521 (https://mempool.space/block/000000000000000000014836da5180917736477fb0127adb3bcc9ae66075164c), you can notice that the first transaction is the coinbase, constructed by the miner, paying the miner 6.43321587 BTC.

This means that the miner created 6.25 new bitcoin, sent them to themselves, and claimed a total of 0.18321587 bitcoin from transaction fees.  


Title: Re: Coinbase rewards
Post by: JustineCollins09 on April 07, 2024, 07:32:08 AM
Certainly! Coinbase rewards, also known as block rewards, are the mechanism by which new bitcoins are created and distributed to miners for validating transactions and securing the blockchain. Here's how it works:

Mining Process: Miners use powerful computers to solve complex mathematical problems that confirm and add transactions to the blockchain, a decentralized ledger of all transactions in the Bitcoin network.

Validating Transactions: When a miner successfully solves a block, they compile a list of transactions and create a new block. This block includes a special transaction called the "coinbase transaction" which contains the newly generated bitcoins as well as any transaction fees collected from the included transactions.

Creating New Bitcoins: The coinbase transaction is the first transaction in each block, and it's how new bitcoins are introduced into circulation. These newly created bitcoins are the miner's reward for successfully mining the block.

Halving: The number of bitcoins generated per block is halved approximately every four years, in an event called the "halving." This reduction is programmed into the Bitcoin protocol and is designed to control inflation and limit the total supply of bitcoins to 21 million.

Satoshi's Preprogramming: When Satoshi Nakamoto created Bitcoin, they preprogrammed the software to include the rules for generating new bitcoins. This includes the initial block reward of 50 bitcoins per block, which was halved to 25 bitcoins in November 2012, then halved again to 12.5 bitcoins in July 2016, and so on.

So, in summary, miners receive their bitcoins as a reward for successfully mining a new block, and this reward is embedded in the coinbase transaction within that block. Satoshi Nakamoto designed the protocol to gradually release new bitcoins into circulation while also controlling the rate of issuance through the halving mechanism.







Title: Re: Coinbase rewards
Post by: punk.zink on April 14, 2024, 08:15:31 AM
https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp#L1752
Code:
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

https://github.com/bitcoin/bitcoin/blob/master/src/consensus/amount.h#L14
Code:
/** The amount of satoshis in one BTC. */
static constexpr CAmount COIN = 100000000;


Title: Re: Coinbase rewards
Post by: ABCbits on April 30, 2024, 09:26:22 AM
Certainly! Coinbase rewards, also known as block rewards, are the mechanism by which new bitcoins are created and distributed to miners for validating transactions and securing the blockchain. Here's how it works:

Mining Process: Miners use powerful computers to solve complex mathematical problems that confirm and add transactions to the blockchain, a decentralized ledger of all transactions in the Bitcoin network.

Validating Transactions: When a miner successfully solves a block, they compile a list of transactions and create a new block. This block includes a special transaction called the "coinbase transaction" which contains the newly generated bitcoins as well as any transaction fees collected from the included transactions.

Creating New Bitcoins: The coinbase transaction is the first transaction in each block, and it's how new bitcoins are introduced into circulation. These newly created bitcoins are the miner's reward for successfully mining the block.

Halving: The number of bitcoins generated per block is halved approximately every four years, in an event called the "halving." This reduction is programmed into the Bitcoin protocol and is designed to control inflation and limit the total supply of bitcoins to 21 million.

Satoshi's Preprogramming: When Satoshi Nakamoto created Bitcoin, they preprogrammed the software to include the rules for generating new bitcoins. This includes the initial block reward of 50 bitcoins per block, which was halved to 25 bitcoins in November 2012, then halved again to 12.5 bitcoins in July 2016, and so on.

So, in summary, miners receive their bitcoins as a reward for successfully mining a new block, and this reward is embedded in the coinbase transaction within that block. Satoshi Nakamoto designed the protocol to gradually release new bitcoins into circulation while also controlling the rate of issuance through the halving mechanism.

Did you use ChatGPT? Your statement contain some wrong information.
1. Statement "Miners use powerful computers..." isn't accurate since miner actually specialized hardware (a.k.a. ASIC). Computer in general have far lower efficiency compared with ASIC.
2. Statement "When a miner successfully solves a block, they compile a list of transactions and create a new block." doesn't make sense. Miner supposed to collect unconfirmed transaction (usually based on highest fee rate), then create block using those unconfirmed transaction first.
3. Coinbase rewards also let miner claim transaction fee included on block they mine.