Manual Coin Selection

Manual coin selection allows you to explicitly choose which UTXOs (unspent transaction outputs) from your wallet to use when building a transaction. By default,

Manual Coin Selection

Manual coin selection allows you to explicitly choose which UTXOs (unspent transaction outputs) from your wallet to use when building a transaction. By default, LWK automatically adds all UTXOs to cover the transaction amount and fees. However, manual coin selection gives you control over which specific UTXOs are spent, which can be useful for privacy, UTXO management, or specific transaction requirements.

When you enable manual coin selection, only the UTXOs you specify will be used. The transaction builder will not automatically add additional UTXOs, so you must ensure the selected UTXOs provide sufficient funds to cover the transaction amount and fees.

To use manual coin selection, first retrieve the available UTXOs from your wallet using Wollet::utxos(), then call TxBuilder::set_wallet_utxos() before calling finish(). The selected UTXOs must belong to the wallet generating the transaction.

The set_wallet_utxos() method takes the following argument:

  1. utxos (Vec<OutPoint>): A vector of outpoints (transaction ID and output index) identifying the UTXOs to use. Each outpoint must correspond to a UTXO owned by the wallet.

Getting Available UTXOs

Before selecting UTXOs manually, you need to retrieve the list of available UTXOs from your wallet:

let utxos = w.wollet.utxos()?;
utxos = wollet.utxos()
const utxos = wollet.utxos();
	utxos, err := wollet.Utxos()
	if err != nil {
		log.Fatal(err)
	}

Manual Coin Selection for L-BTC

The simplest use case is selecting specific L-BTC UTXOs for a transaction:

let sent_satoshi = 200_000;
let mut pset = w
    .tx_builder()
    .add_recipient(&node_address, sent_satoshi, policy_asset)?
    .set_wallet_utxos(vec![utxos[0].outpoint])
    .finish()?;
signer.sign(&mut pset)?;

// Broadcast the transaction
let tx = w.wollet.finalize(&mut pset).unwrap();
let tx = serialize(&tx);
builder = network.tx_builder()
builder.add_lbtc_recipient(node_address, sent_satoshi)
builder.set_wallet_utxos([utxos[0].outpoint()])
unsigned_pset = builder.finish(wollet)

signed_pset = signer.sign(unsigned_pset)
finalized_pset = wollet.finalize(signed_pset)

tx = finalized_pset.extract_tx()
var builder = new lwk.TxBuilder(network);
builder = builder.addLbtcRecipient(node_address, BigInt(sent_satoshi))
builder = builder.setWalletUtxos([utxos[0].outpoint()])
var unsignedPset = builder.finish(wollet);

var signedPset = signer.sign(unsignedPset);
var finalizedPset = wollet.finalize(signedPset);
var tx = finalizedPset.extractTx();
	builder := network.TxBuilder()
	if err := builder.AddLbtcRecipient(nodeAddress, sentSatoshi); err != nil {
		log.Fatal(err)
	}

	if err := builder.SetWalletUtxos([]*lwk.OutPoint{utxos[0].Outpoint()}); err != nil {
		log.Fatal(err)
	}

	unsignedPset, err := builder.Finish(wollet)
	if err != nil {
		log.Fatal(err)
	}

	signedPset, err := signer.Sign(unsignedPset)
	if err != nil {
		log.Fatal(err)
	}

	finalizedPset, err := wollet.Finalize(signedPset)
	if err != nil {
		log.Fatal(err)
	}

	tx, err := finalizedPset.ExtractTx()
	if err != nil {
		log.Fatal(err)
	}

Manual Coin Selection with Assets

When sending assets, you must include sufficient L-BTC UTXOs to cover transaction fees. If you only select asset UTXOs without L-BTC, the transaction will fail with an InsufficientFunds error.

Next Steps

After learning about manual coin selection, you can:


Previous: Transaction Creation


The Liquid Network is a production Bitcoin sidechain built with Elements, supporting confidential transactions, asset issuance and programmable smart contracts.

© 2026 Liquid Network
All rights reserved.

Feedback and Requests

We'd be happy to hear your suggestions on how to improve this site.

Simplicity Forum

Discuss SimplicityHL, tooling and applications on Liquid at community.simplicity-lang.org.

Liquid Dev Community

Community Telegram group where most of the Liquid developers hang out. Go to t.me/liquid_devel to join.