加密货币考试押题整理

散列hashing

  • 定义: Converts a digital object of arbitrary length, like a document, an image into a single string of fixed length, called a hash.
  • 性质:
    1. not continuous, two similar documents result in very different hashes;
    2. it is very hard to reverse engineer.
  • 什么是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.

比特币地址Bitcoin address

  • 定义:a bitcoin address is a string of 26-35 alphanumeric characters in Base58Check encoding, begining with the number 1 or 3.
  • 如何获取:
    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 = 10810^{-8}Bitcoin,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

  • 交易过程
    - origination--->bro
  • 交易的组成部分:
    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.

PoW

  • 目的: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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章