The Blockchain

Bitcoin is not tangible like gold or cash, and it’s not a digital file that you can hold on a USB.
So, how do you own Bitcoin?
Bitcoin works by proving ownership on a decentralised public ledger called
the Blockchain.
Transactions are stored in blocks; each block has its own fingerprint and refers to the previous one, thus creating a chain. The fingerprint is created using a function called double SHA-256.
SHA-256 is a one-way hashing function of 256 bits. Given any input data, it will spit out a 64-character output. This process is computationally infeasible to reverse, meaning the original input cannot be derived from the hash.

SHA-256
SHA-256 is a one-way hashing function of 256 bits. Given any input data, it will spit out a 64-character output. This process is computationally infeasible to reverse, meaning the original input cannot be derived from the hash.
Bitcoin displays block hashes as big-endian hexadecimal strings (using symbols 0–9 and A–F), even though the hash itself is a 256-bit value that is interpreted internally in little-endian form.
The number of possible outputs is 2^256, an astronomically large number, comparable in scale to estimates of the number of atoms in the observable universe (2^266).

Making a change in the input, even as small as one character, will radically change the output.

Bitcoin miners use double SHA-256 to try to find a hash that meets the current difficulty of the network. The goal is to get a numerical value below a set target by the network’s current difficulty, often described simply as requiring a certain number of leading zeroes in the output.

The data being process above is the block header, and the result of using double SHA-256 in big-endian has trailing zeros indicating a small numerical value that meets difficulty.
It then gets reversed to little-endian as Bitcoin's protocol convention for display/storage, shifting zeros to the front for visual consistency.
When looking for a block on a blockchain explorer, they will always be displayed in little-endian.
Check for this block on the mempool here:
The Blockchain is immutable.
One of the properties of the blockchain is its eventual immutability. Once something gets recorded on it and confirmed multiple times, it becomes really difficult to change it.
As more blocks are added, that difficulty increases exponentially, until it becomes practically impossible.
Each block has its own unique fingerprint, the result of hashing the block header using double SHA-256.
The block header contains all sorts of information, including the previous block hash.
Being the result of the hashing function SHA-256, if anything changes within the block, that fingerprint will be radically different.

This is the block Hash, it’s unique identifier.
The result of a SHA-256 function is a 64 hexadecimal characters, for this example we will use only 6.
For a block to be valid, it’s imperative to include the previous block hash within the block header.
A miner, attempting to find the new block, will hash the block header trillions of times until it finds a result that meets the current difficulty.For simplicity, the mining difficulty in this example will be one leading zero.

By having each block tied to its parent’s block hash, a chain of blocks is created:

If one block is being tampered with, its hash will drastically change.
For example, if someone tries to tamper with block 056qwe by changing even a single transaction, that block’s hash would change completely.

This would invalidate its proof of work and break the link to the next block, since the next block wouldn’t be containing the correct previous hash anymore.The nodes, which operate independently from the miners, will ignore any block that doesn’t meet the consensus rules, such as the right mining difficulty proof of work or not including the previous block hash.
As a result, all blocks that follow would also become invalid and not be included in the blockchain.

To alter a past transaction, an attacker would need to re-mine that block and every subsequent block faster than the rest of the honest network combined. This would require controlling at least 51% of the network’s total hash rate, which demands an immense investment in computing power and electricity. Even if successful, the attack would likely destroy Bitcoin’s value and render their massive hardware investment worthless.

The deeper a transaction is buried in the blockchain, the harder it is to change. After about six blocks’ confirmation, a Bitcoin transaction is generally considered final.

After 100 blocks, the Coinbase transaction (the miner reward for winning a block, Tx fees + subsidy) becomes spendable, reflecting the very high level of confidence that the block will not be tampered with.

The blockchain is designed to be decentralised.
When a miner wins a block, it won’t be added to the blockchain unchecked. Once the miner has announced the winning block, thousands of independent computers around the world will verify that it follows the rules.
Nodes independently verify the new block to ensure all transactions and the proof of work follow the protocol rules. If a block is valid, the node adds it to the best valid blockchain it knows about and relays it to its connected peers.This is what makes Bitcoin decentralised; not one person, group, or entity has control over that ledger.Anyone can participate in the Bitcoin protocol, download the entire ledger, and verify it themselves by turning a cheap computer into a node.

While miners have to spend an enormous amount of energy and capital to have the chance to win a block, full nodes are very cheap to acquire and run. This means that if a miner were to cheat, they would have spent all this capital just to have their block refused by the network of nodes.

Bitcoin has a limit on block size of 1Mb (+3Mb with SegWit), which limits the number of transactions per block. The reason behind it is so that those nodes remain cheap to install and run.An old Mac mini from 2012 with 1TB of storage does the job perfectly, and you can find one for $100.
Thousands of computers right now have a full copy of that ledger and are verifying that all the blocks being mined follow the protocol 24/7.
Validity through consensus.
Bitcoin nodes enforce consensus rules, the non-negotiable rules that define what is and is not a valid Bitcoin block or transaction. If a block or transaction violates any of these rules, nodes simply reject it, regardless of who produced it.
When competing chains appear, nodes accept the one with the most cumulative proof-of-work, ensuring that no miner or authority can change Bitcoin’s rules without network-wide agreement.

If you want to learn how to run your own Bitcoin node and connect it to your wallet, we explained it here:
Conclusion
-
Bitcoin isn’t something that you can carry around in a USB; Bitcoin exists as unspent transaction outputs recorded on the blockchain. Its ownership can be proven by showing that you own the private keys attached to those coins.The blockchain is simply a public ledger where all transactions are recorded within blocks.
-
Bitcoin nodes verify that the consensus rules are being followed 24/7, and those rules are crucial for Bitcoin; they make sure that only the owner of the private keys can spend their Bitcoins, that fundamentals such as the 21 million Bitcoin limit are being followed, and that miners don’t cheat. The nodes will ignore any blocks that don’t follow the consensus rules, ensuring that no central authority can take control of Bitcoin.
-
It’s very expensive for miners to add blocks to the blockchain to receive the block reward and get paid; however, it’s very cheap to run a full node, which verifies that everyone follows the protocol. Thousands of nodes around the world are verifying that the consensus rules are being followed. This is what makes Bitcoin decentralised; anyone around the world can participate by downloading the software.

