FDP-St-Joesph-Blockchain-DApps

Blockchain Technology & its Applications

Blockchain - Distributed Applications

What is Blockchain?

Blockchain Ledger is a data structure similar to linked list, every block is a container linked to each other cryptographically.
Blockchain Technology is a decentralized computation and distributed ledger platform to immutably store transactions in a verifiable manner efficiently, through rational decision making process among multiple parties in an open and public system.

What is DApp?

Decentralized Application (DApp) is a computer application that is deployed and gets executed on a Distributed system usually Blockchain or Distributed Ledger Technology. DApp is a set of Smart Contracts interfaced with a UI.
Some features of DApp as defined by the Ethereum

What is a Smart Contract?

Benefits of DApps

Implications of DApp

Core App and DApp Development Comparison

* Core App DApp
Code Centralized Server Distributed Systems like Blockchain
Model Trusted Trust-less
Implementation Scrutiny Required Very High Scrutiny
Time Faster Iteration Generally slower
Maintenance Easy Very hard
Tools Simple setup Difficult to set up. A tool stack necessary
Failure High Very Low
Transparency No to Very Less Completely Transparent (if Permissionless)
User Privacy No to Very Less High
Performance Less High

Sample DApp - Single Solidity Code

pragma solidity ^0.8.0;

contract SimpleDApp {
    address payable owner;
    mapping(address => uint) balances;

    constructor() public {
        owner = msg.sender;
    }

    function deposit() public payable {
        require(msg.value > 0, "Deposit amount must be greater than 0");
        balances[msg.sender] += msg.value;
    }

    function withdraw(uint amount) public {
        require(amount > 0, "Withdraw amount must be greater than 0");
        require(amount <= balances[msg.sender], "Insufficient funds");
        msg.sender.transfer(amount);
        balances[msg.sender] -= amount;
    }

    function getBalance() public view returns (uint) {
        return balances[msg.sender];
    }
}

Examples of DApps

Examples of DApps - Non-Ethereum