introduction to digital currency

Many abbreviations/assumptions in explanations that follow as these are merely intended as fast notes related to building up a digital currency system. Any comments/suggestions appreciated. Submit to @arthurcolle on FB/TWTR/GOOGmail

Imagine cash as a text file. For 1. below, imagine that I send you 1token.txt which just has the contents "[1token]"

1. System - dollars as text files 

file contents - [1token] 

(problem: copying file means you now have more cash. No way of identifying who is the intended recipient, which may be a desired feature)

2. System - dollars as text files with sender/recipient 

file contents - [arthur sends barbie 1token] 

(problem: interpretation of duplicates - same as 1)

3. System - dollars as text files with timestamp 

file contents - [arthur sends barbie 1token @ 12:01am] 

(problem: interpretation of duplicates - same as 1)

4. System - dollars as text files with timestamp and random id 

file contents - [arthur sends barbie 1token @ 12:01am ~ xIijUhJKas] 

(problem: interpretation of duplicates - same as 1, but also, how to verify current balance of sender?)

Need way of authenticating the sender's balance!

 Network as central bank - all participants help in verification process. Broadcast transactions to participants, which get bundled into "transaction blocks" whereby the individual constituent transactions are verified (does sender have enough tokens? is recipient a valid address? ... ). Instead of having a verification process where you arranged for some percentage of network participants (just computers running some client-server software that can relay data/transaction info to others in the network) - say 75% of all participants say "yup this tx is legit" you instead randomize the process of verification in order to avoid having someone flood the network with fraudulent verifications. 

This randomization process is called Proof of Work, where an easily verifiable (yet ultimately somewhat arbitrary) computation is undertaken by participants. The first to correctly solve and broadcast the correct solution to the computation is rewarded some fixed quantity of currency, which gives us a way to issue new currency in the proposed system.

The proof of work algorithm is roughly described below:

Currency protocol has a predefined number called the nonce (lets say nonce is 7).

You take the bundle of transactions (just a binary blob of zeroes and ones after all) and then set a variable x = 0.

You solve for a value of x such that the concatenation of (x || transaction-bundle-blob) has an output hash* (another blob of 0s and 1s) that has at least 7 leading zeroes (where 7 corresponds to the aforementioned current value of the currency network protocol's nonce. This nonce is called the current difficulty). After some period of time, you increase the nonce in order to make it more difficult to verify transactions, since you want to eventually have a fixed supply of currency in order to maintain the currency tokens' value in the face of inflation.

(*) output hash: in the bitcoin protocol, this is actually the double-sha256 hash of the (x || transaction-bundle-blob), so sha256hash(sha256hash( x || transaction-bundle-blob)