加密货币考试押题整理

   日期:2020-05-16     浏览:142    评论:0    
核心提示:散列hashing定义: Converts a digital object of arbitrary length, like a document, an image into a single string of fixed length, called a hash.性质:not continuous, two similar documents result in very different hashes;it is very hard to reverse engineer.区块链

文章目录

    • 1. 散列hashing
        • 1.1 定义
        • 1.2 性质:
        • 1.3 什么是SHA256和RIPEMD160
    • 2 比特币地址Bitcoin address
        • 2.1 定义
        • 2.2 如何获取比特币地址:
    • Merkle Tree
    • 比特币基础知识
    • 比特币编程语言——script
    • Wallets
    • 区块链的交易 transaction
    • UTXO
    • 分散共识Decentralized consensus
    • 拜占庭将军Byzantine Generals
        • 定义:看图
        • Byzantine faults
    • 数据库Database
        • ACID性质
        • 大数据库的挑战
        • Apache Cassandra
        • CAP理论
        • 比特币区块链与CAP
    • 比特币分叉
        • 内分叉Regular operations (or internal) fork
        • 软件分叉software fork:
          • 软分叉Soft fork:
          • 硬分叉Hard fork:
    • 其他加密货币
        • 以太坊Ethereum与DAO
    • 共识协议Consensus protocols
        • Proof of Work (PoW)
        • Proof of Stake (PoS)
        • Proof of Authority
        • 其他的一些turn-taking protocols
        • 对共识的攻击(Sybil,51%)
        • 51%攻击的三种形式(double-spend如何实现和避免)
    • money
          • 定义
          • 货币的种类Type of money
            • 代表货币与法定货币的区别
          • 货币的性质
          • 货币的价值
          • 货币的流动性
          • M0~M3
          • 如何发行货币issuing money
          • 货币政策Monetary policy
          • 通货膨胀 Inflation
          • 加密货币的货币功能
          • 加密货币的使用者
          • 为什么加密货币2017年非常火爆
          • 如何判断加密货币的价值
    • 如何进行融资——ICO
          • 一般获得融资的方式
          • 传统融资方式的弊端
          • 融资的新方式
          • ICO对投资者的检查
          • Howey Test
          • 3中发行ICO的方式
          • 发行ICO的5个步骤
          • 发行ICO的经典结构
          • ICO的风险
          • DAO被攻击的相关情况

1. 散列hashing

1.1 定义

Converts a digital object of arbitrary length, like a document, an image into a single string of fixed length, called a hash.

1.2 性质:

1. not continuous, two similar documents result in very different hashes;
2. it is very hard to reverse engineer.

1.3 什么是SHA256和RIPEMD160

1. SHA256 is a novel hash functions computed with 32-bit words;
2. RIPEMD160 has a 160-bit hash value so it is used for shorted hash.

2 比特币地址Bitcoin address

2.1 定义

a bitcoin address is a string of 26-35 alphanumeric characters in Base58Check encoding, begining with the number 1 or 3.

2.2 如何获取比特币地址:

1. it is a hash of a public key------>P2PKH(Pay-to-Public-Key-Hash)。
2. Public Key 经过 SHA256 + RIPEMD160 得到Public Key Hash, 再经过Base58Check Encode得到Bitcoin address。
3. it is the hash of a script------>P2SH(Pay-to-Script=Hash)。

Merkle Tree

  • 作用:To prove some transaction included in hash.
  • 提供:交易的hash+交易的merkle path+Merkle root的hash,即可证明。

比特币基础知识

  • 单位:1 satoshi = 1 0 − 8 10^{-8} 108Bitcoin,satoshi is smallest possible unit;
    1 MilliBit = 0.001Bitcoin = 100,000 satoshis
  • 比特币上限是固定的,有Almost 21 million BTC,2,099,999,997,690,000 satisgus
  • 在2140年全部挖掘,共13.4million blocks
  • 每十分钟出现一个新区快。每210,000个区块比特币的产出速率就会下降50%,目前是6.25bitcoin per block

比特币编程语言——script

  • 介绍:reverse-Polish notation stack-based execution language
  • 堆栈操作:
    1. Push:adds an item to the top of the stack;
    2. pop:removes the item at the top of the stack.
  • 优点:
    1. Not hardware dependent
    2. enables execution on devices with limited memory, like embedded devices
    3. it is stateless. No state prior to execution and no state saved after execution.
  • 不能循环的影响:Does not permit loops or complex program control features:
    1. This means predictable execution times
    2. precludes attacks
    3. no infinite loops
    4. not Turing-complete.

Wallets

  • 什么是钱包?
    1. Wallets is the primary user interface. Controls access to a user’s bitcoin; Manages keys and address; Tracks current balance; Enables creation and signing or transactions.
  • 钱包哪里?
    1. May be held on client machine or on an exchange.
  • 钱包的功能?
    1. Wallets is the primary user interface. Controls access to a user’s bitcoin; Manages keys and address; Tracks current balance; Enables creation and signing or transactions.
    2. Wallets can keep a copy of the transaction; Can query the chain when needed.
    3. Wallet also refers to the data structure used to store and manage a user’s keys and address.
  • 钱包在personal machine vs exchange
    Wallet on personal machine is a software program in which you store Bitcoin; Wallet on exchange let you convert ‘real money’ like US dollars to Bitcoin. You don’t have full control of this exchange wallet.

区块链的交易 transaction

  • 交易过程
  • 交易的组成部分:
    1. an amount of Bitcoin, denominated in satoshis;
    2. A locking script which needs intended recipient to provide something to redeem it.
  • 如何赎回locking的script?
    1. They provide their signature and a hash of their public key or a hash of a script
  • 根据赎回方式有五种交易标准:
    1. Pay-to-Public-Key-Hash(P2PKH):a hash of a specific public key is needed to redeem.
    2. Pay-to-Script-Hash(P2SH)
    3. Pay-to-Public-Key(P2PK):Mostly used in coinbase transactions
    4. Multiple-signature:limited to 15 keys
    5. Data Output: 40 bytes of non-payment data to a Transaction output.
  • 区块的第一笔交易basecoin trsansaction:
    定义:the bitcoin earnt by mining are awarded via the first transaction of each new block.
    性质:There are no UTXO inpus for these transaction.

UTXO

  • 什么是UTXO?
    Unspent Transaction Output (UTXO) is the output of a transaction which may be spent as an input in a subsequent transaction.
  • UTXO与交易什么关系?
    ‘Sending’ a recipient some bitcoin is done by creating some UTXO registered to their address.
  • UTXO的性质:
    1. All the UTXO of the system is known by every node, held in a database called UTXO set or UTXO pool.
    2. UTXO is locked to a specific address and may be scattered;
  • UTXO与wallet的关系:
    1. a wallet will aggregate the UTXO belonging to a single address.

分散共识Decentralized consensus

  • (节点如何验证一个交易)Independen verification of each trasaction, by every full node.
  • Independent aggregation of those transactions into new blocks by mining nodes together with demonstrated computation through a Proof-of-Work algorithm
  • (节点如何验证一个新块)Independent verification of the new blocks by every node and assembly into a chain
  • independent selection, by every node, of the chain with the most cumulative computation demonstrated through Proof-of-Word.

拜占庭将军Byzantine Generals

定义:看图

Byzantine faults

  • 定义:faults which appear different to different observes. A general sends different messages to different colleagues.
  • 对于区块链中,什么是Byzantine faults: a malicious node may send different blocks to different other nodes.
  • 什么是Byzantine Fault Tolerance: A system designed to withstand such attacks
  • 为什么比特币区块链可以做到Byzantine Fault Tolerance:
    1. Because it makes it costly to send false messages.
    2. Nodes have to do Work to have a block successfully included in chain.

数据库Database

ACID性质

大数据库的挑战

  • 有什么
    1. Relational database use SQL(Structured Query Language)
    2. Alternatives to relational databases is NoSQL databases
  • 不支持全部的ACID
    1. Usually Consistency is relaxed
    2. Inconsistencies resolved when data is read

Apache Cassandra

CAP理论

  • 什么是CAP:We have a design challenge for distributed databases, expresses by the CAP Theorem: Only two of the following 3 properties are possible to achieve simultaneously:
    1. Consistency of data
    2. Availability of data
    3. Partition-tolerance: how the data is stored or distributed
  • 这个理论对于分布式系统有什么指导意义?
    • Designers cannot forgo partition-tolerance, so much choose between Consistency or Availability.
    • choice will depend on the requirements of the domain:
      • if speed of response is not an issue, then choose Consistency;
      • if response needs to be immediate, then choose Availability.

比特币区块链与CAP

  • In bitcoin blockchain, the partition arises due to the P2P network.
  • Bitcoin block chain opts for Availability.
  • Consistency怎么办?:Has no master or central node to enforce Consistency
    • needs a consensus algorithm, for nodes to vote on the true state of the database ( the blockchain)
  • 比特币为什么不用使用simple majority voting
    1. Bicoin blockchain is open so cannot use simple majority voting;
    2. No way to ensure that a majority is present;
    3. No node has overall view of all other nodes;
    4. A majority could be manipulated, like Sybil attack
  • 为什么比特币最终连续:
    • The older a block is, the more work is required to change it;
    • The longest internal fork was 24 blocks in length
    • No transaction more than 5 hours old has been reversed.

比特币分叉

内分叉Regular operations (or internal) fork

  • 如何产生:The temporary existence of competing chains as miners process competing blocks
  • 如何消除:Resolved through consensus protocol

软件分叉software fork:

  • 如何产生: In open-source software projects, a fork is a new software project trajectory that starts from an earlier project.
软分叉Soft fork:
  • 产生原因:The new version of the software is backwards-compatible. So nodes do not need to adopt the new version of the software. In a block chain, nodes can still recognize new blocks even if they are running the old software version.
硬分叉Hard fork:
  • 产生原因:The new version is not backwards compatible. Every nodes needs to adopt the new version of the software to recognize new blocks.
  • 比特币的硬分叉产生了这些新的加密货币:

其他加密货币

以太坊Ethereum与DAO

共识协议Consensus protocols

Proof of Work (PoW)

  • 缺点
    1. Power usage
    2. Asics and dedicated clusters
    3. large miners & mining pools
  • 目的:Proof-of-Work is designed to create a hurdle to mining
  • 避免了什么问题(优点)
    1. nodes might spin-up multiple sock-puppet nodes to win the reward
    2. a form of Sybil attack
  • PoW的数学问题:Find the hash a specified object with a nonce parameter which is less than sum pre-specified total.
    对block header进行两次SHA256运算,得到的值小于目标值即可。
    block header:version+previous_block_hash+merkle_root+time+target_bits+nonce
  • 这个数学问题的特点
    1. Problem designed to be hard to do and easy to check
    2. Can only be solved by trial and error.
  • 哪些未记录的transaction可以进入candidate block
    1. Prioritized by age(how many blocks since the UTXO was recorded)
    2. Size of transaction(1 bitcoin, aged 1 day)

Proof of Stake (PoS)

  • PoS可能存在的问题
  • PoS的优点
    • PoS consumes less energy than PoW. PoS also actively penalizes dishonesty, deterring fraudulent behavior among validators.

Proof of Authority

  • 优点
    By harnessing the computing power of a vaster network of machines, PoA can handle faster transaction speeds with a much-reduced energy consumption.
  • 缺点
    PoA is still in its infancy and needs to prove its resilience through the early phases until network adoption gains traction.
  • 内容
  • 应用场合

其他的一些turn-taking protocols

  • PoET的优点
    • Node will rest, so more energy efficient
    • Trust Intel, require dedicated hardware
  • PoET的缺点
    Breaking a single piece of trusted hardware enables the attacker to always win the lottery. Both Sawtooth and REM argue that a statistical analysis of newly minted blocks suffices to detect whether a chip can be compromised. Second, the stale chip problem highlights that it is advantageous to collect chips as this increases the probability of minting a new block (i.e., every new chips is an additional lottery ticket).

对共识的攻击(Sybil,51%)

51%攻击的三种形式(double-spend如何实现和避免)


money

定义
  • Top-Down:money is whatever people accept in payment
  • Bottom-Up:Money is whatever people accept in payment
货币的种类Type of money
  1. Commodity money:Money whose value arises from the intrinsic value of the material used to make it, which typically a metal.
  2. Representative Money: Money whose value arises from an underlying commodity which it represents.
  3. Fait money:Money without any intrinsic value and without an underlying commodity. Its value arises from user acceptance
代表货币与法定货币的区别

Fiat money is physical money, like paper money and coins, while representative money is something that represents the intent to pay such as a check.

货币的性质


货币的价值
  • 人们的接受程度:if fiat currency, value depends on people’s willingness to accept it in payment
  • 基于人们的态度:depend on people’s attitudes to the government which issues it or to the monetary policies of the issuing authority.
  • 基于对通货膨胀的预期:if the people expect inflation, they may believe money will not keep its value.
货币的流动性
  • 定义:The speed and ease with which an asset can be turned into cash without lowering its price.
M0~M3
如何发行货币issuing money
  • In most countries, only a Central Bank owned by Government is allowed to issue money
  • Minting coins;Printing notes;Putting electronic deposits into accounts of commercial banks
货币政策Monetary policy
  • 货币政策的目的
    1. To keep inflation below a target threshold;
    2. To maximize employment
    3. To moderate long term interest rates
  • 如何影响货币数量
    1. by issuing money
    2. by requiring commercial banks to lodge security funds ar the central bank
    3. by setting base interest rates
    4. by Open-Market Operations(OMO), like buying and selling bonds which releases or withdraws money from economy.
通货膨胀 Inflation
  • 造成原因
    1. If banks issue too much money or make lending too easy, then there is more money available than goods to be purchased so the price of goods rises because demand for them exceeds supply. Therefore the average price of goods rises and we get inflation.
  • 超级通货膨胀Hyperinflation:When inflation rate exceeds 50%per month.
加密货币的货币功能
  • a medium of exchange
  • a common measure of value and a unit of account
  • a store of value
  • a means of anonymous payments
  • a means of deferred payments
  • 但是没有以下的功能:
  • Its usefulness for buying or selling real-world goods and services will be inversely proportional to its stability.
  • As a stone of value, a cryptocurrency may be particularly valuable for people moving assets across national borders.
加密货币的使用者
  • Criminals and people laundering money
  • Governments and people evading international sanctions
  • People in countries with capital export controls, hyperinflation or with high levels of corruption
  • Anyone having a need for money for any legal or illegal purpose
  • People purchasing the cryptocurrency to sell it later.
为什么加密货币2017年非常火爆
  • increased use by rogue states
  • Use of digital cryptocurrencies for some other application
  • A tipping point of users
  • copying others
  • Pump scams and Ponzi schemes: Scammer solicits investment in a fund, promising fast and high return. Then early investors receive returns paid from investments by later investors.
如何判断加密货币的价值
  • Is the supply fixed?
  • Can the supply be altered easily? new Bitcoins are issued according to an algorithm
  • Is the supply under the countrol of the community or of a smaller group?
  • 下面是需求方面的考虑:
  • Is there an underlying application that would create a demand?
  • If there is an underlying application, what is the demand likely to be ?
  • Is there any demand from investors
  • what are the prices of other, similar cryptocurrencies?

如何进行融资——ICO

一般获得融资的方式
  • Founders,Friends and Family
  • Angel investor
  • Government grants and loans
  • Commercial lenders
  • Venture Capital firms
  • Initial Public Offers
传统融资方式的弊端
  • issus a Prospectus: A document presenting the opportunity, the terms and conditions and the risks
  • Strict rules in most countries
  • May also be industry-specific regulators
融资的新方式
  • 传统的方式:Savers place deposits into banks, building societies, credit union and then banks aggregate the savings. Then lend larger amounts to borrowers.
  • Crowd funding: Aggregation done via a web-site or a crowd-funding service.Large number of investors invest a small amount each.
  • Peer-to-Peer lending:Lenders connect directly to borrowers.An intermediary may match borrowers and lenders.
  • ICO:presale of tokens.
ICO对投资者的检查
  • KYC:Know Your Customer regulation, like identity, location, wealth and assets and other investments.
  • AMY:Anti-Money Laundering:source of fund.
Howey Test
  • 用处:Under the Howey Test, a transaction is an investment contract for securities if four conditions are satisfied.
    1. It is an investment of money
    1. There is an expectation of profits from the investment
    1. The investment of money is in a common enterprise
    1. Any profit comes from the efforts of a promoter or third party.
3中发行ICO的方式

发行ICO的5个步骤

发行ICO的经典结构
  • A charitable foundation initials the ICO and receives the funds.
  • A software development first develops the idea and the white paper.
  • Foundation often registered in regulation-friendly jurisdictions like Swizerland,Gibraltar,Singapore
  • Software company registered elsewhere, like UK, USA
ICO的风险
  • Risk of any business investment. Investment may fail. Market demand may not be present. Scams and fraud.
  • Risks of investments in new technologies. Technology may move on. Shortage of skilled people. Competition may arise. Network effects and path dependence.
  • Risks particular to ICOs:
    • Tech is new and immature, and not yet well understood
    • Regulatory risks
    • May be a Ponzi scheme
    • Class-action suits by investors.
DAO被攻击的相关情况
  • 解释如何利用递归代码:The attack is a recursive calling vulnerability, where an attacker called the “split” function, and then calls the split function recursively inside of the split, thereby collecting ether many times over in a single transaction.
 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
更多>相关资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服