Blockchain Technology: An overview of NEO Smart Contract

July 3, 2019

Blockchain Technology has two major classifications: 1) A Smart Contract based ledger technology like Ethereum, NEO, Hpyerledger 2) A Pure Consensus ledger technology like Bitcoin. In this article, we intend to cover the basis of smart contract in Blockchain Technology and an overview of NEO Blockchain smart contracts.

What is Smart Contract?

A smart contract is a set of contractual obligations in digital form. This digital form includes the agreement on how contract participants shall fulfill these obligations. Blockchain technology gives a decentralized, non-tampering, highly reliable ledger system in which smart contracts are beneficial. Smart contracts are one of the critical components of blockchain technologies in existence today. They are also the reason why blockchains can be called disruptive technology.

What are the critical aspects of smart contracts in NEO Blockchain?

The NEO Smart Contract includes the following features: 1) Certainty 2)High performance, and 3) expandability. Application contracts, function contracts, and validation contracts are the type of smart contract in NEO.

For High performance, NEO uses the lightweight NeoVM (NEO Virtual Machine) as its execution environment for smart contract. It starts up very fast and takes up minimal compute resources. JIT (real-time compiler) technology are used for static compilation and caching of hotspot contracts can be significantly enhanced. The setup of the NEO virtual machine shows a cryptographic instruction procedure to optimize the execution efficiency of cryptographic algorithms in smart contracts. Also, data manipulation instructions provide support for arrays and complex data structures directly. All this combined will enhance performance in NEO Smart Contract.

NEO Smart Contract achieves a scalable approach through a combination of high concurrency and dynamic partitioning. The contract procedure is executed in the NEO virtual machine, and it communicates with the outside through the interactive service layer. Hence, the vast majority of upgrades to the smart contract function happens through the API layer.

NEO Smart Contracts can be written in a variety of programming languages

From the programming language point of view, the NEO Smart Contract is more intuitive than Ethereum: unlike the Ethereum Solidity language, the NEO smart contract can be used directly in any high-level programming language.

The first supported programming languages ​​are C#, VB.Net, F#, Java, and Kotlin. NEO provides compilers and plug-ins for all these programming languages. These compilers are used to compile high-level languages ​​into instruction sets supported by NEO virtual machines. The first compiler is MSIL (Microsoft intermediate language). Hence any .Net language and any language that is portable to MSIL are supported.

The languages that are currently supported are:

  • C#, VB.Net, F#
  • Java, Kotlin
  • Python
  • GO
  • JavaScript

With multiple-language support, a majority of developers can directly participate in the development of a NEO smart contract with their existing programing language expertise. There is no requirement to learn a new programming language. All existing business system code might even be directly ported to the NEO blockchain.

Additionally, traditional smart contracts are difficult to debug and test given lack of tool supports and access to clear instructions. NEO, however, provides significant support for debugging at the NEO virtual machine level, allowing you to develop NEO Smart Contract both more accessible and faster.

NEO Smart contract triggers:

There are two ways to trigger up smart contracts:

Contract User Authentication:
By this way, the smart contract is a contract account. Hence when the user requests to use the contract account in an asset, it triggers the smart contract action.

Manually call a smart contract:
By this way, the user sends a transaction (Invocation Transaction) to trigger the implementation of smart contract action.

NeoVM (Neo Virtual Machine)


NeoVM is the virtual machine which executes the NEO smart contract. In this context, the concept of a virtual machine is used in the narrow sense, not about operating systems or container programs like Hyper-V or VMWare.

NEO Officially provides a test net for development, debugging and testing activities. Users can also set up their private chain where they can operate more flexible with plenty of test tokens.

One of the following ways helps to set up your private chain:

1) Set up a private chain using virtual machines
2) Set up a private chain on a Windows host
3) Set up a private chain with one node using NEO-CLI 2.10.2 and the late version.

After a smart contract is deployed to the blockchain, other users can invoke it, or other contracts can also invoke it.

What contracts need to be deployed to NEO Blockchain?

When a smart contract is invoked by another smart contract (called app call), it needs to be deployed. Contracts triggered only by the verification trigger, such as the lock contract and multi-signature contract, do not need to be deployed as other contracts do not invoke them.

From the programming language perspective, only when a smart contract will be used as a class library, it needs to be deployed.

For example:
1) When a smart contract has incoming variable parameters, it must serve as storage. The Invocation transaction or other smart contracts provide the parameters.
2) When a smart contract uses storage and dynamic calls, it must serve as a class library.
3) When a smart contract implements standard assets, the contract needs to be deployed on the blockchain.

How to deploy?

Smart contracts are deployed by invoking API through an Invocation transaction. We recommend you use NEO-GUI to deploy smart contracts. Deploying and invoking smart contracts cost fees. Check the latest fees guide.

Warpup

Blockchain Technology applications are expanding and Smart Contracts are becoming a key component. NEO Smart Contracts are one of the versatile options from a programming standpoint. They are proven to consume a limited amount of GAS for their execution. NEO is one of the exciting blockchain choices available in the market with a growing community of developers.

P.S

  • Hurify operates the IoT Blockchain marketplace & BIAT vision as Hurify Digital Markets, Inc in the United States & HUR Technologies, UAB in Europe
  • Hurify partners with companies on technology and marketing opportunities. To partner with Hurify: Apply
  • Receive our blogs in an email: Check