Other database besides UTXO?State of transaction and UTXOWhere does Trezor get UTXOs from?How can one realistically model the distribution of the network's unspent transaction outputs?fetching unconfirmed utxos from blockchain.infoWhere is the Signature stored in a SegWit transaction?What exactly is collecting transactions?Does addressindex works in satoshi Bitcoin-Core?Editing the utxo database?How does an SPV client forms a transaction which is then Broadcasted?How do blockchains in each nodes maintain consistency?
Why are one-word titles so dominant in books, film, and games?
Mutate my DNA sequence
How does one "become like water"?
For the Single Entry Schengen visa, do the microstates (Monaco, San Marino and the Vatican City) count?
Who is Alice referring to when she was talking to Kate?
If you have multiple planeswalkers, how many of their loyalty abilities can you use in a single turn?
What is the purpose of polls published by the organization that they are asking about which have leading/confusing questions?
Is This Constraint Convex?
Algorithm that converts array-like data into MathJax: Python
Why are Buddhist concepts so difficult?
Why would shrinking TEMPDB log lead to slowness?
Articles at the beginning of sentences in scientific writing
A word/phrase means "a small amount" (of a color)
Is it safe to plug one travel adapter into another?
529 accounts for multiple kids
Can a company prevent a co-author of a paper to put his name on it?
ASCII TURNED SHAPE
Are homeless people protected by antidiscrimination laws?
Would there be a difference between boiling whole black peppercorns or fine ground black pepp in a stew?
If ten experts each of different fields where sent back 10 000y, can they recreate the 21 century in 100y?
Intuition for the derivative of the exponential function
Are commoners actually this squishy?
How can a signal be both periodic and random?
How can different packages have identical source code?
Other database besides UTXO?
State of transaction and UTXOWhere does Trezor get UTXOs from?How can one realistically model the distribution of the network's unspent transaction outputs?fetching unconfirmed utxos from blockchain.infoWhere is the Signature stored in a SegWit transaction?What exactly is collecting transactions?Does addressindex works in satoshi Bitcoin-Core?Editing the utxo database?How does an SPV client forms a transaction which is then Broadcasted?How do blockchains in each nodes maintain consistency?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
In this post it is explained that the UTXO are removed after they are spent. This makes sense because they are not "unspent" anymore.
But don't all UTXOs have a reference/connection to their previous transaction? Is there a second "list" in the blockchain where all transactions from the past are stored? Because if not, where does that reference point to if the previous transaction is not in the UTXO list anymore.
The whole UTXO Model confuses me a little bit, so thank you for the clarification.
bitcoin-core transactions utxo utxo-set
New contributor
add a comment
|
In this post it is explained that the UTXO are removed after they are spent. This makes sense because they are not "unspent" anymore.
But don't all UTXOs have a reference/connection to their previous transaction? Is there a second "list" in the blockchain where all transactions from the past are stored? Because if not, where does that reference point to if the previous transaction is not in the UTXO list anymore.
The whole UTXO Model confuses me a little bit, so thank you for the clarification.
bitcoin-core transactions utxo utxo-set
New contributor
add a comment
|
In this post it is explained that the UTXO are removed after they are spent. This makes sense because they are not "unspent" anymore.
But don't all UTXOs have a reference/connection to their previous transaction? Is there a second "list" in the blockchain where all transactions from the past are stored? Because if not, where does that reference point to if the previous transaction is not in the UTXO list anymore.
The whole UTXO Model confuses me a little bit, so thank you for the clarification.
bitcoin-core transactions utxo utxo-set
New contributor
In this post it is explained that the UTXO are removed after they are spent. This makes sense because they are not "unspent" anymore.
But don't all UTXOs have a reference/connection to their previous transaction? Is there a second "list" in the blockchain where all transactions from the past are stored? Because if not, where does that reference point to if the previous transaction is not in the UTXO list anymore.
The whole UTXO Model confuses me a little bit, so thank you for the clarification.
bitcoin-core transactions utxo utxo-set
bitcoin-core transactions utxo utxo-set
New contributor
New contributor
New contributor
asked Oct 12 at 17:15
NuiNui
132 bronze badges
132 bronze badges
New contributor
New contributor
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
Once spent, the wallet removes the UTXO from its cache of unspent transactions. The transaction is not removed from the general database (the blockchain or block index). Full nodes running with txindex=1 keep every transaction forever. Some wallets though optimize the database to recover disk space - but this is a wallet-specific optimization and not part of how Bitcoin works.
For instance, Bitcoin Core has many caches and optimizations. One of them is the UTXO cache. The reason to have this cache is kind of obvious: if you had to search the entire blockchain for your own unspent coins before every transaction, that could potentially take hours. So Bitcoin Core keeps track of your UTXO's. Your UTXO's output amounts add up and become the balance you see on the wallet software.
The UTXO cache never points to previous transactions - it's just an optimization cache that makes it easy for Bitcoin Core to find TX's. The algorithm which builds the UTXO cache knows which transaction the UTXO came from, but the cache never points anywhere except to the TX index where the unspent output is located.
The pointer to a previous transaction only exists when you spend a UTXO and then a new input TX is created on that transaction. That input will point to the previously unspent transaction and that former UTXO will become spent. A new UTXO is then created after this transaction is mined. This UTXO becomes part of the Bitcoin balance of the recipient, just like the UTXO was part of your balance before you spent it.
This image (courtesy of bitcoin.org) might help illustrate how it works:
See those UTXO's dangling without a new TX ahead of them? Until they're spent, they remain as UTXO.
The arrows in that illustration show the money flow direction, but technically the arrows point the other way around : the inputs point back at some previous UTXO output. Once an input points at an output that output is no longer a UTXO, it is a committed TX. The input links the previous TX to a new UTXO and the previous one is marked spent. Bitcoin Core then removes this previous UTXO from the cache.
New contributor
add a comment
|
I want add a clarification inside your good post by Jose Fonseca, the UTXO is a TransactionOutput, this structure has only 2 value, the amount and the scriptPubKey. The link to the previous transaction is inside the TransactionInput so, the TransactionInput and the transaction output is contained inside the Raw transaction.
So inside the cache is present only the UTXO (TransactionOutput).
I have created this schema for my document, I hope it can help you.
This image tries to simplify how bitcoin transactions are generated.
The terms that are used are generalized, for example, you do not enter the public key in the output transaction but the address or hash160 of public key, this depend to the type of script is used.
In the image is not represented but there is a data type called Outpoint that refers to the previous raw transaction.
Still, for my project I rebuilt the data structures used in Bitcoin core (Except for the scriptWitness) if you haven't looked at the code, they can give you a general idea. you can find it here
ps: I'm developing this documentation, it can contain some error, please verify it.
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "308"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Nui is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f90963%2fother-database-besides-utxo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Once spent, the wallet removes the UTXO from its cache of unspent transactions. The transaction is not removed from the general database (the blockchain or block index). Full nodes running with txindex=1 keep every transaction forever. Some wallets though optimize the database to recover disk space - but this is a wallet-specific optimization and not part of how Bitcoin works.
For instance, Bitcoin Core has many caches and optimizations. One of them is the UTXO cache. The reason to have this cache is kind of obvious: if you had to search the entire blockchain for your own unspent coins before every transaction, that could potentially take hours. So Bitcoin Core keeps track of your UTXO's. Your UTXO's output amounts add up and become the balance you see on the wallet software.
The UTXO cache never points to previous transactions - it's just an optimization cache that makes it easy for Bitcoin Core to find TX's. The algorithm which builds the UTXO cache knows which transaction the UTXO came from, but the cache never points anywhere except to the TX index where the unspent output is located.
The pointer to a previous transaction only exists when you spend a UTXO and then a new input TX is created on that transaction. That input will point to the previously unspent transaction and that former UTXO will become spent. A new UTXO is then created after this transaction is mined. This UTXO becomes part of the Bitcoin balance of the recipient, just like the UTXO was part of your balance before you spent it.
This image (courtesy of bitcoin.org) might help illustrate how it works:
See those UTXO's dangling without a new TX ahead of them? Until they're spent, they remain as UTXO.
The arrows in that illustration show the money flow direction, but technically the arrows point the other way around : the inputs point back at some previous UTXO output. Once an input points at an output that output is no longer a UTXO, it is a committed TX. The input links the previous TX to a new UTXO and the previous one is marked spent. Bitcoin Core then removes this previous UTXO from the cache.
New contributor
add a comment
|
Once spent, the wallet removes the UTXO from its cache of unspent transactions. The transaction is not removed from the general database (the blockchain or block index). Full nodes running with txindex=1 keep every transaction forever. Some wallets though optimize the database to recover disk space - but this is a wallet-specific optimization and not part of how Bitcoin works.
For instance, Bitcoin Core has many caches and optimizations. One of them is the UTXO cache. The reason to have this cache is kind of obvious: if you had to search the entire blockchain for your own unspent coins before every transaction, that could potentially take hours. So Bitcoin Core keeps track of your UTXO's. Your UTXO's output amounts add up and become the balance you see on the wallet software.
The UTXO cache never points to previous transactions - it's just an optimization cache that makes it easy for Bitcoin Core to find TX's. The algorithm which builds the UTXO cache knows which transaction the UTXO came from, but the cache never points anywhere except to the TX index where the unspent output is located.
The pointer to a previous transaction only exists when you spend a UTXO and then a new input TX is created on that transaction. That input will point to the previously unspent transaction and that former UTXO will become spent. A new UTXO is then created after this transaction is mined. This UTXO becomes part of the Bitcoin balance of the recipient, just like the UTXO was part of your balance before you spent it.
This image (courtesy of bitcoin.org) might help illustrate how it works:
See those UTXO's dangling without a new TX ahead of them? Until they're spent, they remain as UTXO.
The arrows in that illustration show the money flow direction, but technically the arrows point the other way around : the inputs point back at some previous UTXO output. Once an input points at an output that output is no longer a UTXO, it is a committed TX. The input links the previous TX to a new UTXO and the previous one is marked spent. Bitcoin Core then removes this previous UTXO from the cache.
New contributor
add a comment
|
Once spent, the wallet removes the UTXO from its cache of unspent transactions. The transaction is not removed from the general database (the blockchain or block index). Full nodes running with txindex=1 keep every transaction forever. Some wallets though optimize the database to recover disk space - but this is a wallet-specific optimization and not part of how Bitcoin works.
For instance, Bitcoin Core has many caches and optimizations. One of them is the UTXO cache. The reason to have this cache is kind of obvious: if you had to search the entire blockchain for your own unspent coins before every transaction, that could potentially take hours. So Bitcoin Core keeps track of your UTXO's. Your UTXO's output amounts add up and become the balance you see on the wallet software.
The UTXO cache never points to previous transactions - it's just an optimization cache that makes it easy for Bitcoin Core to find TX's. The algorithm which builds the UTXO cache knows which transaction the UTXO came from, but the cache never points anywhere except to the TX index where the unspent output is located.
The pointer to a previous transaction only exists when you spend a UTXO and then a new input TX is created on that transaction. That input will point to the previously unspent transaction and that former UTXO will become spent. A new UTXO is then created after this transaction is mined. This UTXO becomes part of the Bitcoin balance of the recipient, just like the UTXO was part of your balance before you spent it.
This image (courtesy of bitcoin.org) might help illustrate how it works:
See those UTXO's dangling without a new TX ahead of them? Until they're spent, they remain as UTXO.
The arrows in that illustration show the money flow direction, but technically the arrows point the other way around : the inputs point back at some previous UTXO output. Once an input points at an output that output is no longer a UTXO, it is a committed TX. The input links the previous TX to a new UTXO and the previous one is marked spent. Bitcoin Core then removes this previous UTXO from the cache.
New contributor
Once spent, the wallet removes the UTXO from its cache of unspent transactions. The transaction is not removed from the general database (the blockchain or block index). Full nodes running with txindex=1 keep every transaction forever. Some wallets though optimize the database to recover disk space - but this is a wallet-specific optimization and not part of how Bitcoin works.
For instance, Bitcoin Core has many caches and optimizations. One of them is the UTXO cache. The reason to have this cache is kind of obvious: if you had to search the entire blockchain for your own unspent coins before every transaction, that could potentially take hours. So Bitcoin Core keeps track of your UTXO's. Your UTXO's output amounts add up and become the balance you see on the wallet software.
The UTXO cache never points to previous transactions - it's just an optimization cache that makes it easy for Bitcoin Core to find TX's. The algorithm which builds the UTXO cache knows which transaction the UTXO came from, but the cache never points anywhere except to the TX index where the unspent output is located.
The pointer to a previous transaction only exists when you spend a UTXO and then a new input TX is created on that transaction. That input will point to the previously unspent transaction and that former UTXO will become spent. A new UTXO is then created after this transaction is mined. This UTXO becomes part of the Bitcoin balance of the recipient, just like the UTXO was part of your balance before you spent it.
This image (courtesy of bitcoin.org) might help illustrate how it works:
See those UTXO's dangling without a new TX ahead of them? Until they're spent, they remain as UTXO.
The arrows in that illustration show the money flow direction, but technically the arrows point the other way around : the inputs point back at some previous UTXO output. Once an input points at an output that output is no longer a UTXO, it is a committed TX. The input links the previous TX to a new UTXO and the previous one is marked spent. Bitcoin Core then removes this previous UTXO from the cache.
New contributor
New contributor
answered Oct 12 at 19:12
Jose FonsecaJose Fonseca
1266 bronze badges
1266 bronze badges
New contributor
New contributor
add a comment
|
add a comment
|
I want add a clarification inside your good post by Jose Fonseca, the UTXO is a TransactionOutput, this structure has only 2 value, the amount and the scriptPubKey. The link to the previous transaction is inside the TransactionInput so, the TransactionInput and the transaction output is contained inside the Raw transaction.
So inside the cache is present only the UTXO (TransactionOutput).
I have created this schema for my document, I hope it can help you.
This image tries to simplify how bitcoin transactions are generated.
The terms that are used are generalized, for example, you do not enter the public key in the output transaction but the address or hash160 of public key, this depend to the type of script is used.
In the image is not represented but there is a data type called Outpoint that refers to the previous raw transaction.
Still, for my project I rebuilt the data structures used in Bitcoin core (Except for the scriptWitness) if you haven't looked at the code, they can give you a general idea. you can find it here
ps: I'm developing this documentation, it can contain some error, please verify it.
add a comment
|
I want add a clarification inside your good post by Jose Fonseca, the UTXO is a TransactionOutput, this structure has only 2 value, the amount and the scriptPubKey. The link to the previous transaction is inside the TransactionInput so, the TransactionInput and the transaction output is contained inside the Raw transaction.
So inside the cache is present only the UTXO (TransactionOutput).
I have created this schema for my document, I hope it can help you.
This image tries to simplify how bitcoin transactions are generated.
The terms that are used are generalized, for example, you do not enter the public key in the output transaction but the address or hash160 of public key, this depend to the type of script is used.
In the image is not represented but there is a data type called Outpoint that refers to the previous raw transaction.
Still, for my project I rebuilt the data structures used in Bitcoin core (Except for the scriptWitness) if you haven't looked at the code, they can give you a general idea. you can find it here
ps: I'm developing this documentation, it can contain some error, please verify it.
add a comment
|
I want add a clarification inside your good post by Jose Fonseca, the UTXO is a TransactionOutput, this structure has only 2 value, the amount and the scriptPubKey. The link to the previous transaction is inside the TransactionInput so, the TransactionInput and the transaction output is contained inside the Raw transaction.
So inside the cache is present only the UTXO (TransactionOutput).
I have created this schema for my document, I hope it can help you.
This image tries to simplify how bitcoin transactions are generated.
The terms that are used are generalized, for example, you do not enter the public key in the output transaction but the address or hash160 of public key, this depend to the type of script is used.
In the image is not represented but there is a data type called Outpoint that refers to the previous raw transaction.
Still, for my project I rebuilt the data structures used in Bitcoin core (Except for the scriptWitness) if you haven't looked at the code, they can give you a general idea. you can find it here
ps: I'm developing this documentation, it can contain some error, please verify it.
I want add a clarification inside your good post by Jose Fonseca, the UTXO is a TransactionOutput, this structure has only 2 value, the amount and the scriptPubKey. The link to the previous transaction is inside the TransactionInput so, the TransactionInput and the transaction output is contained inside the Raw transaction.
So inside the cache is present only the UTXO (TransactionOutput).
I have created this schema for my document, I hope it can help you.
This image tries to simplify how bitcoin transactions are generated.
The terms that are used are generalized, for example, you do not enter the public key in the output transaction but the address or hash160 of public key, this depend to the type of script is used.
In the image is not represented but there is a data type called Outpoint that refers to the previous raw transaction.
Still, for my project I rebuilt the data structures used in Bitcoin core (Except for the scriptWitness) if you haven't looked at the code, they can give you a general idea. you can find it here
ps: I'm developing this documentation, it can contain some error, please verify it.
edited Oct 12 at 23:16
answered Oct 12 at 21:11
vincenzopalazzovincenzopalazzo
4151 silver badge16 bronze badges
4151 silver badge16 bronze badges
add a comment
|
add a comment
|
Nui is a new contributor. Be nice, and check out our Code of Conduct.
Nui is a new contributor. Be nice, and check out our Code of Conduct.
Nui is a new contributor. Be nice, and check out our Code of Conduct.
Nui is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Bitcoin Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f90963%2fother-database-besides-utxo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown