Siacoin/Sia — pull request #16 by DavidVorick (2014-02-16 03:24:25+00:00)
Title: Building out the Base

1. Added some documentation indicating the general flow of things in Sia

2. Build out the crypto functions, namely `crypto.Hash()` and `crypto.Random()`

3. Added a block struct. A block is very basic, it's just got some header data and then a list of heartbeats. This is all that a block needs, because a block is only a list of heartbeats from hosts. When the block is merged, the heartbeats will be ordered and merged one by one.

4. Added a framework for `IntegrateBlock()` and `verify()`

`IntegrateBlock()` will order the heartbeats and then process them one at a time. Some may contain invalid transactions or be invalid. These will be thrown out but the processing does not need to be restarted, as the ordering will be the same for every host in the blockchain, and the process is deterministic given a block.

`verify()` will walk through the steps of the concensus algorithm, verify that the block obeys all the rules.

In particular, and not mentioned in the comments, it will look at the 'graph' of the heartbeats, and see which hosts have acknowledged which other hosts, and it will make sure that the block does not violate any rules.

It will assume that individual heartbeats have already been verified, and will only be checking for rules that apply to the collection.

5. Updated the entropy functions to use the crypto libraries, changed a function name.

Also fleshed out the unit tests.

6. Created 'state.go', which houses the state function. I realize we probably have a bunch of conflicting definitions for the state across our different branches. I assume we'll merge these and remove the redundancy.