Computer Science 595/686 Home Page

The Bitcoin Core

CSC595/686-D: (The Real) Blockchain

by: burt rosenberg
at: university of miami

Lecture 3

The Audacity of Nope.

What is a Bitcoin? My first guess would be that Bitcoins would be some sort of data collected in the account of the account-holder. Since there are things called Bitcoin Wallets, that seemed to confirm an account-based view. However, this is not so.

The fundamental element of the Bitcoin system is a public, verifiable ledger of all transactions arranged in a chain of blocks of transactions. That is, the blockchain. The blockchain is secured by cryptography so that it is immutable, it is publicly verifiable in all its relevant facts, and agreed upon by all participants through distributed consensus.

Each transaction redistributes Bitcoins, in units of Satoshis (1/100,000,000 of a Bitcoin) from funders of the transaction to the transactions beneficiaries. The beneficiaries are named in the transactions outputs; the funders are the inputs to the transaction, and each input refers back to an output of a previous transaction. A Bitcoin is therefore an output of some transaction that has not yet been used to fund a later transaction. These are called UTXO's, Unspent Transaction Outputs.

The blockchain collects transactions into blocks, and the blocks are chained by a field requiring the hash of the block just prior in the chain. The transactions in a block are ordered by their position in a block. This consensus no not only what transactions have occurred, but in what order, is among the reasons for a blockchain. Double spending is avoided by checking the ledger for use of a transaction output in a transaction prior to that in which the spend is being attempted.

The transaction must also be authorized by the owner of the funding Bitcoins. Public key signatures are used to establish the permission. Each output to a transaction is paired with a public key script; and each input a signature script. The two scripts interlock so that only if the data of the public key script satisfies the requirements of the signature will the output be released for use.

We will return to the mechanics and the variety of scripts, but in the most common case, the public key script is simply the public key of the owner of the output. The signature script is the public key of the transaction signer and the signature with the public key on the hash of the transaction. The effect of running these as scripts is that, (1) the signer public key must equal the output transaction public key, and (2) the signature verifies. For multiple inputs, all inputs must verify in this way for the transaction to be valid.

Consensus.

The public ledger must be agreed upon by all participants, and be robust agains malfeasance. Among the participants, some are customers, creating transactions, and some are full nodes that verify the blockchain, and some, the miners, are the participants that add to the block chain. Each miner works on its own, collecting transactions that have been submitted to and flooded over the Bitcoin network, collects them into block, verifies the block, add the hash of the current head block, and submits this block for consideration by the network and the new head block of the chain.

All miners compete in this. Among all the correct candidates for the next block do all participants come to consensus, without any central authority, and under the threat of bad actors, about which block will be come next in the block chain? This coming to consensus was the most difficult problem Satoshi Nakamoto needed to solve.

And for the moment, we will skip the discussion of the solution. What we will presume instead is all miners are honest and among all proposed blocks, one gets randomly selected, fairly among all proposed blocks, and all miners know which is selected and no miner insists on the selection of another.

We skip this discussion to explain what motivates miners in this competition. The miner whose block is selected is rewarded with Bitcoin. There are two forms of rewards. The first is the Block Reward, which is a the very first transaction in the block; it is allowed to name a single output of an agreed upon amount, payable to whomever the miner wishes (normally itself), and need no input. This is the creation of new Bitcoin. These are called coinbase transactions, as the empty reference to a non-existent input is considered the reference to a primordial coinbase source. The coinbase reward was originally 50 Bitcoins, but it halves every 210,000 blocks.

The very first block, the genesis block, consisted of only a coinbase transaction, and was mined by Satoshi Nakamoto on January 3rd, 2009.

In approximately 2040, after the creation of 21 million Bitcoins by coinbase transactions, the block reward we go to zero, and no more Bitcoins were ever be created.

The second sort of reward to a miner for having its block selected, is the option transaction fee proposed in each transaction. The sum of Bitcoin values over the outputs must not exceed the sum of the Bitcoin values over the inputs. The transaction must be fully funded. But if there is a gap, the miner is free to claim that for itself but adding the sum of all such left over Bitcoins to the coinbase transaction. It is a transaction fee permitted to the miner. Note that miners choose which transactions to place in a block, and blocks are have maximum size. Market forces determine the transaction fee size that will entice the miner to include the transaction in a block.

The two methods of rewards work along different paths. One is inflationary and creates a fixed amount of bitcoin; the other takes a fee and is adjusted by market forces. Assuming that Bitcoin are valuable, it keeps miners mining, and therefore keeps completes the circle to keep Bitcoin valuable.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

author: burton rosenberg
created: 4 Feb 2019
update: 4 Feb 2019