World Conquest Chronicles

World Conquest Chronicles

go-blockchain, v1.4-alpha

The library that implements models and algorithms of blockchain.

Add to the block model the comparison for equality with another block; add to the storage the deleting of a block.

Change Log

  • models:
    • block:
      • operations:
        • comparison for equality with another block;
  • storages:
    • operations:
      • deleting a block;
      • deleting a block group (optional);
    • wrappers:
      • wrapper that adds support for deleting a block group to those storages that cannot do this.

Features

  • models:
    • block:
      • storing:
        • timestamp;
        • custom data;
        • hash;
        • previous hash;
      • operations:
        • creation (using a proofer);
        • getting merged data;
        • comparison for equality with another block;
        • self-validation (using a proofer);
    • genesis block:
      • based on a usual block without a previous hash;
    • block group:
      • storing:
        • group of blocks;
      • operations:
        • self-validation (using a proofer):
          • modes:
            • as a full blockchain;
            • as a blockchain chunk;
          • takes into account a prepended chunk;
          • allows empty block groups;
        • validation of the last block (using a proofer):
          • modes:
            • as a full blockchain;
            • as a blockchain chunk;
    • block group loaders:
      • loading block groups via the external interface;
      • automatically saving the loaded block groups to a storage;
      • wrappers:
        • chunk validating loader:
          • automatically validates the loaded block group as a blockchain chunk;
        • last block validating loader:
          • automatically validates the last block from the loaded block group;
          • automatically preloads the next block group to perform the above validation;
        • memoizing loader:
          • remembers loaded block groups;
          • restricts the quantity of the remembered block groups:
            • stores the loaded block groups in the LRU cache;
      • kinds:
        • memory loader:
          • loading blocks from the block group;
    • blockchain:
      • storing:
        • storage;
        • last block;
      • operations:
        • creation:
          • loading the last block from the storage;
          • when the storage is empty (optional):
            • creation a genesis block using a proofer;
            • storing the genesis block to the storage;
        • loading block groups from the storage;
        • adding a block:
          • creation a block using a proofer;
          • storing the block to the storage;
  • proofers:
    • operations:
      • block hashing;
      • block validation;
    • kinds:
      • proof of work:
        • based on the Hashcash algorithm;
        • additional storing in a block (in a hash actually):
          • nonce;
          • target bit;
  • storages:
    • operations:
      • loading block groups;
      • loading the last block;
      • storing a block;
      • storing a block group (optional);
      • deleting a block;
      • deleting a block group (optional);
    • wrappers:
      • wrapper that adds support for the following operations to those storages that cannot do them:
        • storing a block group;
        • deleting a block group;
    • kinds:
      • memory storage:
        • storing blocks in memory.

Repository

Link: https://github.com/thewizardplusplus/go-blockchain/tree/v1.4-alpha.

Content: code.

License: MIT.