<p>While the transaction is stored in Bitcoin Core with the outputs in a vector where the <code>vout</code> index matches the position in the vector, and when we write the RPC response we just write in the order of that vector, I am not sure that there is any guarantee that this would always remain a complete list.</p>
<p>However, the details of the output in the return value do explicitly include the index on the <code>vout</code> field in the response, so you could just use that if you want to be extra sure.</p>

CC BY-SA 4.0
2023-03-22T16:28:31.760Z
Thanks, in the meantime i found examples where the list was not complete which makes sense as some outputs might not belong to the wallet.
k9ert
CC BY-SA 4.0
2023-03-16T17:14:06.583Z
2023-03-16T17:24:32.983Z
2023-03-16T17:24:32.983Z
Murch
<p>According to <a href="https://developer.bitcoin.org/reference/rpc/gettransaction.html" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/rpc/gettransaction.html</a> the details array contains a list of the outputs of that transaction. Each output has a vout. So in my tests, it seems that the order seem to be the same than the vouts so that the index of the array is equal with the vout.</p>
<p>But is that guaranteed?</p>

<bitcoin-core><api><gettransaction>
order of the details array in the output of the gettransaction wallet API call
k9ert
# order of the details array in the output of the gettransaction wallet API call

(Asked by: username_0 on 2023-03-16)

According to <https://developer.bitcoin.org/reference/rpc/gettransaction.html> the details array contains a list of the outputs of that transaction. Each output has a vout. So in my tests, it seems that the order seem to be the same than the vouts so that the index of the array is equal with the vout.

But is that guaranteed?

**Tags:** bitcoin-core, api, gettransaction


---

## 1 answers

### Answer by username_1 on 2023-03-16. Score: 2 | Accepted answer

While the transaction is stored in Bitcoin Core with the outputs in a vector where the `vout` index matches the position in the vector, and when we write the RPC response we just write in the order of that vector, I am not sure that there is any guarantee that this would always remain a complete list.

However, the details of the output in the return value do explicitly include the index on the `vout` field in the response, so you could just use that if you want to be extra sure.

> **Comments:**
> **username_0**: Thanks, in the meantime i found examples where the list was not complete which makes sense as some outputs might not belong to the wallet.  

---

