Bitcoin Forum
December 14, 2024, 06:51:57 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: location of my bitcoin  (Read 455 times)
smokeydog (OP)
Member
**
Offline Offline

Activity: 96
Merit: 11


View Profile
September 24, 2017, 02:59:40 PM
 #1

I want to send to another party.  How does the software find my balance out of the 20 gig worth of block chain data.  Does the system use indexes or something in the same way an Oracle or other relational database does?  Is the block chain data sorted so that a binary search can find it quickly?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3570
Merit: 6927


Just writing some code


View Profile WWW
September 24, 2017, 04:01:57 PM
 #2

First of all, the blockchain is more than 20 GB, it is around 150 GB now.

Secondly, how software finds data in the blockchain is all up to their implementation. There is no singular standard way to look up blockchain data. Most software use a similar approach though, and what I will be describing is how Bitcoin Core does it.

Bitcoin Core maintains a database separate from the blockchain which contains all of the unspent transaction outputs. This database is updated when blocks are found; outputs that are spent are removed from the database and new outputs that are created are added to it. When a transaction is received, the outputs that it spends from are looked up in that database so that the transaction can be verified. There are no balances, just unspent transaction outputs and a node will look up the outputs that a transaction spends from.

For sending Bitcoin, your wallet maintains its own database of your transactions. It maintains a database separate from the blockchain which contains the transactions and outputs that pertain to you. When you want to spend, that database is read and the outputs that you are spending are chosen from that database.

smokeydog (OP)
Member
**
Offline Offline

Activity: 96
Merit: 11


View Profile
September 24, 2017, 04:11:27 PM
 #3

Thanks, that was a big help.  There is so much here it's difficult to see the picture.  I would like to just use it and ignore the details but, it's not in my nature to just accept what I don't understand but, I have a feeling I my want to know too much.
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!