Blockchain QuickStart (vii)-Bitcoin

Source: Internet
Author: User
Tags asymmetric encryption

Blockchain QuickStart (vii)-Bitcoin one, Bitcoin introduction

Bitcoin (BITCOIN,BTC) is a digital currency implementation based on blockchain technology, and the Bitcoin network is the first digital currency system to undergo a large-scale long-time test.
Since the official launch in 2009, the price of bitcoin has experienced several shocks, at present, each Bitcoin market price of more than 6000 U.S. dollars, and once nearly 20000 U.S. dollars.
The Bitcoin network has the following features:
A, to the center of the
No single individual can disrupt transactions in the network, and any transaction request requires the consensus of the majority of participants.
B, anonymity
The account address in the Bitcoin network is anonymous and cannot be linked from the transaction information to a specific individual, but it is also difficult to audit
C. Inflation prevention
The distribution of bitcoins needs to be carried out by mining calculations, with the circulation being halved every four years, with a total limit of 21 million pieces, which cannot be super-fat.

Ii. principle of Bitcoin implementation 1, introduction to the principle of Bitcoin implementation

The Bitcoin network is a distributed point-to-point network in which miners compete for the right to account for transactions by mining, and the miners who have the right to account are responsible for generating blocks, recording the transaction history, and maintaining the normal operation of the network.
The blockchain network provides a publicly visible accounting book, which is not a record of the balance of each account, but is used to record historical information about the transactions that have occurred, avoiding replay * * *, where a legitimate transaction has been re-sent multiple times.

2. Bitcoin Trading process

Each time a transaction occurs in the Bitcoin network, the user is required to write the transaction to the Bitcoin network ledger, and the transaction is considered complete after the network confirmation.
In addition to mining to obtain the reward of the Coinbase trade only output, under normal circumstances each transaction needs to include a number of inputs and outputs, non-use (reference) of the trade output (unspent Transaction outputs,utxo) can be a new transaction reference as its legitimate input. The output of the used trade (spent Transaction Outputs,stxo) cannot be referenced as a legitimate input.
Therefore, a legitimate transaction in the Bitcoin network must be a reference to the utxo of certain existing transactions (which must be a legitimate reference by the payer) as input to the new transaction and generate a new Utxo (which will be the recipient).
In the course of the transaction, how does the payer prove that he or she refers to the Utxo legal? Bitcoin is implemented by "signature script" and specifies "output script" to limit the future use of new Utxo only to designated recipients. For each transaction, the payer is required to confirm the signature. Also, for each transaction, the total input cannot be less than the total output. The total input compared to the total output of the excess portion is called the transaction fee (Transaction Fee), and is obtained for the miner that contains the block of the transaction. At present, the transaction cost per transaction can not be less than 0.0001BTC, the higher the transaction costs, the more miners are willing to include the transaction, the sooner they are placed on the network. The transaction costs are rewarded to the miners, but also to avoid the network by a large number of * * *.
The minimum unit of the amount in the transaction is "Cong", i.e. One-one hundred millonth (10^-8) bitcoin.
Transactions that have just been put into the network (depth of 0) are not confirmed in real time. The possibility of a transaction entering the network is overturned, usually after several new chunks are generated (depth greater than 0) before the transaction is considered confirmed.

3. Account (Address)

Bitcoin uses an asymmetric encryption algorithm, where the user retains the private key, signs the transaction that he or she makes, and exposes the public key.
Bitcoin's account address is actually a 160-bit (20-byte) string generated by the user's public key after a series of hashes (HASH160 or first SHA256, then RIPEMD160) and encoding operations.
In general, the account address string is often base58check encoded and the leading bytes are added (indicating which scripts are supported) and 4-byte check bytes for readability and accuracy.
The account is not directly the public key content, but the value after the hash, preventing the public key from being exposed prematurely and causing the private key to be cracked.

4. Trading

Trading is the core concept of completing the Bitcoin function, and a transaction may include the following information:
A, payer address: Legal address, public key after SHA256 and RIPEMD160 two times hash get 160 bit hash string.
B, the payer to confirm the signature of the transaction: to ensure that the transaction content is not tampered with.
C, the source of the payer's funds transaction ID: from which the output of the transaction as the input of this transaction.
D, the amount of the transaction: How much money, with the difference entered into the transaction service charge.
E, Beneficiary's address: legal address.
F, Timestamp: When the transaction will take effect.
After the nodes in the network receive the transaction information, the following checks are made:
A, whether the transaction has been processed.
B, whether the transaction is lawful. Includes whether the address is legitimate, whether the initiating trader is the legal owner of the input address, or whether it is a utxo.
C, the sum of the input of the transaction is greater than the sum of the output.
When the checks are passed, the transaction is marked as a legitimate, unconfirmed transaction and broadcast within the network.
Users can view real-time trading information from the Blockchain.info website, and a sample transaction is as follows:

5. Trading Scripts

A

Script is a core mechanism that guarantees the completion of a transaction (primarily to verify the legality of a transaction) and is triggered when the attached transaction occurs. Through the scripting mechanism rather than the process of writing dead transactions, the Bitcoin network has achieved some extensibility. The Bitcoin scripting language is a non-Turing-complete language. The
typically includes two scripts per transaction: The unlock script responsible for the input (SCRIPTSIG) and the lock script (Scriptpubkey) responsible for the output. The
output script is typically locked by the payer on the transaction setting, which is used to control the object (for example, the recipient) of the output that can use the transaction, such as restricting the owner of a public key to spend the transaction. The
claim script is used to prove that it can satisfy the lock condition of the trade output script, that is, the ownership of the output (bitcoin) of a trade. The
output script currently supports two types:
P2pkh:pay-to-public-key-hash, which allows the user to send bitcoins to one or more typical Bitcoin addresses (proving to have the public key), and the lead byte is generally 0x00.
P2sh:pay-to-script-hash, the payer creates an output script that contains a hash of another script (claiming the script), typically used for scenes that require multiple signatures, and the leading byte is typically 0x05.
Take P2pkh as an example, the format of the output script is:
scriptpubkey:op_dup op_hash160 <pubKeyHash> Op_equalverify Op_checksig
Op_dup is the top element of the copy stack,
op_hash160 is the calculation of the hash value,
Op_equalverify determine whether the top two elements of the stack are equal;
Op_ Checksig judge whether the signature is legal. The
above instruction actually guarantees that only the owner of the PubKey can legitimately refer to this output.
Another transaction if you want to spend this output, when referencing this output, you need to provide a claim script format of
scriptsig: <sig> <pubkey> The
is the pubkey corresponding to the private key to the transaction (the output of all transactions, input and script) hash value is signed, PubKey hash value needs to be equal to Pubkeyhash. When the transaction is verified, the stack is processed sequentially in the order of the first scriptsig and then Scriptpubkey, that is, the complete instruction is:

<sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash>OP_EQUALVERIFY OP_CHECKSIG

The introduction of scripting mechanisms provides flexibility, but also introduces additional security risks. The instruction set supported by the Bitcoin script is simple, stack-based, and non-Turing, with additional restrictions (size limits, etc.) added.

6. Block

A chunk of the Bitcoin blockchain cannot exceed 1MB and will mainly include the following:
A, chunk Size: 4 bytes
B. Block Size: 80 bytes
C, number of transactions counter: 1~9 bytes
D, the specific content of all transactions, variable length, matching Merkle Tree leaf node order.
Among them, the district header information includes:
A, Version number: 4 bytes
B, the hash value of the previous chunk header: Link to the previous legal block, two SHA256 operations on its chunk header, 32 bytes
C, the hash value of the Merkle root of all transactions contained in this block: two SHA256 operations, 32 bytes
D, Timestamp: 4 bytes
E. Difficulty Index: 4 bytes
F, Nonce:4 bytes, the answer to the POW question.
It can be seen that to check the integrity of the blockchain, it is necessary to examine the header information of each block, without acquiring the specific transaction content, which is the basic principle of simple transaction verification (simplicity Payment VERIFICATION,SPV). In addition, through the link of the head, provide time-series relationship while increasing the difficulty of tampering with the data in the block.
A sample chunk is as follows:

7. How to avoid evil

Based on the theory of economic game. In an open network, the law ensures that everyone is cooperating by means of technology. But the economic game can be used to let the partners benefit, so that non-collaborators suffer losses and risks.
In the Bitcoin network, all the participants (miners) will have to pay the cost of mining, the calculation of power consumption, the more want to get the decision of the new district block, the more mortgage. Once failed, the calculation will be confiscated and become sunk costs. When there are many participants in the network, the cost of calculating the power of the individual trying to get the new blocks is enormous, and the cost of doing a bad thing has exceeded the potential benefits.

8. Negative feedback adjustment

The design of the Bitcoin network is a good embodiment of the theory of negative feedback cybernetics.
The more miners in the Bitcoin network, the more stable the system, the higher the value of the bitcoin, but the probability of digging into the mine will be reduced. Conversely, the network miners reduce, will make the system more prone to be * * *, the lower the value of Bitcoin, but the probability of digging into the mine will improve. Therefore, the price of bitcoin should theoretically be stabilized at a suitable value (stability of the network will also stabilize at the corresponding value), the price multiplied by the probability of digging into the mine, just to achieve the miner's earnings expectations.
In the long run, hardware costs are down, but each chunk of Bitcoin rewards is halved every 4 years, eventually reaching 21 million in 2140, and then relying entirely on transaction service fees to encourage miners to maintain the network.
The smallest unit of bitcoin is "Cong", namely 10^ (-8) Bitcoin, total "Cong" number is 2.1E15. For a 64-bit processor, the limit of the high precision floating point count causes a single value to be no more than 2^53 approximately equal to 9E15.

9. Consensus mechanism

Traditional consensus problem is often considered in a relatively closed distributed system, allowing the simultaneous existence of normal nodes, fault nodes, how to achieve a rapid agreement.
For the Bitcoin network, it is completely open, may face a variety of situations, while Internet-based network quality can only guarantee "best effort", resulting in more complex problems, traditional consistency algorithm in this scenario is difficult to use.
Therefore, the Bitcoin network has to have a series of restrictions on the goal and process of consensus, and put forward a consensus mechanism based on POW.
The first is not to achieve the final recognition of the consensus, but based on the probability, with time to gradually enhance the recognition of consensus. The existing results can theoretically be overturned, but the cost of the * * * to pay over time and exponentially rise, the likelihood of being overturned with the decline of the index level.
In addition, given the scale of the Internet, consensus time is relatively long. Improve the overall usability of the network by making periodic confirmations (snapshots) in chunks (a set of transactions).
Finally, limit the noise of consensus in the network. By doing a lot of hash calculation and a few legitimate results to limit the number of legitimate proposals, and further improve the stability of the consensus in the network.

Three, mining 1, mining fundamentals

Mining is a node that participates in the maintenance of the Bitcoin network by assisting in the generation of new blocks to obtain a quantitative addition to the bitcoin process. When a user posts a transaction to a Bitcoin network, someone needs to confirm the transaction, form a new chunk, and concatenate it into the blockchain. In a distributed system that does not trust each other, the Bitcoin network uses the mining method to solve the transaction confirmation.
At present, every 10 minutes or so to generate a block of no more than 1MB size (recorded within 10 minutes of the validated transaction content), in series to the longest chain tail, each chunk of successful submitter can get the system 12.5 bitcoin reward (reward as the first transaction in the block, a certain number of blocks to use), and the payment service charges that the user attaches to the transaction. Even without any user transactions, miners can generate their own legal blocks and receive rewards.
The bonus for each chunk is initially 50 Bitcoin, which is automatically halved every 210,000 blocks, or 4 years, and the final Bitcoin total is stabilized at 21 million. Therefore, Bitcoin is a deflationary currency.

2. Ore-Digging process

The specific process of mining is: the participants synthesize a chunk of the hash value, the previous block generated after the new validated transaction content, coupled with their own guess a random number x, packaged together into a candidate new District block, so that the new block hash value is less than a given number in the Bitcoin network (difficulty value).
The system adjusts the mining difficulty (by adjusting the size of the limit) every two weeks (that is, 2016 blocks) according to the mining time of the previous cycle, and the time to adjust the generated block is stable at about 10 minutes. To avoid shocks, the maximum amplitude of each adjustment is 4 times times. The fastest out-of-block time in history is less than 10s, with the slowest block time exceeding 1 hours.
In order to dig into the mine, it is often necessary to devote a lot of time and computing power to the client side of the block. The calculation is generally based on the number of times per second hash calculated as units, recorded as h/s. Currently, the peak value of the Bitcoin network has reached Chean times per second.
HSBC analyst Anton Tonev and Davy Jose have said the bitcoin blockchain (through mining) provides a local, best-in-date solution: How to validate trust in a decentralized system. Blockchain essentially solves the problem of traditional reliance on third parties, because the protocol not only satisfies the need for the centralized organization to track transactions, but also creates trust among strangers. The technical and secure process of blockchain makes it possible for strangers to trust each other without a trusted third party.

3. Mining evaluation

Before 2010, mining was a very popular and profitable industry. But with the development of related technology and equipment, the income of individual mining now has dropped very low. In terms of probability, because the current participation in the mining of the computational power is too large (has exceeded most of the super-computing center), the general calculation is impossible to dig into Bitcoin.
From the ordinary CPU (2009), to the later GPU (2010) and FPGA (end of 2011), to the later ASIC mining machine (early 2013, the current monolithic computing force has reached tens of billions of hash per second), and now many mining machine joint formation of the Mine pool ( Well-known mineral pools include F2pool, BitFury, BTCC, etc.). Over the years, the technology of Bitcoin miners has gone through the evolution of IC technology over the past several decades and has been quite innovative. The calculation of the whole network has exceeded 10^18 hash per second.
Basically the individual achieves 1/3 of the computational power, the Bitcoin network has the risk of being destroyed, to 1/2 of the calculation force, from the probability of the control of the entire network. But to achieve such a large amount of power, will have to pay a huge economic cost.

Iv. consensus mechanism 1, POW

The workload proves that by calculating a value (nonce), the hash value of the content after piecing together the transaction data satisfies the specified upper limit (from Hashcash). Because the hash puzzle needs a large amount of computation under the current calculation model, it can guarantee that only a few legitimate proposals will appear in the system for a period of time. If a legitimate proposal can be made, it also proves that the sponsors have indeed paid a certain amount of work.
Legitimate proposals will be broadcast on the network, and users who receive the verification will continue to calculate the problem based on the longest chain the user believes. As a result, the fork (fork) of the chain may appear in the system, but eventually there will be a chain that is the longest chain.
Hash problem has the characteristics of irreversible, so at present, in addition to violence calculation, there is no effective algorithm to solve. If the required nonce is obtained, the probability is that the corresponding calculation force is paid. The greater the number of people, the greater the probability that the problem will be solved first. When mastering more than half of the entire network, the probability can control the direction of the chain in the network.
Those involved in the POW calculation will pay a small economic cost (hardware, electricity, maintenance, etc.). The cost will be sunk when there is no final winner to figure out a legal nonce. If someone tries malicious damage, it will cost a lot of money.

2. POS

The proof of entitlement (Proof of Stake,pos) was first proposed in 2013 and was first implemented in the PeerCoin system, with the more people with shares more likely to get the right to account (while the more likely they are to maintain the network's normal work).
The typical process is to bet a legal block into a new block by margin (tokens, assets, fame, and other items with value attributes), with the proceeds being the interest of the mortgaged capital and the transaction service charge. The more you provide proof of margin (for example, by transferring currency records), the greater the probability that you will be given the right to account. A legitimate bookkeeper can earn a profit. POS tries to solve the shortcomings of the large amount of resources wasted in POW, and has received extensive attention. A malicious participant will be at risk of being confiscated from the margin, i.e. loss of economic benefits.
In general, it is possible for POS to master more than 1/3 of the network's resources to be able to influence the final result
POS also has a number of improved algorithms, including the authorization of the equity Proof mechanism (DPOS), whereby all shareholders vote for a board of directors and members of the Board have the right to account for the agency. The DPOS algorithm is well verified in practice, but there is no theoretical proof.
August 2017, Aggelos Kiayias, from the University of Edinburgh and the University of Connecticut, in the paper "Ouroboros:a provably Secure proof-of-stake Blockchain Protocol" In this paper, the Ouroboros Blockchain consensus protocol is proposed, which can achieve the approximate Nash equilibrium of honest behavior and is considered as the first verifiable secure POS protocol.

Five, Lightning Network 1, Lightning Network Introduction

Bitcoin's trading network is one of the most criticized trading performance: the entire network of about 7 per second trading speed, far lower than the traditional financial trading system, while waiting for 6 blocks of credible confirmation will result in about 1 hours of final confirmation time. To improve performance, the Bitcoin community has proposed innovative designs such as lightning networks.
The main idea of the Lightning network is very simple-to put a lot of transactions outside the Bitcoin blockchain, just put the key links on the chain to confirm. It was first proposed in February 2015 in the paper "the Bitcoin Lightning network:scalable off-chain Instant Payments". Lightning network mainly through the introduction of intelligent contract ideas to improve the chain of trading channels. The core concepts are mainly two: RSMC (recoverable Sequence maturity contract) and HTLC (Hashed timelock contract). RSMC solves the problem of confirming the transaction under the chain, and HTLC solves the problem of payment channel.

2, RSMC

RSMC (recoverable Sequence maturity contract), you can revoke the order maturity contract. First, it is assumed that there is a micro payment channel (Money pool) between the two parties. Both parties pre-deposit part of the funds into the micro-payment channel, the initial situation of the two sides of the allocation plan is equal to the amount of deposit. Each time a transaction occurs, it is necessary to confirm the result of the allocation of funds after the transaction, and sign the old version of the allocation plan to be voided. Either party needs to mention that the results of the transactions signed by both parties can be written to the blockchain network and thus be confirmed. You only need to pass the blockchain at the time of the withdrawal.
Any version of the scheme needs to be signed by both parties to be legal. Any party may withdraw at any time, mentioning the need to provide a capital allocation scheme signed by both parties (which means that the result of a transaction must have been confirmed by both parties, but not necessarily the latest result). If, for a certain period of time, the other party proves that the scheme has been voided (not the latest trading result), the funds are forfeited to the challenged party, or otherwise distributed according to the results of the proposed party. The forfeiture mechanism ensures that no one is deliberately taking an old trading result to withdraw.
In addition, even if both parties have confirmed a withdrawal, first of all, the withdrawal of funds to the current party is later than the other side, encourage everyone as far as possible to complete the transaction outside the chain. Through RSMC, a large number of intermediate transactions can occur outside the chain.

3, HTLC

Micro-payment channel is realized by Hashed Timelock contract, Chinese meaning is the hash of the contract with the clock, that is, time-limited transfer. Through the smart contract, the two parties agreed to the transfer party to freeze a sum of money, and provide a hash value, if a certain period of time someone can propose a string, so that the value of the hash is matched with a known hash value, the money is transferred to the receiver.

4, the realization of lightning Network

RSMC guarantees that direct transactions between two people can be done under the chain, HTLC guarantee that transfers between any two people can be done through a payment channel. Lightning network integration of RSMC and HTLC two mechanisms, you can achieve any two of the transactions between the chain to complete.
In the entire transaction, the intelligent contract plays an important role in the intermediary, while the blockchain network ensures that the final trading results are confirmed.

Six, side chain 1, side chain introduction

The side-chaining (sidechain) protocol allows assets to be diverted between the Bitcoin blockchain and other blockchain chains. The side chain also comes from the Bitcoin community, which was first introduced in December 2013 and was launched in April 2014 by Blockstream Corporation (co-sponsored by Bitcoin Core developer Adam back, Matt Corallo, etc.) leading research and development. The side-Link agreement was published in October 2014 in the white paper "enabling Blockchain innovations with pegged Sidechains".
Before the birth of the side chain, the emergence of many shanzhai coins is fragmented throughout the digital money market, coupled with the competition of Ethereum and other projects, some Bitcoin developers want to use the side-chain to expand the underlying protocol Bitcoin.
Bitcoin blockchain as the main chain (Parent chain), other blockchain as a side chain, both through the two-way hook (two-way peg), Bitcoin can be transferred from the main chain to the side chain to flow.

The side chain can be a separate blockchain, with its own on-demand ledger, consensus mechanism, transaction type, scripting, and contract support. The side chain cannot issue bitcoins, but it can introduce and circulate a certain amount of bitcoins by supporting the Bitcoin blockchain. When the bitcoin is in the side chain, the corresponding Bitcoin on the main chain is locked until the bitcoin is back to the main chain from the side chain. The side-chaining mechanism enables the expansion of Bitcoin blockchain by placing a number of customized or high-frequency transactions outside the bitcoin main chain. The core principle of a side chain is the ability to freeze assets on a chain and then generate it on another chain, which can be done in a variety of ways.

2. SPV Certificate

When verifying transactions in the Bitcoin system, transaction legality checks, double-cost checks, foot
This check and so on. Because the validation process requires a complete utxo record, it is usually done by miners running full-featured nodes.
Most of the time, users only care about their own transactions, such as when the user receives the other person's alleged bitcoin, only want to know whether the transaction is legitimate, has been in the blockchain has sufficient time (that is, to obtain sufficient confirmation), and do not need to become a full node to complete the validation.
Simple payment verification (simplified Payment VERIFICATION,SPV) designed by Satoshi can do this. The SPV is able to determine at a lesser cost whether a payment transaction has been verified (in the blockchain) and how much of the calculated force is being protected (locating the block containing the transaction in the blockchain). The SPV client only needs to download the chunk header (block header) of all blocks, and carry out simple positioning and calculation work to give the verification conclusion.
In the side-chain agreement, the SPV proves that a transaction has already happened in the blockchain, which is called the SPV certificate (SPV Proof). A SPV certificate consists of two parts: a list of block headers, a proof of workload, and a cryptographic proof that a particular output is actually present in a chunk.

3, two-way hook

The difficulty in designing side-chaining protocols is how to secure the flow of assets between the main and the side chains, i.e. the chain of accepted assets must ensure that the tokens on the chain of the sending asset are reliably locked.

The side-chain protocol uses the bidirectional hook mechanism to transfer and return the bitcoin to the side chain. The main chain and the side chain need to be verified by the SPV for the specific transaction. The complete process is as follows:
A, when the user wants to transfer bitcoins to the side chain, first creates the transaction in the main chain, the bitcoin to be transferred is sent to a special output, and is locked on the main chain.
B, waiting for a confirmation period, so that the above transactions to obtain sufficient workload confirmation.
C, the user in the side chain to create transactions to extract bitcoins, the input required in this transaction indicates the above main chain is locked output, and provide sufficient SPV proof.
D, waiting for a period of competition, to prevent double-cost * * *.
E. Bitcoin is free to circulate on the side chain.
F, a similar reverse operation is taken when the user wants to return the bitcoin to the main chain. The transaction is created in the side chain first, and the bitcoin to be returned is sent to a special output. After waiting for a certain period of confirmation, the first locked output is unlocked in the main chain with enough SPV proof to the side-chain output. After the competition period, the main chain Bitcoin resumes circulation.

Vii. Hot Issues 1, the tradeoff in design

Bitcoin is designed to support a secure, open, and distributed digital money system, so many places in the design of the Bitcoin protocol embody the trade-off.
A, chunk capacity: larger chunk capacity can lead to higher transaction throughput rates, but increases mining costs, resulting in a centralized risk, while increasing the cost of storage. Considering the various considerations, the current block capacity limit is set to 1MB.
B, out-of-block interval: shorter out-of-block intervals can shorten the time to trade confirmations, but may also lead to increased bifurcation and reduced network availability.
C, script support: A more powerful script instruction set provides more flexibility, but also introduces additional security risks.

2. Bifurcation

The Bitcoin protocol will not be immutable. When you need to fix a bug, extend a feature, or tweak a structure, Bitcoin needs to be upgraded with a full network. Upgrades typically involve changing the data structure of a transaction or the data structure of a chunk.
Since nodes distributed around the world cannot be upgraded at the same time to comply with the new protocol, the bitcoin blockchain May Fork (fork) during the upgrade. For an upgrade, if the upgraded node in the network is called the new node, the non-upgraded node is called the old node, according to the differences between the old and new node compatibility, can be divided into soft fork (Soft fork) and hard fork.
If the old node is still able to verify the transactions and chunks that are being generated by the new node, it is called a soft fork. The old node may not understand part of the data generated by the new node, but will not reject it. The network is backward and forward compatible, so this type of upgrade can be done smoothly.
If the old node does not accept transactions and chunks generated by the new node, it is called a hard fork. The network is backward compatible only and not forward compatible. This type of upgrade often results in a period of time when the old and new nodes are recognized by different chunks, separated two chains, until the old node upgrade completed.
Although it is more difficult to upgrade a blockchain protocol through a hard fork than a soft fork, the things that a soft fork can do are limited, and some bold changes can only be done by a hard fork.

3. Transaction ductility

Transaction ductility (Transaction malleablility) is a design flaw in Bitcoin, meaning that the transaction ID may still be changed when the transaction is signed by the originator of the trade.
The originator's signature of the transaction (SCRIPTSIG) is in the input (VIN) of the transaction, which is part of the transaction content. The transaction ID (TXID) is the hash value of the entire transaction, thus causing the * * * (especially the signer) to change the Txid by changing the Scriptsig, while the transaction remains legitimate. For example, to reverse the S-value in the ECDSA signature process, the signature is still valid and the transaction can still be propagated.
ductility * * * Can change the transaction ID, but the input and output of the transaction will not be changed, so the * * * will not directly steal Bitcoin. As a result, ductility has remained in the Bitcoin network and has not been cured.
However, ductility still poses some problems. For example, a transaction with a change in the ID of the broadcast before the original transaction is confirmed may mislead the parties on the status of the transaction, or even launch a denial-of-service * *; a multi-signature scenario the next signer has the ability to change the transaction ID, which poses a potential risk to other signers ' assets. At the same time, extensibility issues can hinder the implementation of Bitcoin expansion schemes such as lightning networks.

4. Expansion controversy

Bitcoin currently limits the block capacity to below 1MB. With the increase of users and trading volume, the block capacity limit has been gradually unable to meet the demand for bitcoin transactions, making transactions increasingly congested, transaction fees continue to rise.
The ongoing controversy over the expansion of Bitcoin has been in place since 2015, with a range of options being placed on the table, including expansion proposals on various chains, extension of Bitcoins with side chains or lightning networks. Given the complex community environment of Bitcoin, it is difficult for any expansion plan to reach a broad consensus, and it is difficult to reconcile different schemes.
Currently, the contention for expansion is focused on two factions: the Bitcoin core team that represents the core developer, the isolation witness scheme and the Bitcoin unlimited team.
The quarantine witness (segregated Witness, abbreviated Segwit) is a field in which the signature portion of a transaction is isolated from the input of the transaction and placed at the end of the transaction called the Witness (Witness).
The calculation of the transaction ID will no longer contain the signature part, which is a solution to the ductility problem, which enhances the security of the second layer protocol including Lightning network.
At the same time, the isolation witness will theoretically increase the block capacity limit to 4MB.
The Bitcoin Unlimited scheme (BU) refers to the expansion of the Bitcoin client, allowing miners to freely configure the capacity of the chunks they want to generate and validate.
According to the scenario, the upper limit of chunk capacity is naturally convergent according to the configuration of many nodes and miners.

5. Monitoring and tracking of Bitcoin

The anonymity of bitcoin has made it very difficult to regulate the trading on the currency. Many illegal elements use their anonymity to transfer funds through Bitcoin. For example, the Wannacry network virus ransomware Bitcoin to victims, spreading and affecting more than 150 countries in just three days.
However, it is not practical to achieve full anonymity through Bitcoin. Although the trading account itself is an anonymous hash address, some research results (such as the anonymity in the bitcoin system) show that by analyzing a large number of publicly available transactions, there is a high probability that the actual transfer route of Bitcoin can be traced, It can even be traced to real users.

Viii. Bitcoin-related tools 1, client

The Bitcoin client is used to interact with the Bitcoin network and can participate in the maintenance of the network.
The client is divided into three types: Full client, lightweight client and online client.
Full client: Stores all transaction history and is fully functional.
Lightweight client: Do not save the transaction copy, the transaction needs to be queried to others.
Online client: Browse the services provided by a third-party server through Web page mode.
Bitcoin client: Https://bitcoin.org/en/download
Based on the Bitcoin client, it is easy to implement the user wallet function.

2. Wallets

Bitcoin wallet stores and protects the user's private key, and provides the ability to query Bitcoin balances, send and receive Bitcoins, and more. Depending on how the private key is stored, the wallet is divided into the following categories:
Offline Wallets: Offline storage of private keys, also known as "cold wallets". The security is the strongest, but cannot send the transaction directly, the convenience is poor.
Local wallet: Stores the private key with a local device. Transactions can be sent directly to the Bitcoin network, with a strong ease of use, but local devices are at risk.
Online Wallet: Use the wallet server to store private keys that have been encrypted by the user's password. Easy to use, but the wallet server may also be * * *.
Multi-Signature Wallet: A wallet address is managed by multiple parties, such as a 2of 3 mode in which a two-bit private key from a three-bit manager can be sent for trading.
Bitcoin wallet: Https://bitcoin.org/en/choose-your-wallet

3, Mining machine

The Bitcoin miner is a hardware device specially designed for "mining", and currently includes a special mining machine based on GPU and ASIC chip. The mining machine often uses the special design to accelerate the mining process the calculation processing.
The most important property of a miner is the available calculation force (usually expressed as the number of times a hash can be calculated per second) and the power required. When the calculation force is large enough to dig enough new chunks in a probabilistic sense to compensate for the cost of electricity, the miners can be profitable; When the power generated by the unit is not enough to pay the electricity cost, the miner cannot profit and can only be eliminated.
At present, the whole network in the Bitcoin network is still growing rapidly, miners need to consider the change of the calculation, the price of Bitcoin, power consumption caused by a lot of problems, need to calculate good counting.

Blockchain QuickStart (vii)-Bitcoin

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.