Principle of blockchain smart contract
In a narrow sense, blockchain is a kind of chain data structure that combines data blocks in a sequential way according to the time sequence, and it is a distributed account book that can not be tampered with and forged by means of cryptography
broadly speaking, blockchain technology is a new distributed infrastructure and computing method, which uses blockchain data structure to verify and store data, uses distributed node consensus algorithm to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses intelligent contracts composed of automated script code to program and operate data
working principle
blockchain system is composed of data layer, network layer, consensus layer, incentive layer, contract layer and application layer. Among them, the data layer encapsulates the underlying data blocks and related basic data and algorithms such as data encryption and timestamp; The network layer includes distributed networking mechanism, data transmission mechanism and data verification mechanism; The consensus layer mainly encapsulates all kinds of consensus algorithms of network nodes; The incentive layer integrates economic factors into the blockchain technology system, mainly including the issuance mechanism and distribution mechanism of economic incentives; The contract layer mainly encapsulates all kinds of scripts, algorithms and smart contracts, which is the basis of the programmable characteristics of blockchain; The application layer encapsulates various application scenarios and cases of blockchain. In this model, chain block structure based on timestamp, consensus mechanism of distributed nodes, economic incentive based on consensus computing power and flexible and programmable smart contract are the most representative innovations of blockchain technology
smart contract is a contract that uses computer language instead of legal language to record terms. Once it is written, it can be trusted by users. The terms of the contract cannot be changed, so the contract cannot be changed. If the procere meets the conditions, it will be carried out, and there is no human interference to ensure absolute fairness
three technical features of smart contract
● data transparency
all data on the blockchain are open and transparent, so the data processing of smart contract is also open and transparent, and any party can view its code and data at runtime
● can't tamper
all data of the blockchain itself can't be tampered, so the code of the smart contract deployed on the blockchain and the data generated by the operation can't be tampered, and the node running the smart contract doesn't have to worry about malicious modification of the code and data by other nodes
● permanent operation
the number of nodes supporting the blockchain network often reaches hundreds or even thousands. The failure of some nodes will not lead to the stop of the smart contract, and its reliability is close to permanent operation in theory, which ensures that the smart contract can be as effective as the paper contract at all times.
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
the principle of smart contract is the link between points, which exists in the physical and digital space, in the real world and the virtual world. It may exist in a certain space, or in two different spaces, which have natural links and are distributed, There is no centralization
for example, my account a has 100 yuan. After running contract B, it became 80 yuan. The contract is to change the status of 100 to 80. The contract itself is also an account, and external time (transaction, event) can trigger state transition.
1. Technology empowerment and cross-border cooperation
not only Xiaomi and Tencent, but also iFLYTEK has a developer's festival. IFLYTEK's open platform is open source technology, shared with 450000 entrepreneurs. Every day, 4 billion people use iFLYTEK's open technology, which is technology empowerment and cross-border cooperation. Mr. Liu Zihong is building the "flexible +" platform of Rouyu, which is also a typical example from technology enabling to cross-border cooperation
2. Be yourself and practice internal skills
What are we going to do? We should be ourselves and practice our internal skills. As long as you make the best of what you are good at, you will have "core competitiveness". In the past, it was said that we should make up for our shortcomings. Today, the shortcomings are not important. If everyone makes his own long board, he can make the container higher
when he was young, his parents wanted him to become a writer and painter, but his works were evaluated as "no room for shaping" by his teachers. Later, his chemistry teacher discovered his talent. After training, walach won the title of doctor of chemistry at the age of 22, and finally won the Nobel Prize in chemistry
everyone has his own short board. As long as he finds his best position in life and gives full play to the potential of the long board, he can achieve the most amazing results, which is the "Wallach effect". This is the way to be a person, an enterprise and an investment
let me give you an example. There is an investor in Shenzhen who has invested in the consumer instry for more than ten years. He has invested in Zhou Heiya, Baiguoyuan and Naixue's tea projects. Although he is famous today, more than ten years ago, everyone thought that the things he invested in had no room for imagination, and PE was very low, that is, he opened a shop to do business. But he persisted, and has been doing insight, understanding, and research in this instry to invest in projects. Up to now, he has become the top investor in the field of consumption, and has gained in-depth thinking of the instry. This person is Feng Weidong, the managing partner of Tiantu investment
it needs to be hard to forge iron. If you do it well, everything will follow, facing the heart and blooming in spring. To be good at yourself is the most powerful thing
3. Quality revolution and ingenuity return
why does Japan have such a good consumer service instry? Because Japan's economy has been in a downturn for a long time, and the Japanese market is very small, everyone has the opportunity to stand out and be bought by consumers only when they make their procts the best
some people say that it is a good time to get the bottom of the stock market and the real estate market, but I think it is also a very good time to get the bottom of the life. Chen Biao, a senior journalist, once said that we should not forget why we started just because we have gone too far. In today's adjustment period, we have the opportunity to calm down and think about why we want to start a business? What purpose and effect do I want to achieve? Many people around me are already thinking about this
as an interesting example, since our company was founded nearly three years ago, I have not been able to recruit a particularly good editor, because the first group of editors went to Party A as a brand, and Party A had more money and less work; The second group, because we media has risen, many people have gone to work in US media. Now we media is nothing but chicken feathers, and few people can survive tenaciously; The third group of writers have gone to do blockchain media. In my understanding, many blockchain media are public relations media, but who makes it profitable. Later facts have proved that many of them have been shut down
in the face of a phased downturn today, when everyone is thinking about what I am best at, I think the quality revolution may be based on the return of ingenuity, and each of us should think about what we can do and what we can do well
I believe I can recruit a good editor in chief soon
4. Consensus mechanism, rule first
everyone is talking about blockchain today. I made a documentary about three or four years ago, the group dance of black bees. At that time, I was the only filmmaker of wildlife documentary in China. After shooting, because of its uniqueness, this work also won many awards. I would like to make this point: a bee is an insect, and a group of bees are mammals. The work of bees is unconscious and distributed, but the colony has formed an organic function and brought about the reproction of the population. Later, some people described blockchain as honeycomb thinking, which I very much agree with
from the hunting age to the workshop age, from the instrial age to the information age. Every progress of human society comes from the upgrading of cooperative relationship
blockchain has removed the transaction mode based on "organization" link and established the transaction mode based on "person" link. Blockchain technology + Tongzheng economy + community = instrial community. Instry + blockchain, based on the public account book, can make the information symmetry, trust symmetry, resource allocation, cost-effective management, and efficient capital flow of all cooperative entities in the instrial ecology, optimize the proction relations, and fully release the proctivity of workers
5. All things accelerate their evolution, and the only constant is change
why was I the only one who made wildlife documentary at that time? Because it doesn't make money, the price of this film is about 1 million yuan. I shot it for 700 days. After shooting, the company won a lot of awards, but it soon went bankrupt. Today, when I was making a commercial documentary, I didn't dare to do it with such a rhythm
some time ago, we photographed the short rent of piglets. They don't start a business for a long time. When they start a business, their benchmarking is airbnb; At the end of last year, his target was the hotel; Last week, when we went there to visit students, he said that we should do instrial Internet, from information flow to service flow
in this era, the only constant is change. There was a joke in the past that "the only constant for women is fickleness". In fact, in this era, I think the ability to deal with complex situations is one of the most important core competitiveness of founders. Change is to seek death, change is to wait for death. The person who chooses to seek death between seeking death and waiting for death must be an entrepreneur
Bill Gates once said: people always overestimate the changes in the next year and underestimate the changes in the next 10 years. Chen Chunhua once said: in the future, enterprises will only focus on growth rather than success, regardless of size. Xiaomi's Liu De also said: do a good job in this year and arrange for next year. I didn't expect to fall like this when I rang the bell. Zhang Liaoyuan of three squirrels also felt deeply about this: I don't set any goals now. I used to like setting goals, but today I only dare to set goals for next month
every year "I have guests" interviews 500 guests to learn about their cases. We have made nearly 100 programs, reaching 350 million high-end people. The theme of this season is "I have guests - the story of the reformer.". The story of death and posterity is particularly moving. Companies that have never been able to survive are not able to have the motive force of free growth
on the other hand, the guest university does not have the physical wall, nor the shackles of thinking. It has global pattern, seeking change and following reality, opening up knowledge, linking value, dynamic cognition and elite dialogue
it's very meaningful for us and students to go into each company and explore their ups and downs, to feel their changes, their ability to cope with changes, their ability to deal with crises, and to feel life and death with them
Jobs said that he was willing to exchange his life's wealth for the opportunity to talk with Socrates. That is to say, we are going to meet Socrates one by one. We are going to talk with Mr. Fang Hongbo of Midea about how they are going to upgrade from a home appliance benchmarking enterprise to an intelligent instry; Talk to Cai Xiaodong of aofei about how they have changed from a toy factory to an entertainment IP magnate; Talk with Uncle Kai about how they have become the first brand of children's ecation from audio programs; Talk with Mao Daqing about how real estate turns to entrepreneurial services; He also talked with Jiang Xipei of Far East Group about his four survival changes
6, the city is a super instrial community
instrial community is not only the development path that enterprises should take the initiative to explore, but also the development direction of the city. The concept of city that I know is not necessarily a city, but also a district, a small town or a province. Of course, given the concept of "smart city", the instrial community can do better
a benchmark is Shenzhen, where we live today. In 2017, about 70% of the intelligent hardware in China came from Shenzhen. Shenzhen has all the resources and conditions from hardware design to procts. A hardware entrepreneur from Silicon Valley yelled, "here we can find any raw material we want within one kilometer, which is impossible in the United States, Europe and anywhere in the world, because there is no Huaqiangbei in Shenzhen."
Shenzhen provides a very natural convenience for entrepreneurs. There are many great enterprises in Shenzhen, such as Huawei, oppo and youbiexuan. They are all brought up by the fertile land of Shenzhen. There are two kinds of entrepreneurs, Tianpai and Dipai. Tianpai is an Internet entrepreneur; Di Pai is more early entrepreneurs in Shenzhen. They open factories, have their own proction lines, and do things in a down-to-earth way
lack of instrial landing coordination, Internet, app and innovation are "castles in the air"; Lack of technological innovation and upgrading, "local entrepreneurship" will always be the labor force at the end of the instrial chain
only the combination of heaven and earth can we innovate and upgrade and create a better life for us& quot;
(1) smart contract will check the state of automata regularly and traverse the state machine, transaction and trigger condition contained in each contract one by one; The transactions that meet the conditions are pushed to the queue to be verified, waiting for consensus; Transactions that do not meet the trigger conditions will continue to be stored on the blockchain
(2) the transactions entering the latest round of verification will spread to each verification node. Like ordinary blockchain transactions or transactions, the verification node first performs signature verification to ensure the validity of the transaction; The transactions that pass the verification will enter the set to be agreed. After most verification nodes reach a consensus, the transaction will be successfully executed and the user will be notified
(3) after the transaction is successfully executed, the state opportunity of the smart contract determines the state of the contract. When all the transactions included in the contract are executed in sequence, the state opportunity marks the state of the contract as complete and removes the contract from the latest block; On the contrary, it will be marked as in progress and continue to save in the latest block until the next round of processing is completed; The whole transaction and state processing is automatically completed by the built-in intelligent contract system at the bottom of the blockchain, which is transparent and unchangeable.