Bitcoin In One Blog Post

Preface: Last year for a project I had to learn about Bitcoin and blockchain. I had made a document summarizing the big picture for my own edification. Maybe someone else will find it valuable...

Overview

Bitcoin is an effort to create a system of value manifested in a public ledger of transactions managed in a decentralized fashion using cryptography to prevent tampering. Bitcoin is a digital currency. The “coins” in the Bitcoin currency are encrypted transaction records that the users of Bitcoin choose to assign value to.

Any currency that is treated as a store of value needs to be regulated to protect against malicious manipulation. Normal “paper” currencies are regulated by an external authority like a central bank. Bitcoin is regulated by a decentralized ledger called the blockchain which records validated records of transaction blocks, while providing a mechanism to encourage use and the growth of the currency (toward a fixed limit).

Users

An individual user in the Bitcoin system will participate in a transaction through a public and private key. The public key is an identifier of 26-35 alphanumeric characters, beginning with the number 1 that can be known. The private key is a 256-bit random number that the user must keep safe. These will likely be used only once for a transaction and then regenerated. The user will also have a wallet of some kind which manages their coins.

Transactions

To transfer a coin from one user to another, the following process is employed:

The Blockchain

We said above that this transaction is unverified. Creating an irrefutable, honest, decentralized ledger of verified transactions is the special aspect of the Bitcoin system; it is called the blockchain. Without the blockchain, users would be free to spend a coin multiple times or engage in other malicious behavior.

The blockchain is a sequence of blocks of transactions that are considered valid and honest. The blockchain is managed by a network of special hosts called Bitcoin nodes in a way that encourages honest participation in maintaining the safety of the currency.

Transactions are considered valid when the network of Bitcoin nodes reaches consensus. Consensus is the result of constructing a blockchain of valid blocks of transactions. With many nodes in the network, it is possible to create many chains - the one that is the longest is considered the authoritative chain.

Proof-of-Work

Bitcoin has a feature that prevent nodes from casually appending blocks to a chain. This is called proof-of-work. Without proof-of-work, it would be impossible to discriminate malicious behavior from legitimate.

The Bitcoin network synchronizes itself every ten minutes with new validated blocks of transactions. It is expected that the difficulty of proof-of-work imposed on nodes in the network should be only sufficient to require around ten minutes to complete the creation of a valid block. This difficulty value is called the target and it is readjusted every two weeks (approximately every 2160 blocks - there are 2160 ten-minute intervals in two weeks) in order to keep the difficulty in achieving the proof-of-work near ten minutes. The target is set higher to make proof-of-work more difficult (if the network is validating blocks too quickly) or lower to make proof-of-work easier (if the network is not validating blocks quickly enough).

In any transaction, the recipient may use the transferring user’s public key to verify its origin. This transaction is then sent to a pool of unvalidated transactions the node network may draw from in order to validate. The nodes that create blocks of valid transactions are called miners, which are nodes that have valid blockchains and work to add more blocks to the blockchain.

Mining

The miner’s goal is to seek to create a block which will represent some number of validated transactions, and have this block added to the blockchain. To do so, the miner must satisfy the proof-of-work to show their interest is legitimate.

The creation of a block is as follows:

There are other mechanisms in the blockchain protocol that ensure that blocks that are invalid cannot be added to the chain.

The chain that is the longest is considered authoritative; it has the most work involved in its creation and there is the most challenging obstacle to an attacker.

Attacks

There are a variety of ways Bitcoin might be attacked:

Tradeoffs

Advantages

Disadvantages

It should be noted that those parties pursuing "private" or closed blockchain alternatives to Bitcoin get none of the advantages, but must suffer many of the disadvantages.

last update 2017-03-07