In 2008, a person named Satoshi Nakamoto published a paper on bitcoin: a point-to-point e-cash system (original PDF version of the paper), which opened the curtain of bitcoin's popularity all over the world.
The underlying blockchain technology of bitcoin was also found later. Its technical characteristics such as decentralization, traceability and tamperability can be applied to financial, traceability and other scenarios. Whether you want to know about blockchain or bitcoin, we believe that bitcoin, as the birthplace and first application of blockchain, is the first point you need to know more before you get started.
What is bitcoin and how to get it? This article will teach you how to understand and use bitcoin.
1. Account opening
If you want to own bitcoin, whether you buy it at the exchange or transfer it to you, you need a bitcoin account. What materials does bitcoin need to bring to open an account and which institution to open an account? Without any materials, just download a bitcoin wallet.
Little knowledge: bitcoin wallet is another big topic. First of all, it should be clear that the digital currency wallet is not a real "wallet". The currency is not stored in the wallet, but on the chain mentioned above (essentially a pile of numbers). The wallet is just an application that allows you to open an account, query the balance and transfer accounts. In fact, in theory, every currency will be its own wallet. Therefore, most wallets on the market are easier to use, aggregate currencies, or safer. Some are decentralized, while others are cold wallets, hot wallets and managed wallets.
If you are interested, you can click the link below to learn more.
Using the light wallet on the chain can let you know more about some "anti human" designs such as bitcoin's private key, address and mnemonic words. Bitpie and imtoken are relatively old wallets. People with good English can even use the official wallet of bitcoin; Hosted wallets are easier to use, but the private key is not kept by yourself.
With a bitcoin wallet, all you need to do is move your fingers and open an account.
An account of bitcoin consists of a pair of keys (private key, public key). The account owner can use his private key for digital signature, and the public key can verify the signature. The public key can be generated by the private key, but the private key cannot be generated with the public key. That is, the so-called "asymmetric encryption" (reference link: blockchain 100 Q 60 | what is the asymmetric encryption algorithm?). This is also the reason why bitcoin is called digital cryptocurrency, because the whole system depends on the basis of cryptography.
Little knowledge: what does the hash calculation mean here?
Hash calculation has the following characteristics:
1. Mapping data of any length to large integer of fixed length;
2. When the data changes arbitrarily, the calculated results are completely different;
3. Cannot reverse the original data content 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 changes slightly, the hash result will be thousands of miles worse. Then each time the original content is changed, the hash value obtained is equivalent to a random number selected from the 256 power of 1 to 2. In this way, others cannot calculate the public key through the account address. So you can safely tell others your address and accept the other party's transfer without worrying about account theft. Unless you lose your private key.
When you have your first bitcoin account, you are very happy; But you're also frustrated because it's empty. How to make your wallet bulge?
You have the following ways to achieve this goal:
1. Bitcoin "mining"; The competition is fierce, and the opportunities for ordinary people are slim, but they can rent machines to mine. For details, we can understand that the "easy investment" cloud computing power platform of strategic incubation of planet daily is officially launched to help investors "hold" bitcoin
2. Spend money to buy at the exchange. See this article "how to have the first bitcoin in your life?". At present, the major exchanges we commonly use are centralized platforms with low security. Of course, there are decentralized exchanges, but they are rarely used. Click the link to learn more.
3. Let your good friend transfer some to you; (if you have such friends.)
2 bookkeeping
When you have a bitcoin account and bitcoin, you can transfer between different accounts. The minimum unit of bitcoin is 1 Cong, 1 Cong = 0.00000001btc When we use Alipay to transfer money to others, it is actually the amount of charge that the bank is responsible for deducting your account, add to the account of the other side, give you the bill, and charge your service fee.
Bitcoin transfer steps are similar, but there is no bank role. So in the process of bitcoin transfer, who will deduct the money and who will record the bill?
Different from the banking system, there is a decentralized accounting method: distributed ledger. That is, the ledger is no longer maintained by the banking system, but jointly maintained by participants. It is simply understood as: everyone can participate in bookkeeping. The person who maintains the ledger is generally called a node, also known as a miner.
In the blockchain, transactions are arranged in chronological order. A blockchain is the packaging of a pile of transactions, and blocks can be regarded as a page of ledger.
The bookkeeper of each page of the ledger (that is, the blocker of this block) must be selected through a competition to obtain the power of bookkeeping. After recording this page, broadcast it to everyone else. This process is called block, also known as "mining".
Others can verify these transactions through cryptography. As mentioned above, the account owner can digitally sign with his private key and verify the signature with his public key. Other people involved in bookkeeping can synchronize the latest account book of this block / page and continue to dig on it. At the same time, in the blockchain, each page of the ledger (each hash) is linked, 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 "distributed ledger". The approval of most nodes is required every time. No node can tamper with the account book alone. Unless it obtains the consent of 51% of nodes, it cannot succeed. This is the so-called 51% attack.
The system operation will not be affected if any node exits the network or goes down. Compared with single node centralized system, this method has high security. Nodes are distributed all over the world. Each node connects with nearby nodes to form a global P2P network. This is also the material basis for the global circulation of bitcoin.
As mentioned in the previous section, if an account wants to know its balance, it can be queried through the wallet.
However, only nodes have complete ledger information, and wallets also need to query their own balance through nodes. So where is the node? I can't see or touch it. Where can I find it? Fortunately, you don't have to bother to find nodes. Your "bitcoin wallet" will help you do it.
In fact, if bitcoin wallet wants to tell the transaction information to the node, it must be connected to at least one node in the bitcoin network. When connected to the node, bitcoin wallet itself becomes a node in the network. However, compared with the whole node with a complete ledger, the wallet node is a "lightweight node", because it does not record a complete ledger, I didn't go "mining".
Curious, you still want to ask one more question: how does bitcoin wallet find nodes?
Very simply, in the process of the development of bitcoin network, there will be some long-term stable nodes called "seed nodes". When developing bitcoin wallet software, it will write the domain names of these "seed nodes" into the code, and ask the "seed nodes" for an active node address list through DNS dynamic query. With these nodes as the media, bitcoin wallet can join the network.
For example, Mr. Chen gave miss.com through his bitcoin wallet LV transferred 0.05btc, which 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 in this way, but the bitcoin account of the two people, similar to:
1AC4fMwgY8j9onSbXEWeH6Zan8QGMSdmtA -> 1JWq3G8pqCo6jZGhLHpctYap5yVScqGxkv : 0.05btc
Such an accounting process is actually the so-called blockchain. Bitcoin is the first application of blockchain.
3 issuance / Mining
Since it is money, you will ask, how did it come from in the beginning?
This involves the issuance of bitcoin.
Ordinary currencies are issued by some institutions such as the central bank, but in bitcoin, the generation of each block is accompanied by the generation of new currency (this is what is written in the program. Don't ask me why). Whoever wins the bookkeeping right of this round of blocks will get the latest bitcoin.
Bitcoin issued a total of 21 million. The initial block reward is 50 BTCs, that is, for each block excavated, the miner will get 50 BTCs. The system stipulates that for every 210000 blocks (about 4 years), the reward for block output will be reduced by half until it is as little as 1 Cong, the smallest unit of bitcoin. Therefore, the block reward will be adjusted to 25 BTCs after 2012 and 12.5 in 2016. The next halving will be in 2020. This competition process is like digging new gold coins, so everyone will call it mining and call the account book maintainer "miner".
At this point, the incentive mechanism of bitcoin has been involved, that is, why are nodes willing to waste resources to keep accounts?
In fact, in order to reward the nodes for bookkeeping, the bitcoin system is designed so that each user needs to pay the service charge for verifying the transaction when transferring money. At the same time, the nodes that join the network earlier can obtain the newly issued bitcoin (until all bitcoins are issued). In this way, miners can get two parts of their income every time they keep accounts.
4 consensus mechanism: pow
You know, now a bitcoin is worth $10000, so one block from the billing node can get 12.5. Doesn't everyone want to dig?
Bitcoin system has designed a set of competition mechanism in order to make everyone obtain the right of accounting fairly.
The system requires competitors to guess a random number that meets the requirements through SHA-256 operation. Whoever finds it first will get the bookkeeping right. You can understand this process as guessing numbers randomly, who guesses who wins first.
This number, which is guessed at random, will actually be recorded in the header of the block and will always be recorded in the account book as a random number. If you remember the above, you will find that each block mentioned in this article will record the hash value of the previous block, and the hash value itself is calculated through hash calculation. This random number is actually a factor of hash calculation. (the composition of the block and the more detailed process can be seen in the "planet Research Report - the turning point of bitcoin mining industry and the economic cycle behind it")
Since SHA-256 operation is to collide with random numbers, the more people guess in the same time, the more likely they are to find the "answer" and obtain the bookkeeping right. Therefore, this competition mechanism is called workload proof, which is the so-called pow (proof of work).
In order to improve their computing speed, we can only continuously improve the computing power per unit time. Therefore, the hardware equipment has been continuously updated from the original notebook computer to today's professional mining machines (if you are interested, you can learn about the Research Report of planet mining, Figure 6, the update iteration of hardware equipment). Ordinary notebook computers can't dig, so there are mining pools. (if you want to know, you can read Xiaoming's study notes to understand what the mine is for.)
Computing devices are becoming more and more advanced. However, the bitcoin system also has a very interesting setting. It will automatically adjust the difficulty and keep the block time at 10 minutes as much as possible.
Friends who are interested in mining may ask, can they still go mining now? Of course, but I can't use computers or even buy mine machines to dig. 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. (for details, please click the link to understand) at present, mining has become a relatively mature industry. If you are interested, this article has a more complete and detailed introduction: the inflection point of the industry of bitcoin mining and the economic cycle behind it
5 advantages and disadvantages of bitcoin
Now you have understood the operation principle of bitcoin system. All these complex designs are only for the following conditions:
1. Limited total quantity and reduced supply;
2. Cannot be forged;
3. Convenient and safe transaction;
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 characteristics:
5. Decentralization;
6. Global distribution and circulation;
This includes both decentralization of issuance and distributed ledger.
The advantages of bitcoin are obvious, but the disadvantages are also obvious:
1. Bitcoin's "mining" mechanism consumes a lot of global energy;
2. The primary goal of currency speculation is to stabilize the value of bitcoin blindly;
3. The anonymity of the transaction is flawed. Compared with the previous blackmail virus, bitcoin is required to be used as 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 lack of liquidity in the market and eventually economic contraction;
5. The transfer is time-consuming and requires a handling fee;
6. Transaction concurrency capacity is limited.