Smart Contracts on Blockchain

Intro

Application makes usage of blockchain's security mechanism to store and keep track of contracts insertion. Each contract insertion to the system leaves tracks to the contract that was inserted before. This mechanism prevents users from modifying contract that was inserted before current one.

Application features:

  • Flask back-end.
  • Pure HTML and CSS layout.
  • JavaScript elements.
  • Dynamic html template content with Flask variables and database queries.

Features

App includes following features:

  • Flask
  • CSS
  • HTML
  • ORM

Demo

Application:

  • Application uses blockchain infrastructure visualization.
  • We treat blocks within a blockchain as a single contract.
  • Each following contract is related with a previous one.
  • This kind of relation secures individual contract from being changed.
  • Change of one contract somwhere in the middle of chain would affect all of the contracts ahead of it.

Contract insertion:

Database:

  • We can see the structure of block table where the contract's previous_hash equals to contracts_so_fat_hashed of the preceding contract.
  • Column contracts_so_fat_hashed consists of all of the contracts info that were inserted so far.
  • The change of one contract inserted before would affect the values of contracts_so_fat_hashed for all contracts ahead.
  • This is one of security mechanizm of blockchain that prevents from undesirable data modification.

Setup

Python library installation required:

  • pip install flask
  • pip install flask-sqlalchemy
  • pip install flask-wtf

Source Code

You can view the source code: HERE