<p>In a sense, such a command <em>would</em> be trusting a third party: any putative answer would be that given by whoever supplied that code to you; and it may not be trustworthy - it could <em>tell</em> you it was 21 million, but behind the scenes <em>actually</em> use, say, 42 million.  </p>

<p>The nearest you could do would be to download the source code from a <a href="https://bitcoincore.org/en/download/" rel="nofollow noreferrer">proper source</a> and, having verified your download, check the file <code>src/amount.h</code> for the line <code>static const CAmount MAX_MONEY = 21000000 * COIN;</code> before building the software yourself. You are now more sure that your node has the proper max supply. </p>

CC BY-SA 4.0
2020-01-03T01:03:15.833Z
Hey thanks for the reply, what you say indeed makes tons of sense having that kind answer would imply me trusting someone else.
Lebowski
CC BY-SA 4.0
2020-01-03T12:23:49.913Z
That MAX_MONEY constant is actually immaterial when it comes to inflation schedule, it's just a sanity check. The actual subsidy rule is implemented in the `GetBlockSubsidy` function in Bitcoin Core's src/validation.cpp.
Pieter Wuille
CC BY-SA 4.0
2020-01-03T00:20:53.193Z
2020-01-03T00:20:53.193Z
Alistair Mann
<p>I would like to know if there a way('command') to know what is the max supply of bitcoin using my own node without trusting a third party. </p>

<p>Also if anyone could explain to me why :</p>

<blockquote>
  <p>bitcoin-cli gettxoutsetinfo</p>
</blockquote>

<p>returns this message when written: </p>

<pre><code>*error: Could not connect to the server 127.0.0.1:8332 (error code 0 - "timeout reached")
    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.*
</code></pre>

<p>Is that bcuz I'm running behind tor? Would be great if some of you guys can expand on these 2 doubts.</p>

CC BY-SA 4.0
2020-01-02T16:43:11.710Z
There is no such command.
Pieter Wuille
CC BY-SA 4.0
2020-01-02T21:52:47.997Z
Does this answer your question? [Will there be 21 million bitcoins eventually?](https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually)
Septem151
CC BY-SA 4.0
2020-01-03T01:10:45.770Z
Hey @Septem151 , I read all the answers regarding those questions and unfortunately that was not exactly what I was looking for. I could have sworn i once saw someone posting some sort of 'command' in Twitter with the max supply but maybe I'm wrong. Nonetheless, as someone stated here having that kind of command would be trusting a 3rd party.
Lebowski
<bitcoin-core><bitcoind><bitcoin-core-development>
Is there a 'command' to get the max supply of bitcoin that will ever exist using the bitcoin-cli?
Lebowski
# Is there a 'command' to get the max supply of bitcoin that will ever exist using the bitcoin-cli?

(Asked by: username_0 on 2020-01-02)

I would like to know if there a way('command') to know what is the max supply of bitcoin using my own node without trusting a third party.

Also if anyone could explain to me why :

> bitcoin-cli gettxoutsetinfo

returns this message when written:

```
*error: Could not connect to the server 127.0.0.1:8332 (error code 0 - "timeout reached")
    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.*

```

Is that bcuz I'm running behind tor? Would be great if some of you guys can expand on these 2 doubts.

**Tags:** bitcoin-core, bitcoind, bitcoin-core-development

> **Comments:**
> **username_1**: There is no such command.  
> **username_2**: Does this answer your question? [Will there be 21 million bitcoins eventually?](https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually)  
> **username_0**: Hey @username_2 , I read all the answers regarding those questions and unfortunately that was not exactly what I was looking for. I could have sworn i once saw someone posting some sort of 'command' in Twitter with the max supply but maybe I'm wrong. Nonetheless, as someone stated here having that kind of command would be trusting a 3rd party.  

---

## 1 answers

### Answer by username_3 on 2020-01-03. Score: 3

In a sense, such a command *would* be trusting a third party: any putative answer would be that given by whoever supplied that code to you; and it may not be trustworthy - it could *tell* you it was 21 million, but behind the scenes *actually* use, say, 42 million.

The nearest you could do would be to download the source code from a [proper source](https://bitcoincore.org/en/download/) and, having verified your download, check the file `src/amount.h` for the line `static const CAmount MAX_MONEY = 21000000 * COIN;` before building the software yourself. You are now more sure that your node has the proper max supply.

> **Comments:**
> **username_0**: Hey thanks for the reply, what you say indeed makes tons of sense having that kind answer would imply me trusting someone else.  
> **username_1**: That MAX_MONEY constant is actually immaterial when it comes to inflation schedule, it's just a sanity check. The actual subsidy rule is implemented in the `GetBlockSubsidy` function in Bitcoin Core's src/validation.cpp.  

---

