TransWikia.com

Does EOSIO Have Native Contracts Built-Into Protocol Layer?

EOS.IO Asked by mashup on January 5, 2022

On the Bitshares site I read https://bitshares.org/technology/industrial-performance-scalability

Based upon the lessons we learn from LMAX, we know that a virtual machine for a blockchain should be designed with single-threaded performance in mind. This means it should get optimized for Just-In-Time compilation from the beginning, and that the most frequently used smart contracts should be supported natively by the blockchain, leaving only the rarely-used custom contracts to run in a virtual machine.

They specifically highlight

most frequently used smart contracts should be supported natively by
the blockchain,

How does this concept (of native contracts) work in EOS, if at all since it is built on wasm? Has Larimer implemented similar design philosophies, how?

And how does this differ to other implementation as seen in Ethereum.

One Answer

As you mentioned, the contracts including the most of the system contracts are built in wasm which is an assembly language. You can find their c++ code at github.

Some of the most frequently AND most fundamental system functions (such as setcode, linkauth and so on...) are built in c++. You can find them in `libraries/chain/eosio_contract.cpp'.

The interesting thing about them is that they trigger action by building a transaction class with c++ language and handing it over to action handler as if it was received from outer-chain just like other ordinary actions.

Answered by Jinu on January 5, 2022

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP