Skip to main content

Blockchain

Blockchain

  • append only ledger
  • peer 2 peer
  • block consist of record, hash, and previous block hash (forming chain)
  • to add block it need to be proven through proving mechanism (Consensus)
  • decentralized (anyone in the network have copy and have access to blockchain )

Economic POV

  • removing third party (bank, service instance that connect both parties)
  • anonymous transaction
    • Open
    • trustless
    • permissionless

Security

  • asymmetric Encryption (public, and private key)
  • it is really rare for duplicate public address

The system

Transaction Life Cycle

  1. Transaction is broadcasted by a node
  2. Transaction is placed on mempool, memory pool in bitcoin, EVM in ethereum.
  3. A miner that has solved a new block will choose a transaction to be placed in their block based on the transaction fee.
  4. When network reach a consensus on that block, the block is added to the blockchain. (50% of the network is accepting the block)

Consensus

  1. UploadProof of work (Bitcoin, eth)

    Untitled

    The “work” is “proven” by running computations to solve a puzzle—in the case of Bitcoin, generating a hash that matches a specific pattern—which when completed reveals the address of the block being mined. A new block is added to the blockchain only once the current puzzle has been solved, and a coin is generated. Succesful mining depend on hash rate, hash power, and difficulty. (for example, bitcoin revise its target hash every 2016 blocks to have lower hex number, hence it’s harder)

  2. Proof-of-Stake (eth 2.0)

    holders of a cryptocurrency “stake” their balances to gain voting rights and have a chance of being selected by the network to validate transactions.

  3. Byzantine Agreement (ripple, stellar)

  4. Proof of storage

  5. Proof of history

Scalability Problem

The scalability problem refers to the limited capability of the blockhain network to handle large amounts of transaction data, many networks have different solutions, including:

  1. SegWit → extending block size by separating witness data
  2. Lightning → creating payment channels so as not to burden the main chain (Layer 2 of Blockchain)
  3. Sharding (Ethereum 2.0) → splitting network into several smaller network, the downside of this feature is there is a possibility of shingle shard takeover attack, and its communication complexity.

Fork

A fork happens whenever a community makes a change to the blockchain’s protocol, or basic set of rules.

  1. Soft Fork → No need for every node to update
  2. Hard Fork → Every node needs to update their blockchain software,
  3. Contentious Hard Fork → Every node need to update but not everyone wanted to, so the what happen is a forking of an entire blockchain because differences in protocol. (BTC with BTH, ETH Classic Fork, etc) (-) Replay attacks, an attack that happen because every fork have same protocol so that one transaction in one of the network can be replicated in the second fork without any validation. In Progresscase of BTC and BTH, this is prevented with different transaction data in BTH.

Layer 2 Blockchain

  • Solution to solve many limitation of blockchain
  • Blockchain Trilemma parsial solution
  • sacrificing some aspect to boost different aspect

What Is a 'Layer 2 Blockchain,' and What Does It Mean? - Bestarion

Roll up

  • Rolling up multiple transaction into one

Side Chain

  • as the name says it serve as side chain that linked to parent chain

Plasma

Product Example

Omni Layer / Mastercoin

  • layer 2 infrastucture built on Bitcoin.
  • Providing smart contract capability
  • (-) Blockchain scaling and speed depended on Bitcoin
  • (-) Bitcoin is not designed for program execution.

Polygon for ETH

  • Interoperability of elements based on the previous and existing architecture of Ethereum

  • It is completely compatible with Ethereum

  • Higher performance with a transaction speed of up to 65,000 transactions per second

  • Provides multi-chain architecture for better scalability

    Pros

    • More secure due to the results of the validation system
    • Polygon is built to scale with the increasing volume of transactions
    • Provides a similar experience to that of Ethereum

    Cons

    • With developments in Ethereum 2.0, Polygon might not be required as the second layer

Ethereum

  • Use Ether instead of bitcoin. Not using UTXO protocol as in Bitcoin → Much faster.
  • Application-based blockchain transactions, use unit of account called ‘gas’, enable dev to run decentralized applications.
  • Large community support, main organizations : Ethereum foundation, EEA, Parity, ConsenSys
  • Merkle tree contains not only transaction, but also state of every account: nonce, balance, codeHash*, storageRoot*

New Mining Algorithm

  • Use memory hardness, not traditional GPU-CPU Proof of Work.
  • Memory is highly optimized so opportunity for optimizations is high.
  • Multi level deck instruction (????)

Use cases

  • ICOS, Initial currency offering can be conducted in more automated and secure fashion by utilizing smart contract. Ethereum smart contract platform is coupled with the ability to create tokens on top of Ethereum Blockchain.
  • Decentralized Autonomous Organizations, DAOs use cryptocurrency fundraising project to create a distributed governance system
  • DApps

Decentralized Application (DApps)

Decentralized Applications (DApps), an app that use backend using a smart contract. Benefit:

  • Immutability, no authority can change the code after published
  • Efficient and secure transfer of digital asset

Cons:

  • Not widely used
  • Not clear regulation.

Challenges

  • Deployment, dev need to be sure its code does not contain critical flaws, hard to update. Upgrading usually entails difficult data migration of the state that the smart management contract → can cause a break in user expreience.
  • Test using ethereum testnet, contracts must be audited by professional auditors.
  • Speed of Dapps relies on speed of blockchain, CryptoKitties, a game using blockchain, whose popularity led to an enermous number of transactions, congesting eth network. This made the dapp virtually unusable.

Block header in ethereum contain four trees:

Transactions: nonce, gasprice, startgas, to, value, data, (v,r,s).

Receipts: Intermediate state root, cumulative gas used.

State: nonce, balance, codeHash*, storageRoot*

Logs: Not accessed by contract, light client access to event record.

More reading:

The Inside Story of the CryptoKitties Congestion Crisis

DEVCON1: Understanding the Ethereum Blockchain Protocol - Vitalik Buterin

What is the Blockchain Trilemma? | Ledger

Everything you need to know about Ethereum Virtual Machine (EVM) | Analytics Steps

What is Web3 and why is it important? | ethereum.org

The Architecture of a Web 3.0 application

Decentralized Applications Architecture: Back End, Security and Design Patterns

Ethereum development documentation | ethereum.org

web3-from-zero

Blockchain | Wikiwand

What is Blockchain Technology? - IBM Blockchain | IBM