Skip to content

Blockchain Anatomy

Hunter Yavitz edited this page Jul 7, 2023 · 2 revisions

Overview

A block transaction is the act of adding a block to the blockchain. This will contain some collection of orders which represent the chain of custody for some item or service type.

The process of adding a block to the blockchain is managed by the back end.

Components

components

Behaviors

Front End

UI

Admin Panel

Merchant Portal

Mobile Client

Back End

Blockchain

Block Transaction


The block transaction represents the block to be added to the blockchain.

The block transaction has the following properties:

block-transaction

ID Block Transaction


The ID is the unique identifier for the block transaction.

Index


The index represents the position of the block transaction in the blockchain.

Timestamp Block Transaction


The timestamp marks the date and time of the block creation.

Previous Hash


The previous hash holds the hash value of the previous block transaction.

Hash


The hash value is the hash functional output of the following block properties:

Payload


The payload holds the data to be stored to the blockchain.

The payload has the following properties:

block-payload

ID Payload


The ID is the unique identifier for the payload.

Timestamp Payload


The timestamp marks the date and time of the payload creation.

Data


The data holds the order list to be stored to the blockchain.

The data has the following properties:

block-data

ID Data


The ID is the unique identifier for the data.

Timestamp Data


The timestamp marks the date and time of the data creation.

Order


The order is a collection of items and / or services to be stored to the blockchain.

The order has the following properties:

block-order

Item


The item represents some item type, such as inventory, retail, or wholesale.

The item has the following properties:

block-item

Service

The service represents some service type, such as clean up, construction, or delivery.

The service has the following properties:


block-service

Block


Example of a block transaction

See block transaction for more detail.

   {
      "id": 1,
      "index": 1,
      "previousHash": "abc-123-xyz",
      "hash": "abc-123-xyz",
      "timeStamp": "2023-05-28 12:00:00",
      "payload": {
         "id": 10,
         "timeStamp": "2023-05-27 12:00:00",
         "data": {
            "id": 100
            "orders": [
               {
                  "id": 1000,
                  "type": "PURCHASE",
                  "items": [
                     {
                        "id": 10000,
                        "name": "widget",
                        "description": "really neat widget",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 20000,
                        "name": "thingy",
                        "description": "really cool thingy",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 30000,
                        "name": "stuff",
                        "description": "really awesome stuff",
                        "price": 1000,
                        "quantity": 10,
                        "status": "back ordered"
                     }
                  ],
                  "services": [
                     {
                        "id": 40000,
                        "name": "great service",
                        "description": "really great service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 50000,
                        "name": "good service",
                        "description": "really good service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 60000,
                        "name": "fun service",
                        "description": "really fun service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "discounted"
                     },
                  ],
                  "timeStamp": "2023-05-29 12:00:00",
                  "status": "pending",
                  "itemsTotal": 30000,
                  "servicesTotal": 30000,
                  "total": 60000
               },
               {
                  "id": 2000,
                  "type": "PURCHASE",
                  "items": [
                     {
                        "id": 10000,
                        "name": "widget",
                        "description": "really neat widget",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 20000,
                        "name": "thingy",
                        "description": "really cool thingy",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 30000,
                        "name": "stuff",
                        "description": "really awesome stuff",
                        "price": 1000,
                        "quantity": 10,
                        "status": "back ordered"
                     }
                  ],
                  "services": [
                     {
                        "id": 40000,
                        "name": "great service",
                        "description": "really great service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 50000,
                        "name": "good service",
                        "description": "really good service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 60000,
                        "name": "fun service",
                        "description": "really fun service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "discounted"
                     },
                  ],
                  "timeStamp": "2023-05-29 12:00:00",
                  "status": "pending",
                  "itemsTotal": 30000,
                  "servicesTotal": 30000,
                  "total": 60000
               },
               {
                  "id": 3000,
                  "type": "PURCHASE",
                  "items": [
                     {
                        "id": 10000,
                        "name": "widget",
                        "description": "really neat widget",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 20000,
                        "name": "thingy",
                        "description": "really cool thingy",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 30000,
                        "name": "stuff",
                        "description": "really awesome stuff",
                        "price": 1000,
                        "quantity": 10,
                        "status": "back ordered"
                     }
                  ],
                  "services": [
                     {
                        "id": 40000,
                        "name": "great service",
                        "description": "really great service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 50000,
                        "name": "good service",
                        "description": "really good service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "available"
                     },
                     {
                        "id": 60000,
                        "name": "fun service",
                        "description": "really fun service",
                        "price": 1000,
                        "quantity": 10,
                        "status": "discounted"
                     },
                  ],
                  "timeStamp": "2023-05-29 12:00:00",
                  "status": "pending",
                  "itemsTotal": 30000,
                  "servicesTotal": 30000,
                  "total": 60000
               }
            ],
            "messages": [],
            "references": [],
            "extra": []
         }
      }
   }

Chain of Custody