Get outpoint for a transaction

0

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.

Jefrey Sobreira Santos

Posted 2017-01-20T06:03:37.140

Reputation: 113

Answers

1

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 binary representation of 32 bits.

dark knight

Posted 2017-01-20T06:03:37.140

Reputation: 1 532