S1E3 : The Ðapps ~ Decentralized ApplicationsteemCreated with Sketch.

in #blockchain6 years ago (edited)

6.jpeg

Dear Steemians!

In past blogs we have already covered an introduction of Evolution of Block Chain technology, How it works and an Introduction to Ethereum, Smart Contracts.

Previous blogs S1E1 S1E2

As our whole series is focused on ethereum blockchain so in that direction further in this blog we will cover

1) Ðapps ~ Decentralized Application
2) How they work
3) Technology Stack of Ðapps

Before understanding Ðapps and it's working, we should understand how a webApp work?

A typical webApp landscape looks like below mentioned image

Presentation layer: This layer consist of application user interface typically a webpage or app.
Application layer: This layer holds the business logic.
Database Layer: This layer holds data structure to hold business data.

The traditional web application uses HTML, CSS and JavaScript to render a page. It will also need to grab details from a database utilizing an API. When you go onto Facebook, the page will call an API to grab your personal data and display them on the page.

Traditional websites: Front End → API → Database

1) Ðapps ~ Decentralized Application

Ðapps are similar to a conventional web application. The front end uses the exact same technology to render the page. The one critical difference is that instead of an API connecting to a Database, you have a Smart Contract connecting to a blockchain.

Ðapps enabled website: Front End → Smart Contract → Blockchain

A Ðapps has below major aspects
Front End & Hosting
Smart Contract & Deployment
Application data storage

Let me try to cover all these aspects with best of my understanding

Front End & Hosting
Front end of any app consists of web components like webpages, style sheets and JavaScript in shorts HTML, CSS and JavaScript.

Now in traditional scenario we buy space on a hosting server where we put all our files and access them using web browsers. Web browser renders the UI components on the screen and when we need additional data then a query is made to backend server (either hosted on same server or any cloud server like AWS) where business logic executes and fetch the results for the query, Results are sent back to browser in form of JSON format which is again render on browser.

The same principle is applied on a decentralized app if it holds a user interface, a true decentralized app should host it's UI part as well in distributed manner using IPFS or similar kind of blockchain but alternatively UI part can also be hosted on traditional webhosting server (even though it's a single point of failure)

In both cases a traditional browser like chrome should use web plugin's like metamask (or a local geth instance )and IPFS so that app can communicate with ethereum and ipfs blockchain network. we will discuss more on these tools in upcoming blogs.

For now just understand that for a Ðapps should be connected to ethereum (business logic execution ~smart contracts) and IPFS (for UI hosting and data storage) blockchains. If you want to explore more then you can refer the reference link at the end of this blog.

softwaremil.png

Before ending on the section I would like to give an overview of a service called infura which fills the infrastructure gap for developers so that Developer can focus on applications core features. For more details references are provided.
3.png

Smart Contract & Deployment
Smart Contracts is similar to business logic on application layer but here they are immutable, open source as they are deployed on ethereum blockchain. Contract functions can be invoked from Ðapps front end and there is a cost associated with each invocation as network treats each call as a transaction and does a proof of work for that. Smart Contract can generate events which can be received by front-end

Application data storage
Ethereum Blockchain is not meant for storing high value of data as well it is not economical to do so. It's referred as a global super computer which can run a Ðapps contract in a decentralized way. For data storage point of view one can use IPFS.

2) how they work?

Ðapps works in similar way like webapp but need some extra work to make it work like Ðapps should able connect to ethereum network for smart contract function invocation. To do so we have to either run a full ethereum node using geth or can use Chrome MetaMask extension or use INFURA.

3) Technology Stack of Ðapps

Front-end: HTML, CSS, JavaScript and JavaScript frameworks

Web3 API's: Connects front-end with Backend.

Smart Contract: Solidity, Serpent, Lisp

Remix: Remix is an online IDE that makes writing and debugging Solidity very easy.

Truffle: Truffle is a framework for compiling, migrating and testing contracts. It also can handle network management for deploying to different private and public networks.

4.1.png

Few Ðapps builds on Ethereum BlockChain

Decentraland : A virtual world owned by creators, powered by economic opportunity
CryptoKitties : Collect and breed digital cats
District0x : A collective of decentralized marketplaces and communities
Golem : a peer-to-peer market for putting your computer's excess CPU power to use for other people

Ref links
Cover Image image 2
What is a DApp?
Decentralized Applications-dapps
DAOs, DACs, DAs and More: An Incomplete Terminology Guide
How is hosting of a DApp done?
a fully decentralized Dapp in ethereum
Easy Way to Connect Your Dapp to IPFS and Ethereum
Getting started with INFURA

Hope this blog was informative for you. Do upvote, comment and resteem to keep it more interactive.

Follow me @devrajsinghrawat

ending_banner.gif

Stay tuned for upcoming series.

Sort:  

Coins mentioned in post:

CoinPrice (USD)📉 24h📉 7d
DNTdistrict0x0.068$4.21%-20.4%
ETHEthereum571.627$-5.36%-20.27%
GNTGolem0.466$-1.79%-12.08%
HTMLHTMLCOIN0.001$-5.75%-11.71%
MANADecentraland0.092$-3.97%-24.92%

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64498.18
ETH 3079.08
USDT 1.00
SBD 3.86