<p>The output returned by bitcoin-cli listunspent is correct. As mentioned in document, outpoint is pair of <code>(txid, vout)</code></p>

<p>txid is <code>4bbf676731987cce1e4639ec28d1219f065ab2aa5e9deb323c0b56bd0482d499</code>. Its is hexadecimal representation of a binary string and will take 32 bytes, each hex digit is representing 4 bits (or half a byte)</p>

<p>vout is 0 , this is stored as uint32 in the bitcoin block and will take 4 bytes. In other words it stored as an <a href="http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/unsigned.html" rel="nofollow noreferrer">unsigned int</a> binary representation of 32 bits.</p>

CC BY-SA 3.0
2017-01-20T09:17:30.840Z
2017-01-20T09:17:30.840Z
dark knight
<p>I'm trying to get the outpoint for a transaction but I don't find how to.</p>

<p>The pages <a href="https://en.bitcoin.it/wiki/Protocol_documentation" rel="nofollow noreferrer">here</a> and <a href="https://bitcoin.org/en/glossary/outpoint" rel="nofollow noreferrer">here</a> look like saying that the outpoint must have 36 characters, of what 32 are the TXID and 4 are the vout.</p>

<p>However I can't find any example or further information about how to get/calculate it. I'm trying with <code>bitcoin-cli listunspent</code> and it gave me:</p>

<pre><code>[
    {
        "txid" : "4bbf676731987cce1e4639ec28d1219f065ab2aa5e9deb323c0b56bd0482d499",
        "vout" : 0,
        "address" : "1CfdQ5eHhPmUPemNStYmSG4RTYEq2Hc1a2",
        "account" : "",
        "scriptPubKey" : "76a9147ff792d99c99e5d89b8dbb54a5f962ccaeec404088ac",
        "amount" : 0.00100000,
        "confirmations" : 1866,
        "spendable" : true
    }
]
</code></pre>

<p>The txid is 65 characters long, and the vout is 1 character long (should I left-pad it to 4 characters? If yes, what happens after 10.000?)</p>

<p>Or I am not understanding anything? :s In this case, please provide me reliable and complete sources about this matter, as the docs seems to be very superficial about it.</p>

<p>I'm using bitcoin-cli.</p>

<bitcoin-core><bitcoin-cli>
Get outpoint for a transaction
Jefrey Sobreira Santos
# Get outpoint for a transaction

(Asked by: username_0 on 2017-01-20)

I'm trying to get the outpoint for a transaction but I don't find how to.
The pages here and here look like saying that the outpoint must have 36 characters, of what 32 are the TXID and 4 are the vout.
However I can't find any example or further information about how to get/calculate it. I'm trying with bitcoin-cli listunspent and it gave me:
[
    {
        "txid" : "4bbf676731987cce1e4639ec28d1219f065ab2aa5e9deb323c0b56bd0482d499",
        "vout" : 0,
        "address" : "1CfdQ5eHhPmUPemNStYmSG4RTYEq2Hc1a2",
        "account" : "",
        "scriptPubKey" : "76a9147ff792d99c99e5d89b8dbb54a5f962ccaeec404088ac",
        "amount" : 0.00100000,
        "confirmations" : 1866,
        "spendable" : true
    }
]

The txid is 65 characters long, and the vout is 1 character long (should I left-pad it to 4 characters? If yes, what happens after 10.000?)
Or I am not understanding anything? :s In this case, please provide me reliable and complete sources about this matter, as the docs seems to be very superficial about it.
I'm using bitcoin-cli.

**Tags:** bitcoin-core, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2017-01-20. Score: 1 | Accepted answer

The output returned by bitcoin-cli listunspent is correct. As mentioned in document, outpoint is pair of `(txid, vout)`

txid is `4bbf676731987cce1e4639ec28d1219f065ab2aa5e9deb323c0b56bd0482d499`. Its is hexadecimal representation of a binary string and will take 32 bytes, each hex digit is representing 4 bits (or half a byte)

vout is 0 , this is stored as uint32 in the bitcoin block and will take 4 bytes. In other words it stored as an [unsigned int](http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/unsigned.html) binary representation of 32 bits.


---

