Author

Topic: location of my bitcoin (Read 451 times)

member
Activity: 96
Merit: 11
September 24, 2017, 11:11:27 AM
#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.
staff
Activity: 3458
Merit: 6793
Just writing some code
September 24, 2017, 11:01:57 AM
#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.
member
Activity: 96
Merit: 11
September 24, 2017, 09:59:40 AM
#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?
Jump to: