The contradiction between decentralization and smart contract
the first step is to register (open an account) and set the password. The second step is user authentication (KYC). The third step is to recharge. Here comes the key. The third step is the most important. Because you need to charge money to your address in the exchange before you can trade money in the exchange. The address of the exchange is actually a wallet address, but the ownership of the wallet is not the user, but the exchange, that is to say, the private key of the address, you don't have it!!! Do you understand the meaning
well, after recharging, the transaction is finished. The user submits the instruction (hanging order) to the server, and then the exchange will be responsible for matching the transaction, which is exactly the same as the stock. The last is cash withdrawal (withdrawal of currency). Users can send instructions to transfer the currency from the exchange address to their wallet address. The above is the trading mechanism of the centralized exchange. In these steps, all actions will have costs. No matter you recharge, trade or withdraw money, gas and handling charges can't escape
then let's look at the decentralized exchange. The trading mechanism is different from the centralized exchange. The first step is to register (open an account) and set the password. It doesn't make any difference. But then it's a little different. KYC is not used. But because there is a private key, the ownership of this address is completely controlled by the user. The second step is recharging. This is not very different from the centralized exchange. You still have to make your own gas
after recharging, we can also trade in the decentralized exchange. Users can also register orders, and exchanges will also be responsible for matching transactions, but the matching is done by smart contracts. Finally, cash withdrawal (withdrawal of currency) is initiated. After withdrawing currency, users can directly transfer the currency from the address of the exchange to their wallet address. This step is the same as that of the centralized exchange
the above is the trading mechanism of centralized and decentralized exchanges, and the difference between them is also obvious. Because all currencies in the central exchange are under its control, the trading efficiency is very high, and it is similar to the stock trading process, convenient and suitable for most users. Conversely, the risk lies in this. If the exchange itself loses its integrity or is attacked by hackers, the user's capital (currency) is not guaranteed
all the transaction processes of decentralized exchanges are completed by smart contracts, so the transaction efficiency is relatively low (TPS of blockchain technology has always been a soft rib), but relatively, the capital (currency) is completely in the hands of users, so the security is relatively high. In addition, there are also KYC, where KYC is needed for centralization, but not for decentralization, and the security of personal information is relatively high. Compared with the decentralized exchange, the advantages of the centralized exchange lie in the trading depth and the number of users, which are unmatched by the decentralized exchange
therefore, centralization and decentralization have their own advantages and disadvantages. It depends on the user's own choice. They like convenient, centralized, secure and decentralized.
There is an essential difference between Ethereum and bitcoin. What is the difference? Bitcoin defines a set of currency system, while Ethereum focuses on building a main chain (which can be understood as a road) to allow a large number of blockchain applications to run on this road
from this point of view, Ethereum's application scenarios are more extensive, which is why we say that Ethereum marks a simple monetary system in the era of blockchain
1.0, and a transformation to other instries and application scenarios in the era of blockchain 2.0
however, there is no perfect thing in the world. Although Ethereum has expanded the application scope of blockchain in all walks of life and improved the speed of transaction processing, it also has some disputes and doubts
first, the solution to the lack of scalability of Ethereum: slicing technology and lightning network
the bottom design of Ethereum, the biggest problem is that Ethereum has only one chain and no side chain, which means that all programs have to run on this chain equally, consuming resources and causing system congestion. Just like last year's very popular Ethereum game "encryption cat", when this game was very popular, it once caused Ethereum network paralysis
to improve the processing capacity, Ethereum proposes two ways: shard and lightning network. Let's introce these two technologies respectively
(1) fragmentation technology
vitalik buterin, founder of Ethereum, believes that the reason why mainstream blockchain networks such as bitcoin process transactions very slowly is that every miner has to process every transaction in the whole network, which is actually very inefficient. The idea of fragmentation technology is: a transaction does not need to be processed by all nodes in the whole network, as long as some nodes (miners) in the network are allowed to process it. Therefore, Ethereum network is divided into many pieces. At the same time, each piece can handle different transactions. In this way, the network performance will be greatly improved
however, the slicing technology is also controversial. As we all know, the important idea of blockchain technology is decentralization. Only when the whole network witnesses (processes) the same transaction can it have the highest authority. The Ethereum slicing technology is similar to the group witness, not all nodes witness together. In this way, it will lose the absolute "decentralization" attribute, and can only achieve the purpose of high performance by sacrificing certain characteristics of decentralization
(2) lightning network
lightning network uses the way of transaction under the chain. What does that mean? It means: when the participants of lightning network transfer money to each other, they do not need to confirm the transaction through the main chain of Ethereum, but create a payment channel between the participants and complete it under the chain
however, lightning network is not separated from the main chain. Before establishing a payment channel, you need to use the assets on the main chain as collateral to generate a balance proof, which indicates that you can transfer the corresponding balance. In the case that both parties of the transaction hold the balance certificate, both parties can make unlimited number of transfers under the chain through the payment channel
only when the off chain transaction is completed and the assets need to be transferred back to the chain, the balance change information of the main chain account will be registered on the Ethereum main chain, and no matter how many transactions occur ring this period, there will be no record on the main chain
another real benefit of lightning network is that it can save the cost of miners for you. At present, when we trade on the main chain of Ethereum, we need to consume gas and pay for miners. Once we move the transaction to the lower chain, we can save this part of the cost
Of course, lightning network is not perfect. When using the lightning network, the assets on the main chain should be used as collateral; And this part of assets as collateral can not be used before the user completes the transaction under the chain. This also determines that lightning trading is only suitable for small transactionsthe above is the problem of insufficient scalability of Ethereum, as well as the two main solutions: fragmentation technology and lightning network
Second, there are loopholes in Ethereum's smart contract and the infamous Dao event
Ethereum's smart contract is very powerful, but there are loopholes in any code. The biggest controversy of Ethereum's smart contract lies in the so-called loopholes, that is, security issues. According to relevant research, 34200 (about 3%) of the nearly 1 million smart contracts based on Ethereum contain security vulnerabilities, which will allow hackers to steal eth, freeze assets or delete contracts, such as the infamous Dao incident
(1) what does Dao meanbefore introcing the Dao event, let's first introce what Dao is. Dao is the abbreviation of decentralized
autonomous organization, which can be understood as decentralized autonomous organization. From the perspective of Ethereum, Dao is a kind of contract or a combination of contracts on the blockchain, which is used to replace the government's review and complex intermediate proceres, so as to achieve an efficient and decentralized trust system. Therefore, Dao is not a specific organization, that is to say, there can be many Dao, all kinds of Dao
(2) the infamous Dao event
however, when we talk about Dao now, we basically refer to the Dao event, that is, the infamous hacker attack event we just mentioned. As we know, the English word "the" refers to "the Dao event". The Dao event
refers to "the Dao event", because we just said that Dao is not a specific organization, there can be many Dao, all kinds of Dao
in 2016, slock.it, a German company focusing on "smart locks", launched the Dao project on Ethereum in order to realize decentralized physical exchange (such as apartments and ships). Since April 30, 2016, the financing window has been open for 28 days
unexpectedly, this Dao project is very popular. It raised more than US $100 million in just half a month. By the end of the whole financing period, it raised a total of US $150 million. Therefore, it has become the largest crowdfunding project in history. However, it didn't last long. In June, hackers took advantage of the loopholes in the smart contract to successfully transfer more than 3.6 million Ethernet coins and put them into a Dao sub organization, which has the same structure as the Dao. At that time, the price of Ethernet currency fell directly from more than $20 to less than $13
this event shows that there are loopholes in smart contracts, and once the loopholes are exploited by hackers, the consequences will be very serious. This is why many people criticize Ethereum and say that its smart contract is not smart
to solve this problem, many foreign companies begin to provide code audit services in order to solve the vulnerability problem of smart contract. From a technical point of view, some teams are currently testing smart contracts. Most of these teams are led by professors from Harvard, Stanford and Yale, and some of them have obtained investment from leading institutions
in addition to the problems of insufficient expansibility and loopholes in smart contracts, the controversy over Ethereum lies in the POS consensus mechanism it pursues, that is, the proof of equity mechanism. Under the proof of equity mechanism, if anyone holds more money and holds it for a longer time, he will get more "rights" (interests) and have the opportunity to get bookkeeping power, Bookkeeping can also be rewarded. In this way, it is easy to create the oligarchic advantage of "the stronger the stronger"
Another problem is the chaos of ICO. ICO is a common way to raise funds for blockchain projects, which we can understand as pre-sale. The outbreak of ICO projects on Ethereum has caused illegal activities such as fund allocation and money fraud under the banner of ICO, which has caused security risks to social and financial stability& quot; A smart contract is a set of promises defined in digital form, including the agreements on which the contract participants can execute these promises& quot;
let's explore the meaning of his definition in more detail
commitment
a set of commitments refers to the (often mutual) rights and obligations agreed by contract participants. These commitments define the nature and purpose of the contract. Take a sales contract as a typical example. The seller promises to deliver the goods and the buyer promises to pay a reasonable price
digital form
digital form means that contracts have to be written into computer-readable code. This is necessary, because as long as the participants reach an agreement, the rights and obligations of smart contract establishment are executed by a computer or computer network
to further explain:
(1) when will the parties to the smart contract reach an agreement? The answer depends on the specific smart contract implementation. Generally speaking, the contract is discovered when the parties are committed to the execution of the contract by installing the contract on the contract host platform< (2) contract execution
& quot; Execute & quot; And the real meaning of it also depends on implementation. Generally speaking, implementation means active implementation through technical means
(3) computer readable code
in addition, the contract needs specific & quot; Digital form & quot; Very much depends on the agreement that the parties agree to use
protocol
protocol is technical implementation, on this basis, the contract commitment is realized, or the contract commitment is recorded. Which agreement to choose depends on many factors, the most important of which is the nature of the assets being traded ring the performance of the contract
take the sales contract as an example. Suppose that the participants agree to pay in bitcoin. The chosen protocol will obviously be bitcoin protocol, on which the smart contract will be implemented. Therefore, the contract must use & quot; Digital form & quot; It's bitcoin scripting language. Bitcoin scripting language is a non Turing complete, imperative, stack based programming language, similar to forth.
The decentralization of blockchain refers to the form of social relations and content generation formed in the process of blockchain development. It is a new network content proction process relative to "centralization"
blockchain is an important concept of bitcoin, which is essentially a decentralized database. At the same time, as the underlying technology of bitcoin, it is a series of data blocks generated by using cryptographic methods. Each data block contains the information of a batch of bitcoin network transactions, which is used to verify the effectiveness of its information (anti-counterfeiting) and generate the next block
blockchain is unified in the whole network, so it is logically centralized. From the perspective of architecture, blockchain is based on peer-to-peer network, so it is decentralized. From the perspective of governance, blockchain makes it difficult for a few people to control the whole system through consensus algorithm, so it is decentralized
extended data:
characteristics of blockchain Decentralization:
decentralization, not without the center, but by the node to freely choose the center, freely determine the center. In short, centralization means that the center determines the node. The node must depend on the center, and the node cannot survive without the center
in a decentralized system, anyone is a node, and anyone can be a center. Any center is not permanent, but phased, and no center is mandatory for nodes
with the diversification of network service forms, the decentralized network model becomes more and more clear and possible. After the rise of Web2.0, the services provided by Wikipedia, Flickr, blogger and other network service providers are decentralized. Any participant can submit content, and Internet users can create or contribute content together
reference source: network blockchain
reference source: Network decentralization
three characteristics of smart contract in blockchain can be summed up:
1) decentralization. It doesn't rely on the centralized server and runs automatically through the network nodes
2) good trust mechanism. The crisis of trust is greatly reced, and it is not necessary to consider whether the participation is trustworthy
3) high degree of autonomy. Once the condition is triggered, the contract will be executed automatically without interference
however, the centralized platform mode pursued by the giant will constantly encroach on the participants in the platform, squeeze the living space of small and medium-sized businesses, and destroy the healthy development of the whole instry order. Fundamentally speaking, it is not suitable for dealers to enter, and it is not concive to building a harmonious and symbiotic ecosystem
"it's not appropriate or long-term to hand over our channels, lifeblood and resources to several giants." Instry professionals said, "all brands and retail enterprises should be clearly aware of: the proct or scene is yours, the user is yours, the operation and marketing are all done by you, and the data should also be yours. You are not going to settle in a certain platform, but to build your own garden."
at the same time, Ma Yufeng, the founder of cloud media, believes that the real value of decentralization lies in the construction of a shared and symbiotic intelligent closed-loop ecology, in which enterprises can play their own expertise and strengthen their main business. More importantly, this enabling form of sharing, symbiosis and win-win creation is concive to the intelligent upgrading of the whole instry at low cost, and is a great opportunity for dealers to seize.
e to the need to link transaction data and wait for miners to pack and broadcast transaction confirmation, the transaction speed of decentralized transaction is slow. The operation steps of decentralized trading platform are relatively complex, and the use threshold is higher. When it comes to the transaction of different blockchain assets, such as bitcoin and Ethereum, it needs more complex cross chain technology, and many decentralized trading platforms can't realize it, so the supported transactions are less than the centralized trading platform
celletf is a comprehensive application platform for defi (celletf. IO), which relies on the deployment of Ethereum public chain, including a number of smart contracts / protocols, passive bidding mechanism and ETF primary and secondary al market architecture. With only one site, it can embrace the unlimited possibilities of defi.
the smart contract based on blockchain technology can not only give play to the advantages of smart contract in cost efficiency, but also avoid the interference of malicious behavior on the normal execution of the contract. The smart contract is written into the blockchain in digital form, and the characteristics of blockchain technology ensure that the whole process of storage, reading and execution is transparent, traceable and tamperable. At the same time, a set of state machine system is constructed by the consensus algorithm of the blockchain, so that the intelligent contract can run efficiently.