apart-0.1.3: Get all your structure and rip it apart.

Data.Apart.Usage.Blockchain

Synopsis

# Documentation

Simplified transaction type, no certificates/keys.

Constructors

 Transaction Fieldsfrom :: Account amount :: Tokens to :: Account

Block is just a bunch of transactions, no pointers/keys here.

type Blockchain = Scattered Stack Block (Connection, Table) Source #

Our blockchain type is distributed - we really don't want to keep all chain in memory, instead, we'll store balance table of all accounts in some database.

Let's suppose that genesis is a regular transaction, but proceeded from magic account 0 to real accounts.

Transaction 0 1000 1 :< Nothing

First real block, 1 sends 50 tokens to 4.

Transaction 1 50 4 :< Nothing

We're facing with increasing chain in memory, so, let's calculate UTXO for each account and put this information somewhere else.

Apart \$ block :< Converted ...

Verifying block is just a calculation UTXO for each account that trying to send money, so, we already have balance table and current block, the task becomes simple - just match transactions and balances.