<p>So I'm running the btcd node and wallet in simnet. I've generated more than 100 blocks. I've a few accounts on the same wallet. The list of the accounts:</p>

<pre><code>$ btcctl --rpcuser=foo --rpcpass=123456 --simnet --wallet listaccounts
{
  "account1": 13.7,
  "account2": 0,
  "default": 5601,
  "imported": 0
}
</code></pre>

<p>The <code>default</code> receives the reward for the generated block. Obviously I've moved some bitcoins already from the <code>default</code> to <code>account1</code>. Now I want to move 1 bitcoin from <code>default</code> to <code>account2</code></p>

<pre><code>$ btcctl --rpcuser=foo --rpcpass=123456 --wallet --simnet sendtoaddress "SSBjQ58PsRmBtGZQ8ckXFRxijZFCBdeMMT" 1
e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61
</code></pre>

<p>I mine the block:</p>

<pre><code>$ btcctl --simnet --wallet --rpcuser=foo --rpcpass=123456 generate 1
[
  "6cd2423869ee9b865df759e6c60978b3899bfcf3d4f7174a4287971822bef5e5"
]
</code></pre>

<p>When I check the accounts I see this:</p>

<pre><code>$ btcctl --rpcuser=foo --rpcpass=123456 --simnet --wallet listaccounts
{
  "account1": 13.7,
  "account2": 1,
  "default": 5601,
  "imported": 0
}
</code></pre>

<p>Inspecting the transaction:</p>

<pre><code>$ btcctl --simnet --wallet --rpcuser=foo --rpcpass=123456 gettransaction e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61
{
  "amount": 1,
  "fee": 0.00000224,
  "confirmations": 402,
  "blockhash": "6cd2423869ee9b865df759e6c60978b3899bfcf3d4f7174a4287971822bef5e5",
  "blockindex": 0,
  "blocktime": 1591446501,
  "txid": "e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61",
  "walletconflicts": [],
  "time": 1591446501,
  "timereceived": 1591446501,
  "details": [
    {
      "account": "",
      "amount": -50,
      "category": "send",
      "fee": 0.00000224,
      "vout": 0
    },
    {
      "account": "account2",
      "address": "SSBjQ58PsRmBtGZQ8ckXFRxijZFCBdeMMT",
      "amount": 1,
      "category": "receive",
      "vout": 0
    }
  ],
  "hex": "0100000001129d6eb50f40f48e869413dbade07f055204b221322788ef90c1ca187e8cd09f000000006a473044022028a04f05d8a381210b7e89493d1946d25f8c211d3973a1164d3a0a5f4fee958202206709c6171fba242060fc9dbf1a4bb3ad14b18a45741282f1d55ed764bffed8480121035354d2edb51d3f05f8c0e31f7ab5ba7f97ff179b5e09005ec018c445c0d761d3ffffffff0200e1f505000000001976a91435a915238472497b40660cf625dee8c7ce3f3ae388ac2010102401000000160014708d04eb727ec0a8fdb7b362233ff8684056d21800000000"
}
</code></pre>

<p>After that I've generated many other blocks. My question is: why the transaction contains a "send" category of 50 bitcoins and another category "receive" for 1 bitcoin? Shouldn't be only 1 entry for 1 bitcoin? Why does the balance of the <code>default</code> account is still the same? It should be with 49 more since I've mined the block, got the reward and sent 1.</p>

CC BY-SA 4.0
2020-06-06T17:59:54.020Z
related: [How does change work in a bitcoin transaction?](https://bitcoin.stackexchange.com/q/736/5406)
Murch
CC BY-SA 4.0
2020-06-06T18:29:17.933Z
@Murch thanks. So according to the answers there I have to get the "change" of those 50 back. Either to the same address or to a new one, but that doesn't happen. Any idea?
Ivaylo Ivanov
CC BY-SA 4.0
2020-06-06T20:14:07.143Z
@IvayloIvanov you don't need to 'get the change back', it will just have been sent to a different address you wallet controls. No extra steps needed on your end.
chytrik
CC BY-SA 4.0
2020-06-06T20:14:55.607Z
Does this answer your question? [UTXO model vs. account/balance model](https://bitcoin.stackexchange.com/questions/49853/utxo-model-vs-account-balance-model)
chytrik
CC BY-SA 4.0
2020-06-07T06:02:59.130Z
@chytrik I got that I "should" get the change in a new address. The problem is that I do not see that new address and the balance is not reflected, according to the output as you can see above. The balance of the "default" account is missing 49 bitcoins. What command should I write to see that new address and the balance for it? The way I see it, that new address has to be added to the "default" account and the balance for that account has to be reflected.
Ivaylo Ivanov
CC BY-SA 4.0
2020-06-07T06:14:04.447Z
Digging further, If I do "getaddressesbyaccount" I do see the new address in the "default" account. If I do "getbalance" I do see the correct balance (including those 49 missing). I still do not understand why "listaccounts" does not show them tho.
Ivaylo Ivanov
<transactions><wallet><balance><btcd>
Understanding how balances work
Ivaylo Ivanov
# Understanding how balances work

(Asked by: username_0 on 2020-06-06)

So I'm running the btcd node and wallet in simnet. I've generated more than 100 blocks. I've a few accounts on the same wallet. The list of the accounts:

```
$ btcctl --rpcuser=foo --rpcpass=123456 --simnet --wallet listaccounts
{
  "account1": 13.7,
  "account2": 0,
  "default": 5601,
  "imported": 0
}

```

The `default` receives the reward for the generated block. Obviously I've moved some bitcoins already from the `default` to `account1`. Now I want to move 1 bitcoin from `default` to `account2`

```
$ btcctl --rpcuser=foo --rpcpass=123456 --wallet --simnet sendtoaddress "SSBjQ58PsRmBtGZQ8ckXFRxijZFCBdeMMT" 1
e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61

```

I mine the block:

```
$ btcctl --simnet --wallet --rpcuser=foo --rpcpass=123456 generate 1
[
  "6cd2423869ee9b865df759e6c60978b3899bfcf3d4f7174a4287971822bef5e5"
]

```

When I check the accounts I see this:

```
$ btcctl --rpcuser=foo --rpcpass=123456 --simnet --wallet listaccounts
{
  "account1": 13.7,
  "account2": 1,
  "default": 5601,
  "imported": 0
}

```

Inspecting the transaction:

```
$ btcctl --simnet --wallet --rpcuser=foo --rpcpass=123456 gettransaction e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61
{
  "amount": 1,
  "fee": 0.00000224,
  "confirmations": 402,
  "blockhash": "6cd2423869ee9b865df759e6c60978b3899bfcf3d4f7174a4287971822bef5e5",
  "blockindex": 0,
  "blocktime": 1591446501,
  "txid": "e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61",
  "walletconflicts": [],
  "time": 1591446501,
  "timereceived": 1591446501,
  "details": [
    {
      "account": "",
      "amount": -50,
      "category": "send",
      "fee": 0.00000224,
      "vout": 0
    },
    {
      "account": "account2",
      "address": "SSBjQ58PsRmBtGZQ8ckXFRxijZFCBdeMMT",
      "amount": 1,
      "category": "receive",
      "vout": 0
    }
  ],
  "hex": "0100000001129d6eb50f40f48e869413dbade07f055204b221322788ef90c1ca187e8cd09f000000006a473044022028a04f05d8a381210b7e89493d1946d25f8c211d3973a1164d3a0a5f4fee958202206709c6171fba242060fc9dbf1a4bb3ad14b18a45741282f1d55ed764bffed8480121035354d2edb51d3f05f8c0e31f7ab5ba7f97ff179b5e09005ec018c445c0d761d3ffffffff0200e1f505000000001976a91435a915238472497b40660cf625dee8c7ce3f3ae388ac2010102401000000160014708d04eb727ec0a8fdb7b362233ff8684056d21800000000"
}

```

After that I've generated many other blocks. My question is: why the transaction contains a "send" category of 50 bitcoins and another category "receive" for 1 bitcoin? Shouldn't be only 1 entry for 1 bitcoin? Why does the balance of the `default` account is still the same? It should be with 49 more since I've mined the block, got the reward and sent 1.

**Tags:** transactions, wallet, balance, btcd

> **Comments:**
> **username_1**: related: [How does change work in a bitcoin transaction?](https://bitcoin.stackexchange.com/q/736/5406)  
> **username_0**: @username_1 thanks. So according to the answers there I have to get the "change" of those 50 back. Either to the same address or to a new one, but that doesn't happen. Any idea?  
> **username_2**: @username_0 you don't need to 'get the change back', it will just have been sent to a different address you wallet controls. No extra steps needed on your end.  
> **username_2**: Does this answer your question? [UTXO model vs. account/balance model](https://bitcoin.stackexchange.com/questions/49853/utxo-model-vs-account-balance-model)  
> **username_0**: @username_2 I got that I "should" get the change in a new address. The problem is that I do not see that new address and the balance is not reflected, according to the output as you can see above. The balance of the "default" account is missing 49 bitcoins. What command should I write to see that new address and the balance for it? The way I see it, that new address has to be added to the "default" account and the balance for that account has to be reflected.  
> **username_0**: Digging further, If I do "getaddressesbyaccount" I do see the new address in the "default" account. If I do "getbalance" I do see the correct balance (including those 49 missing). I still do not understand why "listaccounts" does not show them tho.  

---

## 0 answers

