Does EOSIO Have Native Contracts Built-Into Protocol Layer?

EOS.IO Asked by mashup on January 5, 2022

On the Bitshares site I read

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!

Related Questions

List of available datatypes for action parameter

4  Asked on January 16, 2021 by eclipse


Does EOS support signing a string?

2  Asked on December 23, 2020


Can we use mongodb store state?

1  Asked on November 28, 2020 by user2644


Profiling EOS.IO smart contract code

1  Asked on August 11, 2020 by yogev-mashiach


Ask a Question

Get help from others!

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