Bitcoin and it's blockchain are well documented online. This tool fills a gap by helping curious people see the data for themselves. It displays a block in it's entirety, with annotations to aid understanding.
Each of these other sites will help build a picture of what's in a block. They're all very useful.
None of them shows you the raw data though. If you're a developer, or someone else curious about the specifics, seeing the data can be invaluable. Here are some examples of actual Bitcoin blocks.
Similarly, if you look at the Block Size of the Genesis block, you'll see d7000000. That looks like a huge number, but it's in big-endian order. Reverse it (to 000000d7), and it looks more like what it really is: 215 decimal.
Each block has a header and a number of transactions. Each transaction has a number of inputs (Bitcoin coming in to be spent) and a number of outputs (Bitcoin going out).
We've hand picked a few blocks that may be of interest. The Genesis block is the first in the chain. You'll note that it's Previous Hash is all zeros, indicating that nothing came before. It has only one transaction: a reward of 50 Bitcoins for creating (mining) the block, presumably going to an address controlled by Satoshi Nakamoto.
The Pizza Block has two transactions: the Coinbase transaction rewarding the miner with 50 Bitcoins, and the transfer of 10,000 Bitcoins for the purchase of two pizzas. This is the first known transaction where Bitcoin was used to purchase physical goods.
We've seen the block format. How does this format add up to a distributed ledger that allows exchange of value with both anonymity and security?
Letâs discuss the anonymity part first. You can send Bitcoins, or a portion of a Bitcoin, to another person without knowing who they are. Think of it as sending to an address, rather than to a person. Thatâs close enough to reality to be useful for now. The full story is hidden in the input and output scripts.
If youâve sold five widgets over the internet, and taken payment in Bitcoin, you've probably followed the convention of using a different address for each transaction. Addresses look like this, 1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1, so keeping track becomes cumbersome quickly. You probably have software of some sort keeping track of your addresses and your balance. This software will also help you spend Bitcoin when it comes time to pay your suppliers or employees. Youâll have a âwalletâ controlled by this application, which includes all details, including the secret key needed to spend the contents.
Itâs possible to send Bitcoin to any address you wish. You could send some to another address owned by yourself (and this is common), or to an address that isnât actually used by anyone. The specific address shown earlier is from an early block, and is presumed to be controlled by the creator of Bitcoin. You could send to it, even though your contribution is unlikely to be claimed.
To send Bitcoin, you need 1) some of your own Bitcoin (attached to an address that you control), and 2) an address controlled by the intended recipient. The transaction is typically done through your wallet software: choose the destination address, and an amount, and your Bitcoin will go; the transaction will become part of the newest block in the Bitcoin blockchain.
Everyone working with Bitcoin has a record of the blockchain. That necessarily limits the anonymity of the system, but as long as no one knows your addresses, they canât know your balances.
If everyone has a copy of all the transactions, whatâs to prevent someone from changing a value and claiming to have more than they really do? (Oh, if only the answer was simple human decency! But if that were true, you wouldnât have thought of that question.) A small part of the answer is the obvious: everyone has a copy of all the transactions, and a fake could be spotted. To prevent arguments, fights and lawsuits from breaking out all over, the system makes clever use of cryptography.
Specifically, the system uses a number of hashes to enable detection of trickery. If you âhashâ some text, you get a representation of that text that looks completely different. Hashing âgroktheblockâ gives the hash e22cb760118c7bff73bcf868661343e36f4581a07685548686959b1023ed996f. Add a small change, âGroktheblock', and we get de9ae0eb4d66e119a5dd2da62058032e6f2b6b5642d218b9c7acc835f550939c: a completely different result. Itâs easy to know if the original text has been changed, if we have a copy of the original hash.
Bitcoin hashes the header of each block (Version through Nonce), and stores the result in the next block in the chain. Its in the âPrevious Hashâ field. So, if anyone changes part of a blockâs header, it will be obvious because itâs hash will no longer match the value in the next block.
That in itself is insufficient. We need to detect changes in the transactions more than we do the block header. Of course, we can. Part of the header is the âMerkle Rootâ. This is the root hash of a Merkle tree. Merkle trees are interesting in themselves, but essentially the root is the result of hashing each of the transactions. If one of the transactions is changed, weâd know, because the Merkle Root wouldnât match.
So, the next block in the chain contains proof that the current blockâs header hasnât been faked. The current blockâs header has the Merkle Root, which proves none of the blockâs transactions have been faked.