Questions tagged [utxo]

Unspent Transaction Outputs (UTXOs) are created by transactions and allow the owner of an associated address to spend a specific amount.

Filter by
Sorted by
Tagged with
30
votes
2answers
42k views

What is an “unspent output”?

What is the meaning of the term "unspent output" in the Bitcoin protocol?
26
votes
1answer
9k views

How is a wallet's balance computed?

I am wondering on how a wallet's balance is computed. Basically, from what I've read I assume that you look back at all transactions involving all the keypairs of a given wallet. Adding up all the ...
23
votes
1answer
11k views

How big is the UTXO database?

Is there a query that will return the size of the UTXO database? Specifically, the total number of unspent outputs.
12
votes
4answers
2k views

Why does Bitcoin store all transaction inputs and outputs, instead of just an “account/balance” ledger?

From what I can tell, the Ethereum blockchain just stores accounts and balances - why did the original Bitcoin developers choose the method of storing all transactions for validation instead of just ...
12
votes
2answers
4k views

UTXO model vs. account/balance model

I understand that Bitcoin uses unspent tx output and Ethereum account balance based. However, recently there are lots of discussions on that Bitcoin's UTXO database has become too big. Does this mean ...
11
votes
4answers
3k views

Why do outputs need to be spent entirely?

I understand what change is and how it works (and it's analogous to physical money change), but what I don't understand is why this is needed in the first place. Given that this is all computer based,...
11
votes
1answer
3k views

Where is the UTXO data stored?

When a new transaction is received it is added to the memory pool (after checking for conflicts). While mining, only the transactions which are in the pool are considered. What happens to the ...
11
votes
1answer
2k views

How many unspent transaction outputs are there?

I was wondering the other day how many unspent transaction outputs there are ? If you just keep track of the unspent transaction outputs you could import private keys, know its balance and perform ...
10
votes
1answer
3k views

With 100% segwit transactions, what would be the max number of transaction confirmation possible on a block?

With 100% segwit transactions, what would be the max number of transaction confirmation possible on a block? And, how many utxo can be updated by a block full of segwit transactions?
8
votes
1answer
3k views

Why is Bitcoin Core using LevelDB instead of Redis or SQLite?

Why did Core move from BDB to LevelDB? Why don't they use SQLite or move to Redis now? Is there a technical reason for this choice?
8
votes
1answer
797 views

What are the main technical hurdles to implementing UTXO commitments?

Commits of the UTXO set in the block header would enable more secure lightweight clients and caps on the number of blocks that need to be downloaded and validated in the Initial Blockchain Download, ...
7
votes
3answers
2k views

Transaction with Multiple Inputs having Same Address

Why do transactions have multiple inputs with the same address? Is it because the amounts were obtained in the address through multiple separate transactions. Shouldn't the amounts be clubbed to a ...
7
votes
2answers
696 views

Why must UTXO be completely consumed? [duplicate]

Imagine Alice owns 10 BTC and wants to send 1 BTC to bob, with a 1 BTC miners fee. In the blockchain, the transaction is recorded as "Alice spent 10 bitcoins, 1 goes to Bob, 1 goes to the miner, and ...
7
votes
2answers
928 views

How do I uniquely identify a transaction (to protect against malleability)?

Transactions I broadcast can be malleated by anyone watching the mempool (more info here). This rules out using txid for transaction identification. How can I identify my transactions to make sure ...
6
votes
2answers
7k views

How is a Transaction Output Marked as Spent?

The Bitcoin developer guide states that each output of a particular transaction can only be used as an input once in the block chain. Any subsequent reference is a forbidden double spend—an ...
6
votes
1answer
163 views

What was the longest held UTXO ever spent?

What output had the longest period between when it was created and eventually spent?
6
votes
1answer
1k views

Can the outputs of transactions with duplicate hashes be spent?

I've noticed that there are two transaction hashes that appear more than once in the blockchain. The reason for this is understandable: they sent mining rewards to the same address. These transactions ...
6
votes
1answer
1k views

How to index the UTXO set efficiently?

I haven't been able to find information on how to efficiently index UTXOs. Can you explain or point me to some resources? Update: Btw, I understand completely that the notion of address balance is ...
6
votes
4answers
3k views

How to find utxo?

I might be over thinking this, but I'm trying to figure out the best way to build an unspent output pool. Should I just naively parse every block? Every input gets removed from the hash set, and every ...
5
votes
2answers
216 views

Do UTXO's ever get consolidated to avoid complexitity?

In 'Mastering Bitcoin' (pg 130) it is explained that a transaction will require higher fees if it is complex. For example, if I collect bitcoin from 100 people to buy a single tent, then when those ...
5
votes
3answers
1k views

Do miners have to hold all the blocks in memory?

Running a miner node, one would have to verify transactions. This includes checking all the inputs of all the transactions. Does this mean that a miner must hold all the block-chain in memory (...
5
votes
1answer
808 views

Will all UTXOs eventually be worth 1 Satoshi?

If I want to spend 0.4BTC and I only have a UTXO for 1.0BTC, I will send 0.4BTC to the seller's address and 0.6BTC to my address. The seller has one UTXO and I have the other. One UTXO has become two....
5
votes
1answer
517 views

Why does bitcoind use a fork of LevelDB for key-value storage?

Since 0.8 bitcoind uses LevelDB for the storage of the UTXO set in chainstate/ and the block index in blocks/index/. On github special branch of LevelDB can be found: https://github.com/bitcoin/...
5
votes
1answer
440 views

What are the standard formats of transaction outputs?

A transaction output can have the type Pay to public key hash, P2PKH, where the ScriptPubKey field has the format: 76 a9 14 <20-byte hash of pubkey> 88 ac Pay to script hash, P2SH, used for e.g. ...
5
votes
2answers
445 views

Is the UTXO set computed from scratch by new full nodes?

When a new full node joins the network, does he, by default, compute the UTXO set from scratch from the blockchain so far; or does he simply trust the UTXO set he received is valid?
5
votes
4answers
246 views

What technical properties does a confirmed Tx have that an unconfirmed Tx does not?

From a user perspective, each block confirmation reduces the probability that a transaction payment will be reversed. However from the perspective of the software, what happens when a transaction is ...
5
votes
1answer
325 views

How many UTXOs have a marginal fee cost that's higher than its worth?

I define marginal fee cost as the number of bytes required to add that UTXO as an input to a TX multiplied by the satoshi/byte rate of the blocks being found. So for a normal p2pkh UTXO, this would ...
5
votes
1answer
1k views

Where can I query the UTXO database?

Currently there are 35 million unspent transaction outputs. Is there a site somewhere where I can query this data to see, for instance, how many UTXO's exist with a value less than 20,000 satoshis? Or ...
5
votes
1answer
643 views

BIP32 wallet sync with Bloom filters

I'm working on my SPV library and I still have a hard time figuring how to approach the BIP32 + Bloom filters combination. Here's how I currently sync an existing HD wallet (after fast catch-up): ...
4
votes
3answers
1k views

How is it possible to say that a bitcoin was fully spent?

Is a simple question, but I want to understand this at the low level. Since the UTXO is a database with the yet-to-be-spent coins, how can I say that a given coin was already full spent? What would ...
4
votes
1answer
456 views

How to find all UTXOs?

It is known, that UTXOs stored in chainstate database. But how to get them in simple txt view? Not ballances, but each UTXO.
4
votes
1answer
722 views

a few questions about how HD wallet works

I've read through HD wallet from various resources and have got the basic understanding about it, but am still confused by a few details 1) Each non-hardened public keys (thus addresses) can receive ...
4
votes
1answer
336 views

What is the Big-O complexity to retrieve the balance for a user?

Here is the Q/A related to: How is a wallet's balance computed?. Based on this: [Q] What is the Big-O complexity to retrieve the balance for a user? Is it O(n), so basically do I have to iterate ...
4
votes
5answers
722 views

Why has UTXO set stopped growing since 2017-06-03?

The bitcoin UTXO set appears to have stopped growing on 2017-06-3 after 5 or more years of nearly constant increase. What are the reasons (or hypotheses) why? Charts below: 2012 to 2017-07-11 https:/...
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 ...
4
votes
1answer
305 views

How can one realistically model the distribution of the network's unspent transaction outputs?

I am working on a simulation to explore the usefulness of a patch for the CoinSelection behaviour of BitcoinCore. To that end, I am looking for statistics on the distribution of unspent outputs ...
4
votes
1answer
46 views

Is the bit encoding format for the graphic in BIP 68 implicitly little-endian?

CLTV (OP_CHECKLOCKTIMEVERIFY - absolute locktime) and CSV (OP_CHECKSEQUENCEVERIFY - relative locktime) utilize BIP 68. Is the locktime for those two operations implicitly encoded in little-endian ...
4
votes
1answer
282 views

Why does Bitcoin use the input/output system?

Why don't we just use balances? The nodes would verify that balance > 0 before validating the transaction.
4
votes
1answer
2k views

How can I read chainstate database?

1) What is the format of the LevelDB databases stored in the database directory? I know there are some custom blockchain parsing libraries, such as this one, but I'm wondering if I can just do a read ...
4
votes
1answer
144 views

Is it possible (in some way or other) to expire a txout?

I read Contracts: Will this be possible? where part of the question related to expiring a transaction and one of the replies said that it would never be possible since it causes problems. ...
3
votes
1answer
258 views

Why is it not possible to replay transactions?

What if a miner takes a transaction which is already on the chain and adds it to a new block to earn the fee once more? Which mechanism prohibits replay attacks of this type?
3
votes
1answer
71 views

Do confidential transactions produce an UTXO

There must be magical cryptographic reason why CT doesn't create an UTXO. If it did make an UTXO, it'd be trivial to calculate the input + output right?
3
votes
1answer
3k views

Do all Tx's have UTXO?

I am trying to understand how UTXO works. I came up with these charts https://statoshi.info/dashboard/db/unspent-transaction-output-set I don't understand why the 1st chart (total Tx's with unspent ...
3
votes
2answers
273 views

Can there be a half segwit, half normal Bitcoin transaction?

I was wondering if it's feasible to compile a bitcoin transaction that is somewhere in between (segwit and non-segwit), maybe one of these scenarios. I'll call the non-segwit inputs, normal inputs ...
3
votes
1answer
798 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 ...
3
votes
2answers
1k views

Why the “Unspent Transaction Output Set” is called “UTXO”, not “UTOS”?

Just out of curiosity, the Wiki says UTXO means "Unspent Transaction Output", but what does each letter mean in the acronym?
3
votes
1answer
255 views

How bitcoin nodes update UTXO set when their latests blocks are replaced?

Let's say bitcoin node has 100 blocks. Then he recieve another two blocks. Now it have 102 blocks. But now he recieve block 103. And this block is from another chain and our node have to remove blocks ...
3
votes
2answers
2k views

How to check if an output has been spent?

Using an rpc client (e.g. bitcoin-cli), for a given transaction and index of an output of it, how can I tell if the output is currently an utxo, or if it has already been spent? In the latter case, I'...
3
votes
1answer
114 views

Do transactions with old UTXOs take longer to confirm?

Suppose I do a transaction with an UXTO created years ago. Would that take longer to confirm because miners would have to look further back in the transaction chain to verify it?
3
votes
1answer
57 views

Why do we need CCoins in addition to CTransactions?

As per my understanding CTransactions represents the atomic unit in Bitcoin. It has the inputs CTxIn and outputs CTxOut. Can any expert give the intuition of why we need CCoins in source code ? Why ...