Bitcoin Forum
April 27, 2024, 04:56:41 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is it possible, at this point, to run a full bitcoin node off the UTXO?  (Read 1080 times)
warpio (OP)
Member
**
Offline Offline

Activity: 110
Merit: 10



View Profile
June 19, 2014, 09:18:14 PM
 #1

Let's say I want to start running a full bitcoin node. From my understanding, I first have to download the entire 20-30gb blockchain in order to verify that I have the correct information... but after I do that, I should be able to discard everything but the UTXO, while still remaining as a fully secure node. At that point, I only need to keep my UTXO updated with each new block that I recieve, and I won't ever have to store the full blockchain again because I know the UTXO that I have is correct.

To use a more specific example, let's say I only have a hard drive that is just barely big enough to store the current full blockchain + a few extra gb. Could I start a full node on that hard drive, and after downloading the full blockchain and cutting it down into the UTXO, I could run that node forever without having to worry about running out of space? And will that be just as secure as running a node that keeps a full copy of blockchain, since I already know that the UTXO that I'm using is the correct one? Is there a way to do this with the bitcoin client currently?
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714193801
Hero Member
*
Offline Offline

Posts: 1714193801

View Profile Personal Message (Offline)

Ignore
1714193801
Reply with quote  #2

1714193801
Report to moderator
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
June 26, 2014, 07:04:49 AM
Last edit: June 26, 2014, 01:56:46 PM by DeathAndTaxes
 #2

I may be mistaken, but I thought the UTXO set is just a list of transaction hashes indicating which transaction outputs haven't been spent yet.  It doesn't contain the scriptPubKey.  Therefore, you will be unable to confirm that the requirements have been met to spend a UTXO?

The UTXO contains the scriptPubKey.  It contains everything necessary to validate new txns.  The raw blocks are not used for anything other than building/updating the UTXO.  The Bitcoin-core stores the UTXO in the chainstate folder of the data directory.  It is in a rather (overly) complex format and redundant information is removed but it contains everything needed to validate new transactions.   In the event of a re-org you can "rollback" the UTXO using undo records created by bitcoin-core for each block.  For this reason you probably wouldn't want to be 100% blockless.  You could but it would mean a lot of extra data transfer and validation in the event of a reorg so it would make sense to retain a "few" blocks.  Maybe one block day (blocks on any chain with block height within 144 of the best block hash).

Some information I discovered while decoding the UTXO:
https://bitcointalk.org/index.php?topic=647198.msg7235404#msg7235404

Quote
Could I start a full node on that hard drive, and after downloading the full blockchain and cutting it down into the UTXO, I could run that node forever without having to worry about running out of space? And will that be just as secure as running a node that keeps a full copy of blockchain, since I already know that the UTXO that I'm using is the correct one? Is there a way to do this with the bitcoin client currently?

Yes you could run a trustless node that way.  Understand you wouldn't be a "full node" as that term generally refers to nodes which can support other nodes on the network.  You would be unable to respond to requests for blocks from other nodes. 

There is no way to do this from the stock bitcoin-core, but the source code but the code could be modified to work in this manner.   One caveat is that if the UTXO became corrupt you would have no way to rebuild it.   Also you probably should retain some blocks from the tip of the blockchain in order to efficiently handle reorgs.   Bitcoin-core records both blocks and "undo" information for each block in the "blocks" directory.  Instead of retaining it for all blocks this could be modified to works as a rolling queue of blocks (and undo records).  I would also retain all blockheaders,  they are only about 5MB per block year.

I would also point out that there is no guarantee you won't run out of space.  The UTXO is only ~400MB compressed (about 1500MB uncompressed) but it is growing.  It grows at a much lower rate than the overall blockchain but it is growing. 
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4610



View Profile
June 26, 2014, 01:18:41 PM
 #3

I may be mistaken, but I thought the UTXO set is just a list of transaction hashes indicating which transaction outputs haven't been spent yet.  It doesn't contain the scriptPubKey.  Therefore, you will be unable to confirm that the requirements have been met to spend a UTXO?

The UTXO contains the scriptPubKey.  It contains everything necessary to validate new txns.  The raw blocks are not used for anything other than building/updating the UTXO.  The Bitcoin-core stores the UTXO in the chainstate folder of the data directory.  It is in a rather (overly) complex format and redundant information is removed but it contains everything needed to validate new transactions.   In the event of a re-org you can "rollback" the UTXO using undo records created by bitcoin-core for each block.  For this reason you probably wouldn't want to be 100% blockless.  You could but it would mean a lot of extra data transfer and validation in the event of a reorg so it would make sense to retain a "few" blocks.  Maybe one block day (blocks on any chain with block height within 144 of the best block hash).

Some information I discovered while decoding the UTXO:
https://bitcointalk.org/index.php?topic=647198.msg7235404#msg7235404

Thanks for the info.  I've deleted my incorrect post to avoid confusing anybody else that reads this thread, and I've updated my notes on Bitcoin so I don't repeat my mistake in the future.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!