<blockquote>
  <p><strong>Shouldn't there only be 3 objects nested under "details" (i.e. 1 input and 2 outputs)?</strong></p>
</blockquote>

<p>In the <a href="https://www.blockchain.com/btc/tx/ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346" rel="nofollow noreferrer">actual Bitcoin blockchain</a> that transaction has one input and two outputs. One of the outputs appears to be change being returned to the input address. This is normal.</p>

<p>In an early version of the book, the same information (1 in, 2 out) is shown and the author says on page 52:</p>

<blockquote>
  <p>That looks correct! Our new transaction “consumes” the unspent output from our confirmed transaction and then spends it in two outputs, one for 25 millibits to our new address and one for 24.5 millibits as change back to the original address.</p>
</blockquote>

<p>The output you show is from page 55 and looks like an editing error to me. If the author has not issued an errata, you could report this to the author or to the publisher.</p>

<hr>

<p>The example in the question is from Chapter 3 of Mastering Bitcoin. It exists in the <a href="https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch03.html" rel="nofollow noreferrer">previous edition</a> but that chapter has been completely revised in chapter 3 of  <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch03.asciidoc" rel="nofollow noreferrer">the latest edition</a></p>

CC BY-SA 4.0
2018-10-13T16:59:09.687Z
I had someone else look at it as well and he told me it might be how bitcoin handles the transaction on the accounting side? I'll have to look into this some more
Huy
CC BY-SA 4.0
2018-10-13T09:54:51.617Z
2018-10-16T11:15:39.313Z
2018-10-16T11:15:39.313Z
RedGrittyBrick
<p>I'm working my way through Mastering Bitcoin. The author made a transaction to send 0.05 BTC from one address to another (<a href="http://chainquery.com/bitcoin-api/getrawtransaction/ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346/1" rel="nofollow noreferrer">http://chainquery.com/bitcoin-api/getrawtransaction/ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346/1</a>)</p>

<p>In the book, he runs the following command to get the transaction details:</p>

<p><code>bitcoin-cli gettransaction ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346</code></p>

<p>The JSONRPC returns the following object:</p>

<pre><code>{  
   "details":[  
      {  
         "account":"",
         "address":"1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb",
         "category":"send",
         "amount":-0.02500000,
         "fee":-0.00050000
      },
      {  
         "account":"",
         "address":"1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL",
         "category":"send",
         "amount":-0.02450000,
         "fee":-0.00050000
      },
      {  
         "account":"",
         "address":"1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb",
         "category":"receive",
         "amount":0.02500000
      },
      {  
         "account":"",
         "address":"1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL",
         "category":"receive",
         "amount":0.02450000
      }
   ]
}
</code></pre>

<p><strong>Why is there an object with the receiving address (1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL) with the category "send"?</strong> </p>

<p><strong>Shouldn't there only be 3 objects nested under "details" (i.e. 1 input and 2 outputs)?</strong></p>

<sendrawtransaction><mastering-bitcoin>
(Mastering Bitcoin) When sending a raw transaction, why is the receiver included in the details hash as a "send" transaction?
Huy
# (Mastering Bitcoin) When sending a raw transaction, why is the receiver included in the details hash as a "send" transaction?

(Asked by: username_0 on 2018-10-13)

I'm working my way through Mastering Bitcoin. The author made a transaction to send 0.05 BTC from one address to another (<http://chainquery.com/bitcoin-api/getrawtransaction/ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346/1>)

In the book, he runs the following command to get the transaction details:

`bitcoin-cli gettransaction ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346`

The JSONRPC returns the following object:

```
{  
   "details":[  
      {  
         "account":"",
         "address":"1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb",
         "category":"send",
         "amount":-0.02500000,
         "fee":-0.00050000
      },
      {  
         "account":"",
         "address":"1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL",
         "category":"send",
         "amount":-0.02450000,
         "fee":-0.00050000
      },
      {  
         "account":"",
         "address":"1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb",
         "category":"receive",
         "amount":0.02500000
      },
      {  
         "account":"",
         "address":"1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL",
         "category":"receive",
         "amount":0.02450000
      }
   ]
}

```

**Why is there an object with the receiving address (1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL) with the category "send"?**

**Shouldn't there only be 3 objects nested under "details" (i.e. 1 input and 2 outputs)?**

**Tags:** sendrawtransaction, mastering-bitcoin


---

## 1 answers

### Answer by username_1 on 2018-10-13. Score: 0 | Accepted answer

> **Shouldn't there only be 3 objects nested under "details" (i.e. 1 input and 2 outputs)?**

In the [actual Bitcoin blockchain](https://www.blockchain.com/btc/tx/ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346) that transaction has one input and two outputs. One of the outputs appears to be change being returned to the input address. This is normal.

In an early version of the book, the same information (1 in, 2 out) is shown and the author says on page 52:

> That looks correct! Our new transaction “consumes” the unspent output from our confirmed transaction and then spends it in two outputs, one for 25 millibits to our new address and one for 24.5 millibits as change back to the original address.

The output you show is from page 55 and looks like an editing error to me. If the author has not issued an errata, you could report this to the author or to the publisher.

---

The example in the question is from Chapter 3 of Mastering Bitcoin. It exists in the [previous edition](https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch03.html) but that chapter has been completely revised in chapter 3 of [the latest edition](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch03.asciidoc)

> **Comments:**
> **username_0**: I had someone else look at it as well and he told me it might be how bitcoin handles the transaction on the accounting side? I'll have to look into this some more  

---

