• Hash256
  • Hash160
  • Reverse Bytes

Input 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: 0d0897966df95d0b8e7a33855a64f7de365e7d17e28f2a05c39806e77d5f9859


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.

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" :,         (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: 26 Nov 2018
  • 26 Nov 2018: Added sub titles to every page.
  • 03 Nov 2017: /glossary/input - added listunspent command note
  • 03 Nov 2017: /glossary/output - updated, and also some small similar updates to other pages
  • 03 Nov 2017: /glossary/input - improvements (to go along with transaction-data changes)
  • 26 Feb 2017: - edited
  • 24 Feb 2017: CSS - glossary pages now use .center instead of .title for images inside figures
  • 24 Feb 2017: - first commit
  • 23 Feb 2017: - added warning note for txid byte order
  • 23 Feb 2017: tools/ - added h1 titles
  • 23 Feb 2017: - first draft

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.