The idea behind smart contract (PART 3)

Joefitech
3 min readDec 14, 2022

--

The architecture of DApp

A background overview
In our last post we discussed the architecture of the centralized application, making use of the common blogging site @medium.

Today we’ll be focusing on DApps. Unlike centralized applications like medium and the rest, decentralized apps eliminate the middleman.

Instead, DApps leverage Blockchains to build apps on a decentralized state machine that is maintained by anonymous nodes.
To simplify things better, 'Nodes' are software that is used to reach blockchain consensus. We’ll create a post discussing nodes in the future.

A state machine is a machine that maintains some given program state and future status allowed on that machine.
Blockchain (i.e Ethereum) runs on a state machine that is instantiated with some genesis state and lay down strict rules (i.e consensus) that define how that state can transition.
***

One key thing to note is that no single entity controls this centralized state machine, it is collectively maintained by everyone in the network (in this case validators of the network)
So the state machine controls how the logic is run.

The backend structure

Now, instead of how medium backend was controlled, in DApps you can write smart contracts that define the logic of your application and deploy them into the decentralized state machines, that means every person who wants to build on the blockchain application deploys their code on shared state machine

The frontend structure: it stays pretty much the same, with some technical expectations though

The key architecture that runs a DApp

1. Blockchain: The Ethereum blockchain like we said in our previous post/thread, is a world computer- because it's globally accessible and runs on a deterministic state machine that is maintained by a (peer-to-peer) network of nodes. Every change that occurs on the state machine is governed by the rules of consensus that the individual peered nodes in their network follow. As a result, the machine isn't owned by a single entity but collectively ruined by everyone in the network.

2. Smart contract: As we've also seen in our previous post/thread a smart contract is a program that runs in the Ethereum blockchain & defines the logic behind the state changes happening on the blockchain. Smart contracts are written in High-level languages such as #Solidity and #Vyper

3. Ethereum Virtual Machine (EVM): EVM evacuates the logic behind the smart contract and processes the state changes that happen on the Ethereum network. EVM doesn’t understand HLL like 'Solidity' and 'Vyper' which are used to write smart contracts. Instead, what the developer does is to compile the high-level language down into Bytecode - which the EVM can execute

In conclusion, the role the frontend plays in everything, it provides the #UI logic, and it’s designed in such a way that the frontend connects with the application logic defined in the smart contract.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Joefitech
Joefitech

Written by Joefitech

Crypto and Defi research analyst || Defi/Blockchain Writer

No responses yet

Write a response