bitcoin-cli:tldr:a6342
The command bitcoin-cli listunspent
is used in the Bitcoin Core software to retrieve a list of unspent transaction outputs (UTXOs) that belong to a particular wallet.
In Bitcoin, when you receive a payment, it gets recorded as an output (UTXO) of a transaction, and you can use these outputs as inputs for future transactions. The listunspent
command shows all the available UTXOs that can be used as inputs for your wallet.
When you execute the bitcoin-cli listunspent
command, the Bitcoin Core software communicates with the Bitcoin network and retrieves information about the UTXOs associated with the wallet for which the command is run. This information typically includes the transaction hash, the transaction output index, the amount of Bitcoin in the UTXO, scriptPubKey (which is the locking script that determines how the UTXO can be spent), and other details.
The listunspent
command is commonly used by developers and advanced users who want to manage their UTXOs or build applications that require UTXO information. It can be useful for understanding the available funds in a wallet, selecting UTXOs to spend for a particular transaction, or calculating wallet balance.
It's important to note that the command requires a fully synced Bitcoin Core node running in the background, as well as the bitcoin-cli
command-line tool, to function properly.