Bitcoin bit-coin blockchain block chain base technology explanation

Source: Internet
Author: User
Preface:

Haven't written a blog for a long time, because they are engaged in bitcoin this thing, now most of the internet is a number of conceptual things, the real content is not much, hear the most words is to center, to the third party, which for the understanding of Bitcoin or block chain technology is not half a dime of the help, So I'm here to sum up the various things about Bitcoin.


bit coin, block chain brief:

The main purpose of this brief is to have a concept so that you can accept the following explanations. bit currency:

First, what is Bitcoin. Online gadget Its technology, what the virtual currency, what the global encryption of the Internet currency, the sound of cattle to not. It looks like an encrypted Alipay, or an e-dollar or something. In fact, compared with the rest of electronic money, PayPal, Alipay, etc. belong to the payment platform, the money is linked to the real money, deposit 1 yuan, the account has only one yuan, and the bitcoin type of electronic money is a special currency, you can understand the dollar, the euro and other foreign currencies, but foreign currencies are foreign countries with the government guarantee , the domestic currency has a domestic government guarantee to issue, can be recognized. And Bitcoin is guaranteed by the program, created by the program, once a bitcoin type of money on the line, it is not an individual or founder can control things, everything is in accordance with the procedures to go, or according to the consensus of everyone to change.

In addition, countries do not recognize bitcoin is because of the uncontrolled, not casually printed. block chain:

Block chain is a kind of technology, just start technology, many places need to improve, so many things are very vague.

The above figure is a bitcoin transaction process, the block is stored in 10 minutes of all transaction content, so every 10 minutes update, the blocks are interconnected to form a chain. The network node can be understood as a database, each node contains all the transaction information of the Bitcoin, and is connected with each other to form a block chain of a bit currency. Summary:

In a nutshell, Bitcoin is a virtual currency, and it is not linked to everything that is valuable to the entity. Block chain is a kind of technology that carries bit-currency network.


Wallet:

Alipay money you have to have an account, the bank to save money also have to have a bank card, and Bitcoin in the use of wallets. What is bitcoin wallet, plainly, is a string of random 256 digits, representing the private key. And once your private key is dropped, any person can use your account casually. The private key can be further converted to the transaction address of the public key and Bitcoin.


The private key obtains the public key through the elliptic curve algorithm, here to mention, the Ben Cong is really bad, prism door exposure of the double elliptic curve (Dual elliptic Curve) algorithm has thought that the back, in Ben Cong not know is luck or strength, did not choose this international general curve algorithm, but oneself find another one. The public key then enters the hash to get the address. Addresses are the only personal information that is exposed when Bitcoin is traded, while the private key's two encryption methods are asymmetric encrypted, so there is no need to worry about any personal information being compromised.


Trading:

About trading, first we need to know the concept of a few bitcoin: Uxto:

It is also said that expenditure is not spent. is essentially a string of unique strings, but represents a bit of the nominal value of the Bitcoin, itself can be divided into smaller bits of the coin. In the Bitcoin play the role of the currency, the maximum segmentation value is 10^-8, known as 1 Cong. The illustration below is a demo of the split Utxo in a transaction:


Advantages: To prevent money from being used two times, you can track each currency to prevent the appearance of a strange currency, there is the same as the role of the number on the renminbi.

Disadvantages: Fair charge fees, split too often, now leading to a larger chain of blocks (although and the current financial field of the day a few t can not compare, but compared to the past few years, the data is now explosive growth. )
Lock Script:

A string of scripts to lock the Utxo and wait for the unlock condition to unlock the use of the Utxo. In the Bitcoin field, used to lock the utxo, unlock the conditions for a signature and the transfer of the public address can be matched, transferred to him. The sender makes the script.


Unlock script:

A series of conditions used to satisfy a locked script. In the bitcoin is the signature education public address matching. The receiver makes the script.


Trading Process:

Suppose that the sender A is to be traded and transferred to the receiver B-Bitcoin. 1. Create transaction:

An individual user is typically accessing a node, getting a wallet of what utxo can be used, looking for, piecing together or decomposing the Utxo value of the desired transaction, and getting the address of B. Use the lock script to lock the use of Utxo and publish to any node in the Bitcoin network. Don't forget, of course, that every transaction costs a fee. 2. Broadcasting:

Any node receives a transaction message and broadcasts it to the remaining nodes in the Bitcoin network until all nodes receive the message. So the B-link to enter the Bitcoin network, confirm the transaction, the specific steps on the line to sign, using unlock script, unlock the locked utxo,10 minutes, all nodes will record this account, also the real deal.
3. End

This is recorded, which is the transaction flow that the average user needs to know, and the owner of the Bitcoin node, the miner, needs to do a lot more complicated.


node:

As mentioned earlier, Bitcoin is a kind of money created out of thin air, so since it is created, it has to be created in accordance with the Basic Law. In Bitcoin's world, it is common for miners on nodes to get the money they create. Because there is interest, so miners are bored to configure the node to help complete the transaction. So as a node, exactly what to do, how to get money, first you have to understand these things: block:

The first thing to understand is that the most basic form of storage is the block.

The image above is the approximate structure of a block in which the header of the block is:

In summary, that is, all the transaction information, from the time, amount, address and the various parameters of the transaction are stored in the block.


block chain:

A chain, as the name implies, is to connect the blocks in some way, as shown below:

The random number is prepared for the workload proof (referred to later). Each new block is preceded by a hash of the previous block, and a new hash is generated, one for the mutual authentication integrity between the nodes, and two for the transaction to be traceable so that the record cannot be modified (or the cost of modification is too high). This changes to form a block chain.


Work Proof:

The block is 10 minutes to generate one, each person to remember their own account will be disorderly, so the bookkeeper can only have one. Now bitcoin 10 minutes 25, 1 write this article should be about 6000+RMB, enough for everyone to put their lives to bookkeeping. So how to establish an accounting person is a problem, Bitcoin introduced the workload certification system.

First the block is to use the random number in the hash calculation, so the hash hash of the current chunk is: the hash of the previous block + current block + random number = hash hash of the current block. The proof of work is the requirement that hash hashes for the current chunk must meet certain conditions, such as: The first few are 0. Because hash is a one-way operation, the result of the operation of what is not known before the operation, so only a large number of operations to guess the random number, and the first release of the random number can be recognized by all nodes.


Contract:

A bit of abstraction in Bitcoin is a kind of rule that everyone approves of. For example, the amount of work in Bitcoin is a kind of contract, we meet, who first find this random number, bitcoin to WHO. Even if someone or a node is not recognized, but most of the nodes will be recognized, so do not recognize the correct contract node is excluded. If there is a lunatic attacker, together with the >50% node, in the case of Bitcoin, it will only lead to the cost of attack and profit is not proportional.


block creation steps:

1. The node accepts the transaction information, accepts the unlock script and the locking script concretely, and matches the transaction information with a pair.

2. Hash with the transaction summary (i.e. hash hash) and random number of the previous one to satisfy the workload proof broadcast, not satisfied to continue.

3. If the other nodes have satisfied the work proof, verify the transaction information is correct, verify the workload is correct, and update the block correctly.

The above steps are commonly known as digging ore.


out of the pan:

Because the block chain technology is just beginning, Bitcoin is only as a block chain to start the test, so the whole system of Bitcoin is not particularly complete, but also has a lot of room for improvement. Here are some of the more popular variants now.
block chain: Public chain:

Like Bitcoin system, everyone satisfies certain conditions can do node, the system is open to everyone.


License chain/Alliance chain:

Nodes need to be approved, so the security of the block chain, partially open, outside can be used, but there may be some restrictions, such as the building blocks between banks.


Private chain:

As the name suggests, similar to the company's internal block chain, private nodes.


work proof substitution: Benefits Certificate:

Here to introduce the concept of a currency age, holding 10 currency 2 years = 20 age. Block chain with the current technology, the only possible breach of the only two-flower attack, and the basic condition of the two-flower attack is to calculate the number of blocks in a row. Therefore, the equity proof introduces the concept of currency age, in order to prevent the same node to calculate the block continuously. Rights and interests to prove the use of age to control the workload of the difficulty, the greater the age of the currency, the more difficult the calculation, the smaller the age of the currency, the greater the difficulty of calculation. And when a node updates chunks, all the currency ages for this node are recalculated.


Certificate of Appointment:

Further, as long as the force to meet certain conditions, they can be voted into a member of the bookkeeping, the rotation of the bookkeeping. If someone misses the bookkeeping, or does a random bookkeeping, it will be removed from the bookkeeping status. In addition, each accounting person needs to pay 100 times times the deposit in advance.


Trading Mode:

The P2pkh,pay to public key hash is used in the Bitcoin, which requires the sender to lock a script and the receiver to unlock a script. can now be replaced by another way of trading p2sh,pay to script hash, this transaction only requires the trader to send a hash hash, the receiver generated script (redemption script), thus greatly reducing the burden on the server.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.