BTC

  1. Bitcoin creation
  2. From mining
  3. dig
  4. Verify transactions + solve math problems
  5. Issuance and settlement of BTC (Mining award –> issuance of BTC, verification trade –> settlement)
  6. Bitcoin protocol
  7. The difficulty is dynamically adjusted and stabilizes at an average of 10 minutes per block
  8. The total amount is fixed at 21 million BTC
  9. Halve the amount of BTC awarded for mining every four years
  10. Characteristics of Bitcoin

  1. Bitcoin network
  2. Purpose: To propagate transaction blocks to each node in a P2P network
  3. Bitcoin Client (Wallet APP)
  4. Full client (full node — all Bitcoin transactions, user wallet)
  5. Lightweight client (relying on third parties for transaction verification, etc.)
  6. Online client (fully dependent on third parties)
  7. Most wallet applications are lightweight, saving only utXOs in the current wallet
  8. The wallet application can receive the new transaction transmitted in the P2P network, or create a new transaction and send it to the P2P network, which can be obtained and transmitted by all the participating nodes (clients) in the P2P network
  9. Bitcoin wallet
  10. It must be protected by a password (private key) known only to the user
  11. The password must be complex. If stolen, BTC can be easily transferred to currencies around the world
  12. Bitcoin client use
  13. The client will automatically create: wallet, Bitcoin address (can be multiple addresses, anyone can transfer bitcoin to this address)
  14. A wallet can correspond to multiple addresses (1: N, where transactions are associated with the same wallet)
  15. The newly created wallet is empty, without Bitcoin
  16. The acquisition of the first Bitcoin
  17. Offline — private transactions between friends
  18. Online – Sell personal skills in exchange
  19. Online — exchange purchase
  20. Online – Open an account in the currency market
  21. Bitcoin transactions
  22. Wallet generated randomly –> private key + Bitcoin address
  23. Not trading bitcoin address only know themselves, in the bitcoin ledger (chain) is not found, only the transaction will be “on the chain”, can query the balance, will be known by the whole network of users
  24. Under the table:
  25. A provides his BTC address and 100 USD, B queries the exchange rate between BTC and USD, and then transfers the corresponding number of BTC to the Abtc address
  26. B opens the BTC transaction software (website), enters A’s BTC address and corresponding BTC quantity, and sends it
  27. The transaction was signed using B’s private key, which immediately generated A transaction, broadcast the entire network, and A’s BTC address became publicly known for the first time
  28. After the transaction is completed, there is no on-chain. BTC will be confirmed only after the “miner” has packaged all the transactions in the period into a block “block”. Otherwise, it will remain in the “unconfirmed” state. Confirmed transactions can be considered “trusted”. Only BTCS in confirmed transactions can be used.
  29. Bitcoin balance query
  30. With UTXO there is balance, without UTXO there is no balance
  31. After the transaction, there will be output. If there is output without phone fee, then the wallet still has BTC to continue to use, and utXO will be output
  32. Therefore, before creating a new transaction, you must first check whether the UTXO of the current wallet meets the condition (BTC enough or not), either from the UTXO copy of the local wallet application or from the blockchain network (Bitcoin network)
  33. Trade creation
  34. Bitcoin does not need to connect to the bitcoin network to create a transaction, only to execute the transaction
  35. Create transaction input:
  36. It will check whether a single UTXO meets the payment. If not, it will check other “loose change” UTXO to pay together
  37. Create trade output:
  38. If the input is greater than the BTC to be paid, the output of the transaction is divided into two parts
  39. Pay part, output a script (only the receiver’s key can be unblocked utXO, can be controlled by it)
  40. The rest (to their own BTC address, also only their own key can be unblocked UTXO)
  41. With the transaction fee, the mining union priority packaging, will be more probability of success
  42. Transaction propagation
  43. dig
  44. Miners are nodes in the Bitcoin network that also download the mining application?
  45. When a miner receives all the transactions since the last block, they are placed in a temporary, unverified “trade pool” local to the node, from which they are added to the block as new blocks are built.
  46. When adding transactions to a new block, transaction fees are prioritized from highest to lowest, and transactions are packaged in direct proportion to transaction fees
  47. When miners receive a new block from the Bitcoin network, they will realize that they have lost the competition and immediately enter the competition for the next block. They will construct the new block using the fingerprint of the previous new block + the transaction received by their own nodes as the input of the next block
  48. Miners add a special transaction to the blocks they build: they transfer 25BTC to their own Bitcoin address, and some join a mining alliance, which in this case is the BTC address of the entire alliance. When a block is successfully packaged and added to the public chain, it is awarded this reward, which the members of the consortium divide according to their work.
  49. When the miners to mine, will be the new block to the Bitcoin network to notify everyone, everyone after verification (other nodes how to verify), and then the new block competition
  50. How to understand the further, the more credibility increases? How does the new block relate to the amount of work done on the previous block?
  51. Bitcoin data structure
  52. Bitcoin ownership
  53. Necessary factors: digital key, Bitcoin address, digital signature
  54. Digital keys are wallets, which are generated by users and do not exist on the network, but in files or small databases. The key can only be known and kept by the user, independent of the Bitcoin network, so that the user has the ownership of their own Bitcoin assets. Unlike traditional bank card passwords, they are stored in the bank’s database and not only known by the user. If the user forgets the key, it can never be retrieved, and their bitcoin is lost forever
  55. Every BTC transaction requires a valid digital signature to be stored on the blockchain
  56. How are Bitcoin addresses created? What’s the relationship with the public key?
  57. The key
  58. Public key Encryption, key pair, public key, and private key
  59. The private key is a randomly generated 256-bit binary number
  60. A key can be used to generate a public key
  61. Can be used to generate a digital signature for a transaction
  62. Generate the private key
  63. Page 46 bitcoinbook. Info/wp – the content /…
  64. Private key Generates public key
  65. What private key generates public key functions that can be directly called for programming?
  66. The public key generates the bitcoin address
  67. The input is the public key, and the output is the BTC address, a string starting with “1”
  68. Bitcoin wallet
  69. A wallet is a container for the private key
  70. Seed? Seed generates the child private key
  71. There is a key pair (private key + public key) in the wallet.
  72. Seed wallets??
  73. HD Wallet (Layered Deterministic Wallet)
  74. HD purse: www.5bite.com/post/799.ht…
  75. At first glance, the term “hierarchical determinism” may seem “fancy”, and various documents describe it as “foggy”, but the principle itself is very simple, and can be explained in two sentences:
  76. First, a random number is used to generate the master (root) private key, just like any bitcoin wallet generates any private key. Then, a deterministic and irreversible algorithm is used to generate any number of child private keys based on the master private key.
  77. What are the functions of the public and private keys of a wallet?
- The most simple and straightforward understanding, can be understood as a "private key" password, "public key" as a card number, and "wallet" is our bank card in the blockchain world! - link: [https://www.jianshu.com/p/7070b710015a] (https://www.jianshu.com/p/7070b710015a)Copy the code
  1. The relationship between the private key, public key, and wallet addresses
  2. www.jianshu.com/p/23e42860e…
  3. The data included in the transaction: receiver address, transfer amount, payer’s signature, payer’s public key
  4. What are the functions of the payer’s signature and the payer’s public key?
  5. How does a public key verify a signature?
  6. Since the private key can generate a public key (one to one), seeing the public key can tell that it has the corresponding private key, which can be easily verified based on cryptography. But the private key is invisible, because there is no way to derive the private key from the public key. That way I can keep my private key safe and prove that I own it.
  7. Bitcoin transactions
  8. Does the first received node validate the transaction? A successful transaction message will be returned to the user and broadcast to other nodes connected to the blockchain network for verification. If the authentication fails, a transaction failure message is returned to the user and the transaction is rejected.
  9. The propagation of transactions in p2p networks
  10. Transaction data structure
  11. Bitcoin balance concept
  12. Transactions are created from UTXO
  13. The BTC address of the payment account is calculated by the private key of the payment account. So the transaction signature, the need to use the private key for verification, is again using the private key to generate the same calculation results of the BTC address to compare the BTC address??
  14. Transaction output structure
  15. Transaction input structure
  16. Transaction fee
  17. The input and output of transactions
  18. Each transaction takes at least one input and produces at least one output, and each transaction input can be traced back to the previous UTXO up to the initial mining proceeds. A Bitcoin transaction created from the proceeds of mining is the first transaction in each block. Also known as a Coinbase transaction, it is created by miners and does not output the previous transaction.
  19. UTXO:
  20. Lock script:OP_DUP OP_HASH160<pubKeyHash>OP_EQUALVERIFY OP_CHECKSIG
  21. pubKeyHash = ripemd160(sha256(pubKey))
  22. The unlock script verifies that UTXO belongs to you and includes your digital signature and your public key. Sign with a private key, and the public key validates the signature.
  23. Verify UTXO ownership:
  24. OP_DUP OP_HASH160* * * *OP_EQUALVERIFY OP_CHECKSIG

  25. Transaction process:

  26. P2P network node
  27. Each Bitcoin node is a set of features: routing, blockchain database, mining, wallet services.
  28. Classification:
  29. Full node: wallet + miner + complete blockchain + network routing node

  30. 六四运动