• Hash256
  • Hash160
  • Reverse Bytes
  • Hexadecimal
  • Satoshis


A batch of bitcoins being used up in a bitcoin transaction.

An input is what you call an output when you’re spending it in a transaction.



Transaction: c1b4e695098210a31fe02abffe9005cffc051bbe86ff33e173155bcbdc5821e3


Field Data Size Description
TXID 796…efc 32 bytes Refer to an existing transaction.
VOUT 01000000 4 bytes Select one of its outputs.
ScriptSig Size 6a Variable Indicates the upcoming size of the unlocking code.
ScriptSig 473…825 A script that unlocks the input.
Sequence ffffffff 4 bytes

TXID Byte Order: When you refer to a TXID within transaction data, you have to reverse the byte order to get it in its original format. The byte-order used when searching for a TXID is in reverse (due to a historical mistake in the way the original bitcoin client works).

How do Inputs work?

An an “input” has two jobs:

  1. Select an Output.
  2. Unlock it.

1. Select an Output.

When you want to use an output as an input for a transaction, you just need to specify which one you want to spend.

Every transaction has a unique TXID, so by using that with a specific output number (VOUT), you can refer to any output in the blockchain.

All you need is a txid and a vout and you can select any output from the blockchain.

2. Unlock it.

After selecting an output, you then have to be able to unlock it.

Each output is set with a locking script. So if you want to spend one, you need to supply an unlocking script (called a ScriptSig).

Nodes validate every transaction they receive. So if you do not provide an unlocking script that satisfies the locking script, your transaction will get rejected.



This command gives you a list of unspent outputs in your Bitcoin Core wallet.

In other words, it gives you a list of outputs that you can use as inputs in a new transaction:

$ bitcoin-cli listunspent

    "txid" : "txid",          (string) the transaction id
    "vout" : n,               (numeric) the vout value
    "address" : "address",    (string) the bitcoin address
    "account" : "account",    (string) DEPRECATED. The associated account, or "" for the default account
    "scriptPubKey" : "key",   (string) the script key
    "amount" : x.xxx,         (numeric) the transaction output amount in BTC
    "confirmations" : n,      (numeric) The number of confirmations
    "redeemScript" : n        (string) The redeemScript if scriptPubKey is P2SH
    "spendable" : xxx,        (bool) Whether we have the private keys to spend this output
    "solvable" : xxx,         (bool) Whether we know how to spend this output, ignoring the lack of keys
    "safe" : xxx              (bool) Whether this output is considered safe to spend. Unconfirmed transactions
                              from outside keys and unconfirmed replacement transactions are considered unsafe
                              and are not eligible for spending by fundrawtransaction and sendtoaddress.

By Greg Walker,

Last Updated: 21 Jul 2020
  • 21 Jul 2020: renamed /guide/ to /technical/
Back to Top

Hey there, it's Greg.

I'll let you know about cool website updates, or if something seriously interesting happens in bitcoin.

Don't worry, it doesn't happen very often.