This guide explains Bitcoin Core lockunspent RPC in plain English. It shows what the command does, what its result means and what it cannot prove.
TL;DR
- What it is: Bitcoin Core 0.16.0 lockunspent temporarily excluded exact wallet outpoints from automatic coin selection or unlocked them again. Passing unlock true with no transaction array unlocked every current lock.
- Why it matters: lockunspent is a temporary wallet coin-selection control, not durable custody. Reliable reservations require exact outpoints, persistent workflow ownership and fail-closed reconstruction after every restart.
- Current position: Bitcoin Core 0.16.0 lockunspent temporarily excluded exact wallet outpoints from automatic coin selection or unlocked them again.
Bitcoin Core lockunspent RPC in simple English
Bitcoin Core lockunspent RPC: Each item requires txid and non-negative vout. Verify the output belongs to the intended wallet, remains unspent and matches the expected script and satoshi value before changing reservation state.
Simple example
A miner is checking Bitcoin Core lockunspent RPC. When unlocking with no transaction array, every current lock is cleared. On startup, rebuild authorised reservations from durable application state before enabling coin selection.
Key terms in plain English
- Bitcoin Core:
- Widely used software that validates Bitcoin and can provide wallet, network and operator tools.
- RPC:
- A command that software sends to a node to request information or a local action.
- UTXO:
- An unspent transaction output: a piece of bitcoin that can be used as an input to a later transaction.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Exact outpoints
Each item requires txid and non-negative vout. Verify the output belongs to the intended wallet, remains unspent and matches the expected script and satoshi value before changing reservation state.
Lock versus unlock
unlock false adds specified outpoints to the temporary lock list; true removes them. Treat the boolean explicitly and verify the resulting set. A reversed flag can release treasury coins or strand a workflow.
Unlock-all hazard
When unlocking with no transaction array, every current lock is cleared. Reserve this operation for an approved recovery with a complete external reservation ledger. Never use it as a routine cleanup shortcut.
Memory-only lifecycle
All locks disappear on process exit or failure. On startup, rebuild authorised reservations from durable application state before enabling coin selection. Monitor the gap and fail closed if reconstruction is incomplete.
Local selection scope
The lock affects this wallet’s automatic selection only. Raw transactions, another wallet copy or external signers can still spend the coins. Broader custody controls must exist outside this RPC.
Concurrency
Serialise selection, lock and transaction construction so two workers cannot reserve the same UTXO. Attach owner, purpose and expiry in durable state, then reconcile listlockunspent and current UTXOs continuously.
Failure drill
On regtest, lock and unlock subsets, invoke unlock-all, restart, crash during reconstruction and spend through a manual path. Verify fail-closed startup, stale reservation cleanup and exact audit recovery. Build a revision-pinned evidence pack on an isolated node, wallet or protocol harness.
Frequently asked questions
What is the main point of Bitcoin Core lockunspent RPC?
Bitcoin Core lockunspent RPC: Each item requires txid and non-negative vout. Verify the output belongs to the intended wallet, remains unspent and matches the expected script and satoshi value before changing reservation state.
For Bitcoin Core lockunspent RPC, what should a beginner know about exact outpoints?
Each item requires txid and non-negative vout. Verify the output belongs to the intended wallet, remains unspent and matches the expected script and satoshi value before changing reservation state.
For Bitcoin Core lockunspent RPC, what should a beginner know about lock versus unlock?
unlock false adds specified outpoints to the temporary lock list. True removes them.
For Bitcoin Core lockunspent RPC, what should a beginner know about unlock-all hazard?
When unlocking with no transaction array, every current lock is cleared. Reserve this operation for an approved recovery with a complete external reservation ledger.
Conclusion
lockunspent is a temporary wallet coin-selection control, not durable custody. Reliable reservations require exact outpoints, persistent workflow ownership and fail-closed reconstruction after every restart.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.