About WaykiChain’s Smart Contract

WaykiChain WICC
Aug 10, 2019 · 2 min read

A smart contract is a computer protocol intended to digitally facilitate, verify, or enforce the negotiation or performance of a contract. Smart contract based on blockchain technology supports programmable contract. With the advantages of decentralization, unalterable, transparent and traceable, smart contract is a set of consensus defined by the contract developers, which be published, stored, and executed on the chain. Users sign in with private keys to provide identification to be a consensus participant. The implementation process is atomic, and the results obtained are equivalent.

Contract Framework

WaykiChain uses Lua as the programming language to build up the contract framework.

Lua is a lightweight and extensible language which has been extensively used in game development, standalone scripting and database plug-ins. WaykiChain’s core functions are all developed by C/C++, and Lua code can be easily called by C/C++ code, or C/C++ functions can be called in reverse. As a programming language with low learning cost, good compatibility, high performance and security, Lua is an ideal language for building a smart contract framework.

The Lua 5.3 version of the virtual machine used in the framework designed a mylib library at the virtual machine level to open the interface to the contract layer, which follows the design of the Lua standard function library.

Different from common Lua virtual machines, smart contract code is executed on all nodes in the chain, including miner nodes and observer nodes. Therefore, the smart contract virtual machine does not support most of the Lua standard function libraries:

On the basis of characteristics of the blockchain, WaykiChain smart contract framework also has the following features: internal currency system, decentralized deployment and operation, free and transparent coding style. You can also check the input/output information of each contract transation through the JsonRpc interface or block explorer.

WaykiChain WICC

Written by

The official medium of WaykiChain. Please visit us at http://www.waykichain.com/. Contact us at marketing@waykichainhk.com.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade