
Produced | Odaily
Editor | Lu Xiaoming
Produced | Odaily
In 2008, a person named Satoshi Nakamoto published the paper "Bitcoin: A Peer-to-Peer Electronic Cash System" (The original text of the paper PDF version), which opened the curtain for Bitcoin to be popular all over the world.
The underlying blockchain technology of Bitcoin was also discovered later. Its technical characteristics such as decentralization, detraceability, and non-tampering can be applied to scenarios such as finance and traceability. Whether you want to understand blockchain or Bitcoin, we believe that Bitcoin, as the birthplace and first application of blockchain, is the first knowledge point you need to understand before getting started.
secondary title
1. Open an account
If you want to own Bitcoin, whether you buy it on an exchange or transfer it to you, you need a Bitcoin account. What materials do I need to bring to open a Bitcoin account, and which institution should I go to to open an account? No materials required, just download a bitcoin wallet.
Little knowledge: Bitcoin wallet is a relatively big topic. First of all, it must be clear that the digital currency wallet is not a real "wallet". , the wallet is just an application that allows you to open accounts, check balances and transfer funds. In fact, each currency, in theory, will be its own wallet. Therefore, most of the wallets on the market are easier to use, aggregate various currencies, or are more secure. There are also cold wallets, hot wallets, and managed wallets that are decentralized.
Can the blockchain wallet become the second Alipay?
Can the blockchain wallet become the second Alipay?(introduced in the first part of this article)
Blockchain 100 Question 38 | What is a Bitcoin wallet for?
Blockchain 100 Questions 39 | Cold wallet, hot wallet
Blockchain 100 Questions 40 | Full node wallet, light wallet(If all the ledger information is stored, it will become a full-node wallet. This article refers to the light wallet)
Using the light wallet on the chain can let you know more about some "anti-human" designs of Bitcoin's private keys, addresses, and mnemonics. Bitpie, imtoken, etc. are relatively old-fashioned wallets, and people with good English can even use Bitcoin's official wallet; a hosted wallet will be easier to use, but the private key is not kept by yourself.
After you have a Bitcoin wallet, all you need to do is move your fingers and open an account.
A Bitcoin account consists of a pair of keys (private key, public key). The account owner can use his private key to digitally sign, and use the public key to verify the signature. A public key can be generated from a private key, but a private key cannot be generated with a public key. This is the so-called "asymmetric encryption" (reference link:Blockchain 100 Questions 60 | What is an asymmetric encryption algorithm?). This is why Bitcoin is called a digital cryptocurrency, because the entire system relies on cryptography.
Little knowledge: What does the hash calculation mentioned here mean?
Hash calculation has the following characteristics:
1. Map data of arbitrary length to a large integer of fixed length;
2. After any change in the data, the calculated results are completely different;
3. The original data content cannot be deduced from the hash result.
There are many implementations of hash algorithms, such as the SHA-256 algorithm used by Bitcoin. The hash value is an integer expressed in hexadecimal; as long as the original content is slightly changed, the hash result will vary thousands of miles, so each time the original content is changed, the hash value obtained is equivalent to the 256th power from 1 to 2 Pick a number at random. In this way, others cannot deduce the public key through the account address. So you can safely tell others the address and accept the other party's transfer without worrying about the account being stolen. Unless you lost your private key yourself.
When you have your first Bitcoin account, you are happy; but at the same time you are frustrated because it is empty. How to make your wallet bulge?
You have the following ways to achieve this goal:
The strategic incubation cloud computing power platform "Suyitou" is officially launched to help investors "hold" BitcoinThe strategic incubation cloud computing power platform "Suyitou" is officially launched to help investors "hold" Bitcoin
2. Spend money on the exchange to buy, the specific operation can be found in this article "How to own the first bitcoin in life?". At present, the major exchanges commonly used by all of us are centralized platforms, and the security is not very high.Of course, there are also decentralized exchanges, but they are rarely used. Click the link to learn more.
secondary title
2 bookkeeping
Once you have a bitcoin account and bitcoins, you can transfer money between different accounts. The smallest unit of Bitcoin is 1 Satoshi, 1 Satoshi = 0.00000001btc. When we use Alipay to transfer money to others, the bank is actually responsible for deducting the amount from your account, adding it to the other party’s account, billing you, and collecting your processing fee.
The bitcoin transfer steps are similar, but without the role of a bank. So in the process of Bitcoin transfer, who will deduct the money and who will record the bill?
Different from the banking system, a decentralized bookkeeping method appears here: distributed ledger. That is, the ledger is no longer maintained by the banking system, but is jointly maintained by the participants. It simply means that everyone can participate in bookkeeping. Those who maintain the ledger are generally called nodes, also called miners.
In the blockchain, transactions are arranged in chronological order. A blockchain is a package of transactions. A block can be regarded as a page of ledger.
The bookkeeper of each page of the ledger (that is, the block producer of this block) must be selected through a competition in order to obtain the power of bookkeeping. After finishing this page of accounts, broadcast this page of accounts to everyone else. This process is called block generation, also known as "mining".
Others can verify these transactions through cryptography. As mentioned above, the account owner can use his private key to digitally sign, and use the public key to verify the signature. Other people involved in bookkeeping can synchronize the latest block/page of ledger and continue digging on it. At the same time, in the blockchain, each page of ledger (each hash) is interlocking, and the hash value of the previous block is recorded through the hash algorithm mentioned above.
In such a distributed system, each node independently maintains a complete transaction ledger, which is also called a "distributed ledger". It needs the approval of the majority of nodes every time, and no node can tamper with the ledger alone. Unless he obtains the consent of 51% of the nodes, he cannot succeed. This is the so-called 51% attack.
Any node exiting the network or going down will not affect the system operation. This method is more secure than a single-node centralized system. Nodes are distributed all over the world, and each node connects with nearby nodes to form a global P2P network. This is also the material basis for Bitcoin to circulate globally.
As mentioned in the previous section, if an account needs to know its own balance, it can be queried through the wallet.
But nodes only have complete ledger information, and wallets also need to query their own balance through nodes. So where is the node? I can't see it, I can't touch it, where can I find it? Fortunately, without you bothering to find a node, your "bitcoin wallet" will do it for you.
In fact, if the Bitcoin wallet wants to tell the node the transaction information, it must be connected to at least one node in the Bitcoin network. When connected to the node, the Bitcoin wallet itself becomes a node in the network, but it has Compared with a full node with a complete ledger, a wallet node is a "lightweight node" because it neither records a complete ledger nor "mines".
If you are curious, you still want to ask one more question: How does the Bitcoin wallet discover the node?
Quite simply, during the development of the Bitcoin network, there will be some long-term stable nodes called "seed nodes". When developing Bitcoin wallet software, the domain names of these "seed nodes" will be written into the code, and through DNS dynamic query, a list of active node addresses will be requested from the "seed nodes". Using these nodes as a medium, the Bitcoin wallet You can join the network.
For example, Mr.Chen transferred 0.05BTC to Miss.Lv through the Bitcoin wallet, and this transfer was recorded by the global Bitcoin network nodes through the "distributed ledger".
Transfer record: Mr. Chen -> Miss. Lv : 0.05btc Of course, the name will not be recorded like this, but the bitcoin account number of the two people, similar to:
1AC4fMwgY8j9onSbXEWeH6Zan8QGMSdmtA -> 1JWq3G8pqCo6jZGhLHpctYap5yVScqGxkv : 0.05btc
secondary title
3 Issuance/Mining
Since it is a currency, you will definitely ask, how did it come about in the first place?
This involves the issuance of Bitcoin.
Ordinary currencies are issued by an institution such as the central bank, but in Bitcoin, the generation of each block is accompanied by the generation of new coins (this is written in the program, don't ask me why). Whoever wins the bookkeeping right of this round of blocks will get the latest bitcoins.
A total of 21 million bitcoins have been issued. The block reward is initially 50 BTC, that is, every time a block is dug out, the miner will get 50 BTC. The system stipulates that every 210,000 blocks (about 4 years), the block reward will be reduced by half until it is as low as 1 Satoshi, the smallest unit of Bitcoin. Therefore, the block reward was adjusted to 25 BTC after 2012, 12.5 in 2016, and the next halving will be in 2020. This competition process is like digging new gold coins, so everyone will refer to them as mining, and call the ledger maintainers "miners".
Speaking of which, the incentive mechanism of Bitcoin has actually been involved, that is, why are nodes willing to waste resources to keep accounts?
secondary title
4 Consensus Mechanism: PoW
You know, now a bitcoin is worth 10,000 U.S. dollars, and the accounting node can get 12.5 bitcoins for one block. Doesn’t everyone want to mine?
In order to allow everyone to obtain the right to bookkeeping fairly, the Bitcoin system has designed a set of competition mechanisms.
The system requires competitors to guess a random number that meets the requirements through SHA-256 operations. Whoever finds it first will get the right to bookkeeping. You can understand this process as random guessing numbers, whoever guesses first wins.
The randomly guessed number will actually be recorded in the block header of this block, and will be recorded in the ledger forever as a random number. If you remember the above, you will find that each block will record the hash value of the previous block as mentioned in this article, and the hash value itself is calculated by hash calculation. This random number is actually a hash A factor for Greek calculations. (The composition of the block header and the more detailed process can be found in "Odaily Research Report| The turning point of Bitcoin mining industry and the economic cycle behind it》)
Since the SHA-256 operation is to collide with random numbers, whoever guesses more times in the same time period has a higher probability of finding the "answer" and obtaining the right to bookkeeping. Therefore, this competition mechanism is called Proof of Work, also known as PoW (Proof of Work).
In order to improve their computing speed, everyone can only continuously increase the computing power per unit time. Therefore, the hardware equipment has been continuously updated from the original notebook computer to today's professional mining machine (If you are interested, you can learn about the Odaily mining research report, Figure 6, the update iteration of hardware equipment), Ordinary laptops can no longer mine, so mining pools also appeared. (If you want to know, you can read "Xiao Ming's study notes | Understand what a mining pool does in one article》)
The computing power equipment is getting more and more advanced. However, the Bitcoin system also has a very interesting setting. It will automatically adjust the difficulty to keep the block generation time at 10 minutes as much as possible.
Friends who are interested in mining may ask, is it still possible to mine now? Of course it is possible, but it is no longer possible to use a computer or even buy a mining machine to mine, and the cost is too high. Therefore, there is also a way for ordinary people to participate in mining in the market, which is equivalent to renting other people's machines to mine for themselves. (Click the link for details) At present, mining has become a relatively mature industry. If you are interested, this article has a more complete and detailed introduction:secondary title
5 Bitcoin Pros and Cons
Now that you understand how the Bitcoin system works, all these complex designs are designed to achieve the following conditions:
1. The total amount is limited, and the supply is reduced;
2. Cannot be forged;
3. The transaction is convenient and safe;
These characteristics give people confidence that Bitcoin can be used as a general equivalent, so slowly:
4. Widely recognized and accepted
In addition, Bitcoin also has distinctive features:
5. Decentralization;
6. Global distribution and circulation;
This includes both the decentralization of issuance and distributed ledgers.
The advantages of Bitcoin are obvious, but the disadvantages are equally obvious:
1. Bitcoin's "mining" mechanism consumes a lot of energy around the world;
2. Blind hype causes the price of Bitcoin to fluctuate violently, and the primary goal of currency is to stabilize the currency value;
3. There are flaws in the anonymity of the transaction, such as the previous ransomware that required the use of Bitcoin as a ransom;
4. The total amount of Bitcoin is limited, so it is a deflationary currency. The value only increases but not decreases, which may lead to hoarding by everyone, resulting in a lack of liquidity in the market, and eventually the economy shrinks;
5. Transfers are time-consuming and require handling fees;
6. The concurrent transaction capacity is limited.
This article also refers to the article of Zhihu netizen @ceelog:After reading it, you will know what Bitcoin isauthorized.
Other reference articles:
I'm Odaily Little Parker, looking for reports on high-quality blockchain projects, you can add WeChat lmm662381, please note the company + name + reason. For reprint/content cooperation, please email report@odaily.com.