News classification
Contact us
- Add: No. 9, North Fourth Ring Road, Haidian District, Beijing. It mainly includes face recognition, living detection, ID card recognition, bank card recognition, business card recognition, license plate recognition, OCR recognition, and intelligent recognition technology.
- Tel: 13146317170 廖经理
- Fax:
- Email: 398017534@qq.com
Intelligent contract in block chain
Intelligent contract in block chain
As a developer of a happy block chain platform, we are sometimes asked whether an intelligent contract in the ether workshop can take a multi chain path. I always replied: No, at least not at the moment.
But the smart contract speculation in the world with blockchain can come into fashion, why not before? The problem is that although we understand the three strong use cases of bitcoin block chain (source, record and light financing between companies), we have not yet found the equivalent of AI Fang intelligent contract.
This does not mean that people lack the idea of applying intelligent contracts. On the contrary, many of these ideas are almost impossible to accomplish. You see, when the smart people hear the word "smart contracts", their imagination often goes out of the air. They are associated with automated intelligent software to integrate into the world and use their data to scrape together.
Unfortunately, the ideal of intelligent contracts is far more secular than these:
An intelligent contract is actually a piece of code that is stored on a block chain, triggered by block chain transactions.
It reads and writes data in the block chain database. This is an intelligent contract. It's true. An intelligent contract is just a string of code that runs on a block chain with a strange name and affects each other in the form of the block chain state. What is code? The code can be Pascal, Python, and PHP. It's Java, it's a Fortran speech, and it's C++. If we talk about the database, it is a stored procedure written in the extended SQL. All these words are fundamentally equivalent and deal with the same type of problem of the same variety. Of course, every language has its advantages and disadvantages - you must be crazy to use C to set up a website or to tighten high definition video with Ruby. But at least on the yardstick, you can, just you want. You have paid a heavy price for convenience and performance.
The problem of intelligent contracts is not only the exaggeration of people's hopes. It's the hope that many people spend time and money on ideas that can't be done. It seems that a large company must have enough resources to experience a long road -- when the senior managers meet a new technology and really understand its advantages and limitations. Maybe our own experience can help to shorten this time.
In the past nine months, we have used many examples of intelligent contracts, and have found our own responses. Again and again, they are basically unable to do that. In the end, we have identified the most common misunderstandings of three intelligent contracts. None of these ideas are wrong, because the technology is not mature, or the tools are not available. Instead, they just misunderstand the fundamental nature of running the code in a database in a decentralized manner.
Contact external service
In general, the first use case proposes an intelligent contract that changes its behavior to respond to some external things. For example, in a given month, the agricultural insurance policy is based on the amount of rain. The process of imagination is about this: intelligent contracts wait for scheduled time to retrieve weather forecasts from external service, and stop proper behavior based on the data received.
It all sounds simple, but it's not possible at the same time. Why? Because the block chain is a consensus based system, which means that every node will play a role only if it reaches the same state after every transaction has been disposed of. All this can only exist in the block chain that must be fully affirmed, without any possible difference in the attack. When two honest nodes disagree with the chain state, the whole system will become worthless.
Now in retrospect, intelligent contracts are performed independently by each node on the chain. Thus, if an intelligent contract retrieves some information from an external source, it is repeatedly retrieved and executed by each node. However, because the information source is outside the block chain, it is not guaranteed that each node will accept the same answer. Perhaps the information source will change the response time it entrees between different nodes, or it will become a state that is temporarily unavailable. In any way, once the consensus is broken, the entire block chain system will be paralyzed.
So, is there any way to deal with it? In fact, it's very simple. Alternative intelligent contracts initiate external data retrieval and embed data in the business chain in the creation of one or more trust parties ("database"). Each node has a complete and identical copy of the data, so it can be used safely in an intelligent computing contract. In other words, it is much better to push data from a database to a block chain than to drag data out of an intelligent contract.
When smart contracts touch the outside world, there are similar problems. For example, many people like the idea of a call to a bank API to complete a transfer in an intelligent contract. If each node executes the code in the chain independently, who is calling the program interface? If the answer is a node, if the node specific fault what will happen, you can in a leisurely manner? If the answer is each node, can we trust the password for each node with the interface? Do we really want this program interface to be called hundreds of times? Worse, if the demand for intelligent contracts knows whether the interface calls can win, we are back on the issue of relying on external data.
Like the original, there is a simple way to deal with it. Instead
But the smart contract speculation in the world with blockchain can come into fashion, why not before? The problem is that although we understand the three strong use cases of bitcoin block chain (source, record and light financing between companies), we have not yet found the equivalent of AI Fang intelligent contract.
This does not mean that people lack the idea of applying intelligent contracts. On the contrary, many of these ideas are almost impossible to accomplish. You see, when the smart people hear the word "smart contracts", their imagination often goes out of the air. They are associated with automated intelligent software to integrate into the world and use their data to scrape together.
Unfortunately, the ideal of intelligent contracts is far more secular than these:
An intelligent contract is actually a piece of code that is stored on a block chain, triggered by block chain transactions.
It reads and writes data in the block chain database. This is an intelligent contract. It's true. An intelligent contract is just a string of code that runs on a block chain with a strange name and affects each other in the form of the block chain state. What is code? The code can be Pascal, Python, and PHP. It's Java, it's a Fortran speech, and it's C++. If we talk about the database, it is a stored procedure written in the extended SQL. All these words are fundamentally equivalent and deal with the same type of problem of the same variety. Of course, every language has its advantages and disadvantages - you must be crazy to use C to set up a website or to tighten high definition video with Ruby. But at least on the yardstick, you can, just you want. You have paid a heavy price for convenience and performance.
The problem of intelligent contracts is not only the exaggeration of people's hopes. It's the hope that many people spend time and money on ideas that can't be done. It seems that a large company must have enough resources to experience a long road -- when the senior managers meet a new technology and really understand its advantages and limitations. Maybe our own experience can help to shorten this time.
In the past nine months, we have used many examples of intelligent contracts, and have found our own responses. Again and again, they are basically unable to do that. In the end, we have identified the most common misunderstandings of three intelligent contracts. None of these ideas are wrong, because the technology is not mature, or the tools are not available. Instead, they just misunderstand the fundamental nature of running the code in a database in a decentralized manner.
Contact external service
In general, the first use case proposes an intelligent contract that changes its behavior to respond to some external things. For example, in a given month, the agricultural insurance policy is based on the amount of rain. The process of imagination is about this: intelligent contracts wait for scheduled time to retrieve weather forecasts from external service, and stop proper behavior based on the data received.
It all sounds simple, but it's not possible at the same time. Why? Because the block chain is a consensus based system, which means that every node will play a role only if it reaches the same state after every transaction has been disposed of. All this can only exist in the block chain that must be fully affirmed, without any possible difference in the attack. When two honest nodes disagree with the chain state, the whole system will become worthless.
Now in retrospect, intelligent contracts are performed independently by each node on the chain. Thus, if an intelligent contract retrieves some information from an external source, it is repeatedly retrieved and executed by each node. However, because the information source is outside the block chain, it is not guaranteed that each node will accept the same answer. Perhaps the information source will change the response time it entrees between different nodes, or it will become a state that is temporarily unavailable. In any way, once the consensus is broken, the entire block chain system will be paralyzed.
So, is there any way to deal with it? In fact, it's very simple. Alternative intelligent contracts initiate external data retrieval and embed data in the business chain in the creation of one or more trust parties ("database"). Each node has a complete and identical copy of the data, so it can be used safely in an intelligent computing contract. In other words, it is much better to push data from a database to a block chain than to drag data out of an intelligent contract.
When smart contracts touch the outside world, there are similar problems. For example, many people like the idea of a call to a bank API to complete a transfer in an intelligent contract. If each node executes the code in the chain independently, who is calling the program interface? If the answer is a node, if the node specific fault what will happen, you can in a leisurely manner? If the answer is each node, can we trust the password for each node with the interface? Do we really want this program interface to be called hundreds of times? Worse, if the demand for intelligent contracts knows whether the interface calls can win, we are back on the issue of relying on external data.
Like the original, there is a simple way to deal with it. Instead