block – bitcoin back-end blockchain storage

To put it simply, blockchain is essentially a history of transactions, with built in measures to confirm that this transaction history cannot be altered. That being said, transactions can be either spent or unspent. Spent transactions are transactions that have already been used as inputs in another transaction. Unspent transactions are transactions that have not been used. It is these unspent transactions that make up your Bitcoin balance. The key thing to understand from this is that you don’t actually own a wallet that has Bitcoin in it, you own keys which allow you to spend these unspent transactions by the process of signing.

Since the blockchain is a history of all transactions, it does indeed grow in size and requires more disk space as new blocks are mined. As of today, the Bitcoin blockchain requires around 236 GB of available disk space to store the blockchain data. There are ways in which one can operate a node that does not require the entire history, but that’s a topic for another question. Having the entire history of all transactions is useful for tracing the history of a given transaction. If a transaction is going to be used as an input for a new transaction (i.e. you want to send BTC, so you will be spending one or more of your unspent transactions), then the input’s prevhash property, or the hash of the transaction in which the coins we are going to spend were received to the given address, can be validated, and the blockchain data can also be queried to ensure that this input has not already been spent. At the end of the day, though, the only thing that says that you have BTC in your wallet are the unspent transactions (abbreviated UTXOs).

We could get into a lot of other topics here, like the fact that the hash of the next block to be mined is based on the hash of the previous block, which can be followed back all the way to the genesis block and ensures that transaction history cannot be altered. We could also get into how the block data propagates through the network, and other important matters like the 51% attack, but the key takeaway I wanted from this response to your question is the notion that your wallet is actually just a keychain, and the keys are what allow you to sign the transactions you’ve received when you wish to spend them in a new transaction.

So in conclusion, while it seems so simple to say “Well gee, I’ve got 0.5 BTC, just store that in memory and let me use my money” there is actually a lot more going on behind the scenes, which is important because its what allows Bitcoin to be the trustless distributed and decentralized ledger that it is.

Source link

Leave a Comment

Your email address will not be published. Required fields are marked *