<p>Coinbase transaction outputs from blocks that have not been buried by 100 blocks cannot be spent. Such outputs are listed in the wallet as &quot;immature&quot;, and shown as having 0 value.</p>
<p>Generate 100 blocks on top, and they will mature, and show up as spendable balance.</p>
<p>In addition, on regtest, the subsidy halving interval is 150 blocks, so after ~5000 blocks, the subsidy for new blocks will be 0. If the mined transactions have no fees, the coinbase outputs will have 0 value.</p>

CC BY-SA 4.0
2023-02-06T15:55:42.303Z
2023-02-06T19:29:39.040Z
2023-02-06T19:29:39.040Z
Pieter Wuille
<p>I'm using regtest mode for testing new features. During my tests I encountered weird problem- <code>listunspent</code> RPC return a long list of transactions with amount 0. When I'm calling <code>getwalletinfo</code> RPC I can see positive balance at the wallet.</p>
<pre><code>  {
    &quot;txid&quot;: &quot;5f38f1c2309f352b57fd9090e24526f86cf33de6203206413bd9e2d0e19cae01&quot;,
    &quot;vout&quot;: 0,
    &quot;address&quot;: &quot;&lt;some_address&gt;&quot;,
    &quot;label&quot;: &quot;&quot;,
    &quot;scriptPubKey&quot;: &quot;&lt;scriptpubkey&gt;&quot;,
    &quot;amount&quot;: 0.00000000,
    &quot;confirmations&quot;: 1158,
    ...
    &quot;spendable&quot;: true,
    &quot;solvable&quot;: true,
    &quot;safe&quot;: true
    ...
  }
</code></pre>
<p>Wallet output</p>
<pre><code>{
  ...
  &quot;balance&quot;: 5099.72700000,
  &quot;unconfirmed_balance&quot;: 0.00000000,
  &quot;immature_balance&quot;: 0.00000000,
  &quot;txcount&quot;: 14957,
   ...
}

</code></pre>
<p>Steps to reproduce the issue:</p>
<ol>
<li>Get new address using <code>getnewaddress</code></li>
<li>Generate 1 block to address from step 1 using `generatetoaddress 1 &lt;address_from_step#1&gt;</li>
<li>Get block details by <code>getblock</code></li>
<li>Decode the block transaction by using <code>gettransaction</code></li>
</ol>
<p>Output:</p>
<pre><code>{
  &quot;amount&quot;: 0.00000000,
  &quot;confirmations&quot;: 1,
  &quot;generated&quot;: true,
...
  &quot;walletconflicts&quot;: [
  ],
...
  &quot;details&quot;: [
    {
...
      &quot;address&quot;: &quot;&lt;address&gt;&quot;,
      &quot;category&quot;: &quot;immature&quot;,
      &quot;amount&quot;: 0.00000000,
...
      &quot;vout&quot;: 0
    }
  ],
...
</code></pre>

CC BY-SA 4.0
2023-02-05T17:42:07.347Z
Sounds to me like you actually have a bunch of 0-value outputs to your address(es)?
Pieter Wuille
CC BY-SA 4.0
2023-02-06T09:17:08.957Z
@PieterWuille exactly. how this sitation can occured? My wallet didn't erased.
liorko
CC BY-SA 4.0
2023-02-06T13:54:36.360Z
There is no way for me to know what you did with your wallet. If you want help from people to figure it out, you may want to share the exact steps you took (which RPCs and arguments, or code that issues them).
Pieter Wuille
CC BY-SA 4.0
2023-02-06T15:51:56.160Z
@PieterWuille I added steps to reproduce the issue.
liorko
<wallet><regtest><listunspent>
bitcoin regtest listunspent generated with zero amount
liorko
# bitcoin regtest listunspent generated with zero amount

(Asked by: username_0 on 2023-02-05)

I'm using regtest mode for testing new features. During my tests I encountered weird problem- `listunspent` RPC return a long list of transactions with amount 0. When I'm calling `getwalletinfo` RPC I can see positive balance at the wallet.

```
  {
    "txid": "5f38f1c2309f352b57fd9090e24526f86cf33de6203206413bd9e2d0e19cae01",
    "vout": 0,
    "address": "<some_address>",
    "label": "",
    "scriptPubKey": "<scriptpubkey>",
    "amount": 0.00000000,
    "confirmations": 1158,
    ...
    "spendable": true,
    "solvable": true,
    "safe": true
    ...
  }

```

Wallet output

```
{
  ...
  "balance": 5099.72700000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 14957,
   ...
}

```

Steps to reproduce the issue:

1. Get new address using `getnewaddress`
2. Generate 1 block to address from step 1 using `generatetoaddress 1 <address\_from\_step#1>
3. Get block details by `getblock`
4. Decode the block transaction by using `gettransaction`

Output:

```
{
  "amount": 0.00000000,
  "confirmations": 1,
  "generated": true,
...
  "walletconflicts": [
  ],
...
  "details": [
    {
...
      "address": "<address>",
      "category": "immature",
      "amount": 0.00000000,
...
      "vout": 0
    }
  ],
...

```

**Tags:** wallet, regtest, listunspent

> **Comments:**
> **username_1**: Sounds to me like you actually have a bunch of 0-value outputs to your address(es)?  
> **username_0**: @username_1 exactly. how this sitation can occured? My wallet didn't erased.  
> **username_1**: There is no way for me to know what you did with your wallet. If you want help from people to figure it out, you may want to share the exact steps you took (which RPCs and arguments, or code that issues them).  
> **username_0**: @username_1 I added steps to reproduce the issue.  

---

## 1 answers

### Answer by username_1 on 2023-02-06. Score: 4 | Accepted answer

Coinbase transaction outputs from blocks that have not been buried by 100 blocks cannot be spent. Such outputs are listed in the wallet as "immature", and shown as having 0 value.

Generate 100 blocks on top, and they will mature, and show up as spendable balance.

In addition, on regtest, the subsidy halving interval is 150 blocks, so after ~5000 blocks, the subsidy for new blocks will be 0. If the mined transactions have no fees, the coinbase outputs will have 0 value.


---

