4

I was in the http://coinb.in/multisig/#newTransaction and wanted to make a input but it needed 2 values.

  1. Txid, How do I get that?
  2. TxIn/vout, Whats that and how do I get that?

1 Answer 1

3

If you want to send some coins, you have to have been given some coins before.

When someone sends coins to you, they make a new transaction. This transaction has a TxID (which is the double SHA256 hash of the raw transaction bytes) that everyone uses to refer to this transaction. A transaction can have multiple outputs, and each outputs allocates some of the previously unspent transaction outputs (UTXO) that were used as inputs in the new transaction.

Diagram transaction inputs and outputs

So, really this question comes down to: what are bitcoins? Bitcoins are a pair of TxID and an index that uniquely specify an entry in the blockchain.

The developer documentation (https://bitcoin.org/en/developer-documentation) goes into great detail if you want to learn more.

As far as how do you actually get your hands on these values, you just have to have someone send you coins to your address (or mine them), and then you could just look your address up on a blockchain explorer and find any unspent outputs it has. From there, you can just use the web interface to see the txid and the output index. For example, I just grabbed a random transaction off from blockchain.info at https://blockchain.info/tx/86e06fed6f597dc212e72556a84660d84e9536e081719624a0a30a685238d0d7. You can see the txid is 86e06fed6f597dc212e72556a84660d84e9536e081719624a0a30a685238d0d7 and that there are two outputs (indices 0 and 1), the first of which has been spent, and the second one which has not been spent (at the time of writing).

6
  • But how do I get Txin thats the real mystery
    – tor
    Dec 3, 2014 at 14:22
  • Txin/vout is just the index of the previous transaction output that you are spending. So in the example I gave, Txin/vout is 0 or 1, depending on which ouptut you are trying to spend.
    – morsecoder
    Dec 3, 2014 at 14:26
  • So how do I get it?
    – tor
    Dec 4, 2014 at 16:53
  • Find the transaction that was sent to an address that you own on a block explorer, such as blockchain.info, and look at which output has your address in it. The first output has txin/vout 0, the second has txin/vout 1, etc...
    – morsecoder
    Dec 4, 2014 at 17:17
  • How do I find the transaction id (txid) with a address by local bitcoin node, the address maybe not inside my wallet?
    – Frank AK
    Jul 28, 2018 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.