BTC wallet add node
a person signed by Nakamoto Tsui has put forward a revolutionary idea: let's create a currency that is not controlled by the government or anyone else! This idea is crazy: there is no asset support behind a string of figures, and no one is responsible for it. How can anyone accept it when you pay it to the other party as money
Merkle tree
looks like a binary tree, but this is the lower two nodes. Take the hash value to get the upper node. Just remember the root node to detect whether the whole tree has been tampered
the root hash value is stored in the block header, and the transaction process is stored in the block body. All nodes include block header and block body, but light nodes (such as bitcoin wallets on mobile phones) only include block header. This tree can prove that a transaction has been written into the blockchain
3. Consensus agreement
two issues should be paid attention to in decentralized currency:
1. Who can issue digital currency: mining
2. How to verify the legitimacy of transactions: blockchain
double spending attack
double spending attack is a major challenge of digital currency
all transactions in bitcoin have input and output. Where does bitcoin come from and where does it go
under normal circumstances, there may be two bifurcations, because two nodes obtain the bookkeeping right at the same time, and the two nodes package the block and calculate the random number at the same time. At this time, the two bifurcations will coexist temporarily until one of the blocks finds the next block first, which becomes the longest legal chain, and the other one is discarded<
Sybil attack
a malicious node keeps generating accounts. If the total number of accounts exceeds half of the total accounts, it obtains the control of the blockchain
consensus protocol in bitcoin
some nodes are malicious, and most nodes are good
idea 1: pack some transactions into blocks as candidate blocks, let each block vote, and write them into the blockchain if they pass
No, because some malicious nodes have been publishing blocks containing malicious transactions, and they have been voting and occupying resources. And some nodes don't vote<
idea 2: vote not by the number of accounts, but by computing power. Each node can generate legal transactions and put them into the block. These nodes start to try random numbers until H (block header) ≤ target is found, then this node has the right to account
the only way to generate bitcoin
coinbase transaction. There is no need to point out the source of the currency. If you have the bookkeeping right, you will get a reward< br />
50BTC-> 25BTC-> 12.5btc, the reward will be halved for every 210000 bitcoins
the process of bitcoin competing for bookkeeping rights is called mining. The node competing for bookkeeping right is called miner.
bitcoin is a kind of point-to-point e-cash system, more directly, node to node. Each transaction is broadcast by the originator to the nodes around it, and then broadcast to the nodes around it after receiving it, and finally spread to the whole network
every bitcoin wallet is a node, and the node with a complete blockchain ledger is called the whole node. In October 2017, there were about 9300 nodes in the bitcoin network, which were responsible for broadcasting and verifying bitcoin transfer transactions. After the transfer transaction occurs, all nodes broadcast to the whole network. After the mining node verifies that the transaction is correct, it will be recorded in the blockchain ledger. The United States, Germany and France have the largest number of bitcoin nodes, with China accounting for about 5% of the world's total nodes Data source: bitcodes. 21. CO) running bitcoin node does not provide any reward, and it does not need the whole node to transfer bitcoin, so the total number of bitcoin nodes only accounts for a small part of the node number.
legal representative: Guanke
time of establishment: January 15, 2018
registered capital: RMB 1 million
Business Registration No.: 440300203475003
enterprise type: limited liability company
address: room 5001, 5th floor, building 2, Yongxin Times Square, Dongbin Road, Nanshan street, Nanshan District, Shenzhen City
this doesn't need to be imported. You may be talking about recharging bitcoin into blockchain.info wallet. It will automatically generate bitcoin address, and you can directly transfer bitcoin to this address. It's best to use email authentication. Back it up to prevent the loss of the secret key.
In addition to the complete implementation of bitcoin's core protocol, bitcoin node software also includes an optional but important function mole -- Wallet:
you can regard the wallet as a safe to store all your keys and addresses, and also encapsulate many technical concepts and details of bitcoin, So that it can be understood and accepted by people other than geeks. Therefore, bitcoin enables node wallet by default. If you want to disable the wallet function, for example, you can set the disablewallet option in the configuration file:
disablewallet = 1
the wallet mole will track all address related transactions managed by it, so it can update the balance information of the wallet in time. This function is very important because there is no concept of account in bitcoin. Bitcoin is e-cash scattered among transactions. If there is no wallet to help track transactions related to our address, it is difficult to figure out how many bitcoins we hold in total
Many RPC calls provided bynodes are implemented by wallet mole. For example, when we call the getnewaddress command, the wallet mole generates the key and address and automatically adds them to the wallet, so its related transactions will automatically affect the balance of the wallet. Similarly, when we call getbalance, the wallet mole will collect the bitcoin on all addresses and return the total amount
the above content is extracted from: bitcoin development course