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
      在这里插入图片描述
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值