Questions tagged [coin-selection]

Deals with topics of algorithms and schemes to pick which UTXO to fund a transaction with.

Filter by
Sorted by
Tagged with
3
votes
1answer
35 views

Is there a way to allow use of unconfirmed RBF outputs in transaction building?

Bitcoin Core seems to not consider unconfirmed outputs that are marked replaceable in input selection. Is there a way to override this protection and allow use anyway? The transaction is created using ...
1
vote
1answer
74 views

Coin selection algorithm

Playing around with Bitcoin Core Client v0.18.0, I used this command: $ bitcoin-cli sendtoaddress "mozazucvLK179u41bF5Vd2Agp4wsm7HsPo" 0.1 which created this transaction. I noticed that the ...
1
vote
1answer
46 views

How does a Bitcoin (Core) wallet use inputs?

When creating a new transaction, how does the Bitcoin Core wallet (or any other wallet) handle/use the outputs (UTXO's)? e.g. when 2 outputs have to be used, will Bitcoin spend the highest address (...
1
vote
1answer
83 views

What's partial spending? What does avoidpartialspend do?

Group outputs by address, selecting all or none, instead of selecting on a per-output basis. Privacy is improved as an address is only used once (unless someone sends to it after spending from it), ...
4
votes
1answer
145 views

Are all UTXOs locked by an address spent in a transaction?

Imagine I have 2 UTXOs locked by my address, each of which allows me to spend 5 bitcoins. If I subsequently want to send just 2 bitcoins to someone else, will both UTXOs be used as inputs in the ...
1
vote
2answers
198 views

How would I need to change ElectrumX to use FIFO selection of UTXOs?

By default, UTXOs are picked randomly in ElectrumX. I want to change this behaviour and spend UTXOs on 'FIFO' basis. What changes do I need to make?
2
votes
1answer
74 views

How do Schnorr signatures impact coin selection and the utxo growth?

Will Schnorr signature incentivise different practices in coin selection? How do they impact the utxo set in the long run?
5
votes
2answers
424 views

Has UTXO selection methods changed since activation of Segwit?

Before Segwit, transactions were penalized higher fees for having more inputs than outputs due to the input size being larger despite those transactions actually decreasing the global UTXO set. Segwit ...
0
votes
1answer
326 views

How to get unspents for inputs using bitcoinjs-lib?

I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs, but is there something I can add to it to keep track of unspents?...
2
votes
2answers
72 views

coin selection - why selecting transactions with confirmations first better

I know that selecting transactions with confirmations first are much better than spending transactions with 0 confirmations direct. But why is that?
2
votes
4answers
2k views

Why do some transactions have more than one input?

I know a normal transaction has 1 input and 2 outputs (if there is change that is the second output). But what about this scenario? Lets say I'm withdrawing bitcoin from my gemini account and want ...
5
votes
2answers
5k views

Send BTC with Electrum: which address is used?

I'm new to bitcoin and I've downloaded Electrum. I can see the new wallet generated a few addresses for me. If I want to receive BTC, I just need to give one of those addresses. But if I want to ...
3
votes
1answer
428 views

Coin selection algorithm in Python to optimally select UTXO

Does anyone know of a good coin selection algorithm in Python that's perhaps similar to the one in Bitcoin Core (currently this: github/bitcoin/src/wallet.cpp (per guidance from stackexchange/1077))? ...
2
votes
1answer
218 views

How does the Coin Selection in Bitcoin Wallet for Android work?

What is the algorithm in Bitcoin Wallet for Android to select the inputs to create a new transaction?
5
votes
3answers
251 views

Why is the witness data fee discounted by a factor of four?

I've read that it encourages users to consolidate UTXO sets. How would it be doing that?
5
votes
2answers
342 views

Which inputs will be spent?

Say someone holds 100,000 btc. Over time, this address has been spammed with dust by numerous parties. Now, the oldest funds come from the previous large transaction. If the dust is, say 0....
4
votes
2answers
298 views

How does Bitcoin Core's Coin Selection prevent change to be a dust output?

Bitcoin Core's Coin Selection optimizes for minimal change outputs. How does Bitcoin Core prevent Change outputs of sizes below dust threshold from occurring?
1
vote
1answer
312 views

Do all UTXO get moved to the newest change address?

There is one thing I do not understand about unspent outputs and change addresses. For example, let's say a person has 5BTC in a wallet, and they have 2 unspent outputs of 3BTC and 2BTC. They one ...
2
votes
1answer
186 views

How to spend bitcoins From Account and specify Fee

I am writing an application that uses bitcoin wallet accounts to specify what addresses belong to what user. I have been reading the documentation trying to find a way to spend Bitcoins specifying the ...
2
votes
1answer
97 views

What order does Bitcoin Core place the inputs it spends in?

What order does Bitcoin core place the inputs it spends in? Is it random? Is it sorted by anything? What, if anything, can you tell about the originator of a transaction by the input ordering?
9
votes
1answer
6k views

What does Bitcoin Core's “Coin Control Features” do and how do I use it?

What is Bitcoin Core's "Coin Control Features"? How do I use it, and what can I do with it?
3
votes
1answer
797 views

What are the trade-offs between the different algorithms for deciding which UTXOs to spend?

When someone would like to make a transaction, their software has to choose which of their UTXOs to spend. Here are a few different ways that one might prioritize which UTXOs get spent. Oldest UTXOs ...
9
votes
3answers
608 views

How can I control which coins to spend in a transaction?

When creating a bitcoin transaction, you have to choose which coins to use in them. The standard client does this in a way to avoid unconfirmed inputs and minimize the number of inputs and amount of ...
40
votes
2answers
6k views

What is the coin selection algorithm?

When creating a transaction in the standard client, what is the algorithm used to determine which unspent outputs will be used as inputs? Has this changed since the first version? What different ...