The theoretical basis of blockchain

The basics of money

  1. The nature of money
  • The carrier of value exchange
  • A medium of exchange
  • A tool for storing value and keeping accounts
  1. Development of money
  • Physical currency
  • Metal currency
  • Paper money
  • Electronic money
  • Digital currency
  1. Electronic money
  • The popular understanding of electronic money: the popular understanding of electronic money can be understood as the currency circulating in wechat, Alipay and other apps (I didn’t learn finance just to understand such a saying, sorry for the friends who study finance).
  • The characteristics of electronic money: it must correspond to real world paper money
  • Disadvantages of electronic money:
    • Centralized security problem: The account information is stored on one server (popular understanding). If a hacker hacked into this server to tamper with the account information, it will cause unpredictable security problems.)
    • Transaction authentication problem: It is difficult to verify that a transaction is authorized by the user
    • Double spending: As the name implies, the same amount of money is spent twice. For example, we have 100 yuan in our wechat wallet, and we go to a restaurant for dinner first. However, there is a bug in our wechat. This sum of money is not synchronized by the bank, but is still in the wallet, so we can go to a movie with the same 100 yuan.

Distributed ledger

Distributed ledger: Each node has a record of the ledger

Centralization and decentralization

! []

Further understanding of Bitcoin

  • Bitcoin doesn’t really exist. It’s a distributed ledger system.
  • There are many records of bitcoin in the general ledger system.
  • Each record is a record of a bitcoin transfer from one participant to another.

The hash function

  • Perceptual knowledge of hash functions
    • The hash function extracts the characteristics of the data
  • Characteristics of hash functions
    • One-way hash function: H(m) can be derived from m, but y=H (m) cannot be derived from m (from original text to ciphertext, but not from ciphertext)
      • You can think of some functions that you can take derivatives of, but you can’t integrate
      • Privacy can be protected with a one-way hash function (see privacy issues below)
  • Problem solved by the hash function
    • Privacy issues
      • Privacy issues can be resolved through one-way hash functions

    • Check for problems
      • If the hash values of two messages are the same, the two messages are equal. (Strong adversarial hash functions can be used to solve the captain problem)
  • Security of hash functions
    • The hash value for sha256 is 64 (64 hexadecimal books, 2^4^64 = 2^ 256), which means that there are 2^ 256 possibilities for the hash
    • The hash value for sha512 is 128 (128 hexadecimal books, 2^4^128 = 2^ 512), which means that there are 2^ 512 possibilities for the hash

    specialMD5 and SHA1 in hash algorithms are no longer secure hash algorithms and can be easily cracked

    • MD5 algorithm can be cracked 11 years ago by setting up a database of the original text and ciphertext. Most ciphertext can be queried in the database to obtain the original text
    • Sha1 was first cracked in 2017, when Google discovered that sha1 had its first hash collision. So H of m1 is equal to H of m2, but m1 factorial. = m2. But Google calculated that the collision would take 110 years for the GPU to run.

Creation of a wallet

  • After a person generates a private key, according to the private key generates an address, then this address is a person’s wallet. Through this address (wallet), he can trade