# 1.5 Computational Methods

Computational thinking is a type of thinking used to figure out how a problem can be solved. The process of computational thinking can be summarised as formulating and thinking about a problem from such a perspective that it can be solved algorithmically and thus can be solves through the use of creating an algorithmic solution that can be reused on similar problems.

Using the five main computational methods subtitled in the sections below allows the creation of a computationally efficient and reusable solution.

* It is extremely hard to create a decentralised currency system based in the physical world, so hard in fact, that it's effectively impossible, this is why the solution is a purely digital one.
* Ownership certificates must be publicly available so that anyone can see who owns anything on the blockchain, this means that these certificates must be easily and always accessible, which is why they will be hosted digitally, and any node can request the data from any other node.

## Thinking Abstractly and Visualisation

Abstraction is a term used in computer science and computational thinking to refer to the process of removing unnecessary details from a problem in order to focus only on the core details that actually matter when creating a solution to that problem. Thinking abstractly is very important in blockchain design because each node may hold thousands of blocks in its storage and each block on a blockchain has the potential to hold thousands of transactions which may hold multiple data transfers. This means that any unnecessary data stored on the blockchain can be amplified massively in the final product.

It's also very important when designing the blockchain so as to remove a lot of the complications of an over-engineered and unnecessarily complicated development cycle and let you focus only on what actually matters so as to create a working and (hopefully) finished network.&#x20;

* The base transaction protocol, this needs to contain the main types of data transfer supported by the network, but attempting to solve for all possible types of transaction would be nearly impossible and would result in a lot of excess rules that would only be used in very very rare scenarios.
* Communication within nodes, it's important that this communication system ignores any excess bulk data that could be seen as useful but actually isn't that important. This is because as the system grows, the amount of inter-node communications increases exponentially (similar to the network effect).



![A diagram showcasing the network effect and how it affects the growth of communications within a system. Source - https://en.wikipedia.org/wiki/Network\_effect](https://1246399112-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0V1wzClHepgFxtDci3Tb%2Fuploads%2FlPXgCFpWkR5ZGlllsW38%2Fimage.png?alt=media\&token=0fa4d35c-0d49-4e46-930d-c1434bcd1364)

## Thinking Ahead

Thinking ahead is the computational method used to consider what requirements the problem's solution will required and how the current and early stages of the solution will need to build towards those requirements. Thinking ahead is important as it allows you to figure out roughly how the blockchain should look and the key features it needs to meet the problem identified. This is then also useful for figuring out what the approximate steps should be to reach this solution.

To ensure my project is finished in time and meets all of the requirements I have set myself in the [features of proposed solution](broken-reference) I will need to ensure that I plan how I'm going to meet all the requirements very early on, as everything in this project will be based upon a few concrete ideas that act as the foundations for the code and general protocol.&#x20;

An example of this is the consensus protocol, which is a very key point to how the blockchain functions and because the consensus protocol I have decided to use is designed by myself I have to figure out how I want the general process to work in order to implement this in the rest of the blockchain. [This can be seen in my bullet point summary of the original concept for Proof of Worth.](1.4a-features-of-proposed-solution/1.4.1-the-protocol/2.5.3.1-proof-of-worth-the-bullet-point-summary.)

## Thinking Procedurally and Decomposition

Decomposition is the process of splitting up a major, large and complex problem into lots of minor, little and simple problems that can be procedurally solved in order to build up to solving the major, large problem.

Procedural thinking is extremely important in blockchain design as the entire system is built upon a decompositional structure (The blockchain splits up into blocks which split into transactions, etc) and in order to build a blockchain system the structure must be built procedurally in order to ensure that each structure works with it's substructures.

During the design of the blockchain system, I will be focusing on individual aspects of the system itself, which should build together to make the whole blockchain work as required. The requirements for this system are defined in my [success criteria](1.5-success-criteria), with some specifics being defined technically in the[ Features of proposed Solution.](broken-reference)

## Thinking Logically

Logical thinking is used to understand and decide what inputs/conditions will create what outputs/outcomes. This is very important in blockchain design as if there are any logic errors it could mean that some transaction or block should be classified as invalid but is classified as valid (or vice-versa) could result in someone losing or gaining ownership of an item/currency that has real world worth when they shouldn't have.

* When a bad actor attempts to pass an invalid transaction or block as valid it should be identified and not added to the blockchain.
* When a transaction is requested it should be ensured it is valid and meets the current protocol or it could cause an issue for the user.
* When a node identifies an invalid item it should be classified as such and thrown away, rather than being allowed to stay in the system regardless of it's invalid status.

## Thinking Concurrently

When designing a blockchain, it is very important the software which runs it is designed to be able to handle multiple processes concurrently. This can be achieved either through the illusion of switching between many processes rapidly, which works in modern systems due to how fast the modern computer can complete the average program's requests; or can be achieved through multi-threaded programming.

For my system, there are two key components, and both require concurrent programming.

#### The web portal&#x20;

This can be concurrently programmed quite easily, as it is a website running purely on a frontend server so will just send the required code and files to the user's computer for them to execute, effectively running it concurrently on all systems that visit the site at the same time.

#### The Node Software

The node software will need to be able to process transactions being sent to it, answer incoming connection requests from other nodes and a bunch of other processes, all at once. The way this is solved is through creating the node software to work similarly to an api server, this means that every time any other node or service communicates with a node, it will generate a new thread to process this message and deal with it concurrently to any other processes.
