Blockchain Nanodegree Notes 20181026

Term 1 S3 Lesson 1: Blockchain Data Overview

Blockchain vs Traditional Databases

Blockchain as a dataset - overview

  • Blockchain as a dataset?
  • traditional database characteristics
  • blockchain characteristics
  • Traditional Database vs Blockchain

Traditional Database Characteristics

  • Network - Centralized
  • Functions - Create, Read, Update, Delete (CRUD)
  • Mutability - mutable (can be updated after adding to the database)
  • Authorization - Centralized
  • Transparency - Low

Blockchain Characteristics

  • Network - Distributed
    • Pro: Control given to nodes
    • Con: Must achieve consensus
  • Functions - Read, append and validate
    • Pros: accurate historical record; faster read and write
    • Con: must achieve consensus
  • Mutability - Immutable
    • Pro: permanent historical record
    • Con: storage space
  • Authorization - Distributed
    • Pro: Extremely secure
    • Con: Cannot dispute transactions
  • Transparency - High
    • Pro: everyone has access
    • Con: No permission control

Do you need a blockchain?

Blockchain Questions Overview

  1. Do you need a database
  2. Does it require shared write access
  3. Will you need to create the trust between users
  4. Canyou operate without trusted 3rd parties
  5. Can you operate without control over permissions

(preview: 3 types of blockchains - public, private and hybrid)

Blockchain Types

  • public
  • private
  • hybrid: shared private network combined with not publicly available data

https://www.ibm.com/blogs/blockchain/2017/05/the-difference-between-public-and-private-blockchain/

https://hackernoon.com/3-popular-types-of-blockchains-you-need-to-know-7a5b98ee545a

Which type to use

Here are 3 questions to help you determine which type of blockchain is right for your situation.

  • Will transactions be public?
  • Will other companies need access to your data?
  • Should some information be public while other information is restricted?

P2P Network vs Client-Server Model Overview

Client Server Model

  • Client - makes requests
  • Server - responds to client

P2P network

network of computers that share access to files with each other

P vs C

  • Infrastructure: single server (corporations) vs collection of nodes (mining farms)
  • Cost: expensive vs cheap
  • Control: authority vs network
  • Security: high vs low
  • Stability: stable vs unstable

Explore Blockchain Data

Blockchain Explorer

https://blockexplorer.com/

Block - Block Header + Block Transactions

  • Block header: metadata about the block, including hash value
  • Block Transactions:
    • Coinbase (aka. first transaction)
    • input, output, fee, # of confirmations, # amount sent

Explore: Search block #

Explore blockchain data in JSON

Block header:

  • hash
  • confirmations
  • strippedsize
  • size
  • weight
  • height
  • version
  • versionHEX
  • merkleroot
  • tx (transaction hash values)
  • time
  • mediantime
  • nonce
  • bits
  • difficulty
  • chanwork
  • perviousblockhash

Block transactions:

  • txid

  • hash

  • vin

    "vin":[
        {
            "coinbase": "039ff1072...",
            "sequence": 3579139394
        }
    ],
    
  • vout (some are not shown)

    "vout":]{
        "value": 12.52201057
        "n": 0,
        "scriptPubKey":{"..."}
      	},{
      	"value": 0.00000000,
      	"n":1,
      	"scriptPubKey":{"..."}
    }
    

Raw data are just hex strings

Nonce是Number once的缩写,在密码学中Nonce是一个只被使用一次的任意或非重复的随机数值。在加密技术中的初始向量和加密散列函数都发挥着重要作用,在各类验证协议的通信应用中确保验证信息不被重复使用以对抗重放攻击(Replay Attack)

https://baike.baidu.com/item/Nonce/2525414?fr=aladdin

Practice Blockchain Data

see: https://github.com/xiaozhenliu/udacity-blockchain.git

Explore Bitcoin’s Codebase

https://github.com/bitcoin/bitcoin

  • Genesis Block: /src/chainparams.cpp, line 20
  • Original Timestamp: line 54
  • Other Variables

BIPs and Forks

  • Bitcoin Improvement Proposals: Technical documents used to issue changes to the bitcoin core client
    • Written by community members
    • Voted on by miners
    • Accepted or denied
    • Implemented by developers
  • Forks:
    • hardfork
    • softfork
    • source code fork
      Blockchain Nanodegree Notes 20181026_第1张图片

你可能感兴趣的:(BlockchainND,区块链)