Blockchain circle

One stop hot information platform

About us:

Blockchain circle provides the latest information about blockchain, digital currency, digital wallet, exchange, metauniverse, bitcoin, Ethereum, contract, financial management and so on, and always pays attention to the latest market...

Huolongguo Finance: types of blockchain smart contracts

Time : 19/03/2022 Author : kx5tf4 Click : + -
        As of January 2018, Ethereum has developed more than 200 applications (referred to as DAPP, in short, a smart contract on the blockchain). Anyone can create smart contracts and decentralized applications on Ethereum, and set up all the rules, transaction methods and state transfer functions they define. 1) Write smart contracts. Ethereum smart contract language solidity is a high-level language with syntax similar to JavaScript. It is designed to generate Ethereum virtual machine code by compiling. 2) Compile the source code of the smart contract to become executable code on Ethereum virtual machine (EVM). EVM is not a real virtual machine, but a code interpreter.
        Ethereum virtual machine is a completely independent sandbox. The contract code can be completely isolated from the outside and run inside EVM. EVM is distributed on the computers of each node, isolated from the rest of the main network, and does not affect the operation of the main blockchain during operation. 3) Deploy smart contracts. It is to store executable code on the chain through transaction and generate contracts. 4) Call contract. When calling a contract, you need to select appropriate functions and parameters. Calling a contract will involve changing the data state of the smart contract. The chain code in hyperledger fabric usually handles the business logic agreed by network members, so it is equivalent to "smart contract".
        The ledger in the proposed transaction can be updated or queried by calling the chain code. Considering certain permission, one chain code can be called by another chain code. If the calling and called chain codes belong to different channels, only the query is allowed to be read. In other words, the chain code called on different channels is only a query, and it will not participate in the status check and verification in the subsequent submission stage. The development of chain code generally uses go, Java and node JS implementation. Each chain code must implement a chain code interface to respond to the received transaction. There is a chain code interface stubbinterface in the chain code shim package, which can interact with the blockchain ledger, transaction context, caller certificate, etc.
        The methods that each chain code must implement are init and invoke. The init method is used to perform any necessary initialization, including application initialization. The invoke method is used to respond to various invoke transactions. EOS smart contracts communicate with each other through messages and shared memory databases (for example, as long as a contract is included in the read range with asynchronous transactions, it can read the status of other contract databases). The spam problem caused by asynchronous communication will be solved by resource limitation algorithm. For the issue of how to develop EOS smart contract, we believe that it is necessary to complete the corresponding program of the contract and upload it to the EOS platform.
        In terms of computer language, at present, smart contracts can only be developed in C + + and compiled into webassembly compatible executable programs. Because go language will support webassembly, smart contracts can also be written in go language in the future. In addition, some developers are connecting EOS to JavaScript virtual machine and python virtual machine, so in the near future, the development of smart contracts will not be restricted by C + +.
Previous:Xinhua Finance · inventory | top ten events in the blockchain industry in 2019
Next:No more

Related articles:

© 2005-2032 | Blockchain Circle & & All Rights Reserved    Sitemap1 Sitemap2 If there is infringement, please contact us at: