Yet Another “How Bitcoin Works” Note
This note concentrates on the logical structure of the “bank books” that include proof of financial actions of Bitcoin owners.
There is no central bank for Bitcoin—only a distributed set of mutually suspicious bookkeepers of the “bank books” which is called the block-chain.
The bookkeepers have an incentive to check each other.
Glossary
- Satochi
- 10−8 Bitcoins
- value
- some non-negative number of satochies.
- older
- a transitive relation among transactions whose meaning will emerge.
- block
- sporadic “bank” report.
It is a list of sequentially newer “checked” transactions.
- checked
- said of a transaction that is in a block in the blockchain.
- the blockchain
- a chronological simple ordering of blocks.
- transaction
- an array of inputs and an array of outputs.
- input
- a reference to an output in some older transaction that has not already been claimed.
The input must provide a ‘script’ which usually includes evidence that this input was provided by the recipient indicated in the output.
More generally the script provides information, including signatures, to pass the challenge provided in the indicated output.
If the challenge is met that output is thereby claimed.
- output
- an amount and usually a designation of a recipient of funds but more generally a script setting a challenge which must be met for the amount to be claimed.
- hash
- A cryptographically secure hash.
- Link
- The secure hash of an older block.
If you understand the clauses beginning “usually” you will know as much about this aspect of Bitcoin as all but a very few.
The Content of a Bitcoin Transaction
We name the parts of a transaction and give them suggestive names which fail to describe their function well.
- There is a digital signature S for each input.
- There is an array of one or more outputs.
Output i specifies a value Vi and a public key Ti.
(See “TxOut” here.)
- There are one or more inputs.
In each input includes a hash of an older transaction and an index into the output array of that older transaction.
This transaction is said to claim that older output.
- There is a transaction fee value.
For a transaction to become part of a block in the blockchain, the following checkable rules must hold for each input I of the transaction:
- The hash in I must be the hash of some older transaction J in the blockchain.
The indexed output X in J must hold the public key corresponding to the private key that formed S, or otherwise pass the challenge of the output.
- No other transaction between J and the current transaction may claim X.
- The sum of the claimed values must equal or exceed the sum of the outputs values plus the transaction fee value.
There is one degenerate transaction in a block with no signature, inputs or transaction fee but with one output.
The value is the sum of the transaction fees within the same block.
It is the bookkeeper’s booty and the bookkeeper chooses the public key as the block is completed.
Today there is also a transaction claiming the value of the “found coins”.
This is why today’s bookkeepers are called miners.
Where the Money Is
When there is some transaction T appearing in a block of “the blockchain”, and one of the outputs thereof holds a public key, along with a value, and no transaction in the block-chain before T claims that output (satisfies these rules), then anyone who knows the private key corresponding to the public key of the output is the beneficial owner of that value.
The Life Cycle of a Transaction
A person owns some bitcoin when he alone knows the private key that matches the public key in an output of some transaction in a block in the blockchain, and that output is not claimed by an input field of some older transaction in the blockchain.
That person is in a position to create and sign a new transaction nominating a different public key thus transferring authority over some value to whomever knows the private key matching the new public key.
After forming this transaction he can show it to the payee who is in a position to check all of the preconditions to validity except for the existence of some other new transaction that has not made its way into the blockchain.
There is a race with such possible competitor transactions and the payee has an incentive to deliver the transaction to those (yet mysterious) keepers of the blockchain.
The Keepers of the Blockchain
It will emerge that the blockchain is very public, but new transactions take time to circulate and the keepers must learn of them and have access to the consensus blockchain.
It is easiest to imagine a single keeper but then note that he has no natural monopoly.
nexus