Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [coin-selection]

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

0
votes
1answer
24 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
84 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
175 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
70 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?
4
votes
2answers
316 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
250 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
64 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
1k 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
4k 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
373 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
209 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?
6
votes
3answers
240 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
313 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
286 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
286 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
173 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
92 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
756 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
595 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 ...
39
votes
2answers
5k 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 ...