<p>The information you get for a <code>getblock</code> call doesn't seem to include the block reward. You could find it with a <code>gettransaction</code> call for the first transaction, but bitcoind only allows lookup for transactions in your own wallet, so that won't work either.</p>

<p>So indeed, as Diego points out, the only option is to look at the block height. <a href="https://en.bitcoin.it/wiki/Controlled_supply#Projected_Bitcoins_Long_Term" rel="nofollow">This wiki page</a> lists the different reward values for the different block height intervals.</p>

CC BY-SA 3.0
2014-03-08T00:29:27.327Z
That should be fine for my need.  I only need to know the reward value for blocks I find.  So it's safe to assume that the first transaction will always be the block reward?
Tuaris
CC BY-SA 3.0
2014-03-08T02:09:42.683Z
The first transaction is the [coinbase](https://en.bitcoin.it/wiki/Transactions#Generation) transaction and the output of this transaction contains the block reward + the combined transaction fees of the other transactions.
Steven Roose
CC BY-SA 3.0
2014-02-20T00:07:51.187Z
2014-02-20T00:07:51.187Z
Steven Roose
<p>All you need is the block number. The reward started at 50 and it halves every 210k blocks. Currently it's at 25, and as I write this the current block number is 286459. For other altcoins, you need to know the schedule.</p>

CC BY-SA 4.0
2019-07-24T13:43:06.087Z
so we can calculate block with your said matematic formula? we can use this table right?: https://en.bitcoin.it/wiki/Controlled_supply#Projected_Bitcoins_Long_Term
kodmanyagha
CC BY-SA 3.0
2014-02-18T06:43:26.970Z
2014-02-18T06:43:26.970Z
Diego Basch
<p>a bit old but maybe useful for people doing e2e tests in regtest</p>
<pre><code>// from bitcoin-core implementation
// return in satoshis
function getBlockReward(height, halvingBlocks = 150) {
    const halvings = BigInt(height) / BigInt(halvingBlocks);
    if (halvings &gt;= 64)
        return 0;

    let reward = BigInt(50 * 100000000);
    reward &gt;&gt;= halvings;
    return Number(reward);
}

</code></pre>
<p>and use it with bitcoin rpc client and <a href="https://developer.bitcoin.org/reference/rpc/getblockcount.html" rel="nofollow noreferrer">getblockcount</a>. Ex:</p>
<pre><code>const blockNumber = await bitcoindClient.getBlockCount();
console.log(getBlockReward(blockNumber));
</code></pre>
<p>Pease notice that if you will use other network you must pass <code>halvingBlocks</code> params or change default value.</p>

CC BY-SA 4.0
2021-07-08T23:45:31.433Z
2021-07-14T19:30:41.200Z
2021-07-14T19:30:41.200Z
dolcalmi
<p>Using the bitcoin client's JSON API (or any other altcoin client) how do I find out the reward given for finding that block?</p>

<json-rpc>
How do I find out the reward value of a generated block
Tuaris
# How do I find out the reward value of a generated block

(Asked by: username_0 on 2014-02-18)

Using the bitcoin client's JSON API (or any other altcoin client) how do I find out the reward given for finding that block?

**Tags:** json-rpc


---

## 3 answers

### Answer by username_1 on 2014-02-20. Score: 2 | Accepted answer

The information you get for a `getblock` call doesn't seem to include the block reward. You could find it with a `gettransaction` call for the first transaction, but bitcoind only allows lookup for transactions in your own wallet, so that won't work either.

So indeed, as username_2 points out, the only option is to look at the block height. [This wiki page](https://en.bitcoin.it/wiki/Controlled_supply#Projected_Bitcoins_Long_Term) lists the different reward values for the different block height intervals.

> **Comments:**
> **username_0**: That should be fine for my need.  I only need to know the reward value for blocks I find.  So it's safe to assume that the first transaction will always be the block reward?  
> **username_1**: The first transaction is the [coinbase](https://en.bitcoin.it/wiki/Transactions#Generation) transaction and the output of this transaction contains the block reward + the combined transaction fees of the other transactions.  

---

### Answer by username_2 on 2014-02-18. Score: 1

All you need is the block number. The reward started at 50 and it halves every 210k blocks. Currently it's at 25, and as I write this the current block number is 286459. For other altcoins, you need to know the schedule.

> **Comments:**
> **username_3**: so we can calculate block with your said matematic formula? we can use this table right?: https://en.bitcoin.it/wiki/Controlled_supply#Projected_Bitcoins_Long_Term  

---

### Answer by username_4 on 2021-07-08. Score: 0

a bit old but maybe useful for people doing e2e tests in regtest

```
// from bitcoin-core implementation
// return in satoshis
function getBlockReward(height, halvingBlocks = 150) {
    const halvings = BigInt(height) / BigInt(halvingBlocks);
    if (halvings >= 64)
        return 0;

    let reward = BigInt(50 * 100000000);
    reward >>= halvings;
    return Number(reward);
}

```

and use it with bitcoin rpc client and [getblockcount](https://developer.bitcoin.org/reference/rpc/getblockcount.html). Ex:

```
const blockNumber = await bitcoindClient.getBlockCount();
console.log(getBlockReward(blockNumber));

```

Pease notice that if you will use other network you must pass `halvingBlocks` params or change default value.


---

