Ethereum 2.0 vs Symbol (Part 3): Smart Contracts and Plug-Ins

While Ethereum smart contract is like Play-Doh, Symbol plugins are like Lego.

Ivy Fung
Coinmonks
Published in
7 min readJan 31, 2021

--

Contrary to what most people are advocating, I believe comparison brings out the best in both parties. It is a matter of perspective.

What is Ethereum Smart Contracts?

Source: https://medium.com/@alexlwitt/why-blockchain-is-the-yin-to-ais-yang-7aeb84a062ae

When Ethereum started in 2015, it was regarded as Blockchain 2.0 with the introduction of Smart Contract.

What is a smart contract actually? According to ethereum.org, “it is a collection code and data that resides at a specific address on the Ethereum blockchain.” Once all criteria are met, the code will execute by itself.

There are 2 types of accounts in the Ethereum platform. One type represents a user, and the other one represents a smart contract. They both hold a balance and can send transactions over the network. While the user account is controlled by the user who holds the private key, a smart contract account does not have a private key and is triggered by a transaction sent by a user account.

Instead of a distributed ledger, Ethereum is a distributed state machine.” To alter the state of an account, one needs to send a transaction to the network, including deploying a smart contract. Anyone can code a smart contract with Solidity or Vyper. The question is, “Is it bullet-proof?”

The Smart Contract Challenges

According to Cambridge Dictionary, “smart” has the meaning of using computers to make something works in an independent way. And “contract” means a legal document that states and explains a formal agreement between two (or more) different people or groups. Smart Contracts are all of the above except it is not 100% independent and not really enforceable by law, yet.

They’re not smart. They’re not contracts. — David B. Black

Smart contracts on EVM (Ethereum Virtual Machine) can run arbitrarily any logic as EVM is Turing-complete. With the implementation of a smart contract, 2 or more parties can trust each other without using a trusted third party. This greatly reduces the time and cost of executing a contract. A very simple example, Alice wants to get access to an online programme from Bob. Normally, they will use a reseller that would ensure Alice pays and Bob delivers. With a smart contract, both parties do not need to worry if one party not complying as the swap of ownership is done automatically. (Of course, the application can be much more complicated than this but we are not going into use cases discussion here.)

Sometimes, your strength is your weakness. Ethereum’s Solidity is not difficult to learn but difficult to master. It is difficult to master, in my opinion, mainly due to Ethereum’s Turing-completeness, not Solidity itself.

  1. All computations of a DApp (Decentralised Application) happens on EVM. Once it is deployed, it is there forever as long as EVM lives. As Ivan on Tech puts it, “…as smart contracts are self-executing, it is crucial to find their security risks before a hacker does.” If there is a bug found after the smart contract is deployed, there is no way for you to rectify it. To neutralize the risks, it might cost you to deploy another smart contract. (You may read here and here for some examples of mistakes.)
  2. Even if the smart contract has no bug, an ad hoc basis is not allowed. In case Bob’s programme is having an issue and has to be stopped halfway through, there is no way Alice can stop the payment planned.
  3. As EVM runs in a distributed network, and your smart contract codes run on the EVM. It will run many times in thousands of computers, and it can be costly. If the codes run into an endless loop, the user who made the transaction call to the smart contract will find the account being drained.

Issue 2 can be mitigated by only using a smart contract for deterministic outcomes that any “what if” is negligible or having a more complicated logic. Issue 3 can be minimized by limiting funds in an account. As for issue 1, experienced developers and high-quality codes are very important and that’s why Solidity is hard to master.

The National University of Singapore (NUS) has uncovered several severe smart-contract bugs. As a result, an analysis tool called Oyente was created for scanning smart contracts. Out of the 19,366 Ethereum smart contracts they analyzed, 8,833 of them had bugs! (2018)

A good smart contract needs to be deterministic, terminable, and isolated.

Also, a smart contract is difficult to master due to the fact that blockchain itself is a big topic and quite tough to master. When developing an application for blockchain, DApp or not, we need to pay extra considerations on data structure, security, transparency, ease of use, and the cost incurred. These factors affect all blockchains. To reduce the transaction cost of calling a smart contract, another option is to have an off-chain or side-chain to aggregate transactions before submitting the result to the mainchain.

Symbol Plugins

Symbol is not a Turing-complete blockchain. It has the functions that are deployed as smart contracts in Ethereum loaded as its plugins.

Turing Incompleteness: A Turing Incomplete blockchain will have limited functionality and not be capable of making jumps and/or loops. Hence they can’t enter an endless loop. — blockgeeks.com

Sometimes, what seems to be a weakness can be a strength. It is because of its “Turing-incompleteness” that Symbol does not need to worry about transactions falling into endless loops.

Functions like multisignature, escrow services, naming services, tokenization and many more are pre-loaded as plugins in Symbol. Those functions have been thoroughly tested for their security.

Our contract framework makes Symbol more resilient to human error and network attacks. This provides flexibility and removes complexity, speeding up development and on-boarding time. — symbolplatform.com

The plugins pre-loaded to Symbol cover the necessary and common functions needed for building an application. With those plugins, you shall be able to build most applications needed. To call a function, you just need to send a transactions associate with it. If in any way you find some functions you needed are missing, you can build your own plugin and deploy it to Symbol blockchain. New plugins will need to be accepted into the Symbol blockchain. Any nodes in the network that opt not to adopt the configuration upgrade will fork.

The plugin approach allows developers to introduce different ways to alter the chain’s state via transactions without modifying the core engine or disrupting other features. — symbolplatform.com

A plugin needs to be written in C++, the language Symbol is written in. However, to use the available plugins, users only need to send a transaction to call the respective plugins. It can be done purely through codes and CLI or by using an application. To integrate an application with Symbol blockchain, the application can be written in any language. The integration will be done through API calls. This greatly reduces the time of developing and testing the application. It allows legacy applications to be integrated with Symbol blockchain without rebuilding the applications or retraining the users. The users might not even notice Symbol blockchain is running in the background.

Though it is not Turing-complete, deterministic actions like the case mentioned above between Alice and Bob earlier is executable in a decentralized manner with Symbol’s Aggregate Transaction plugin.

Symbol plugins are deterministic, terminable and isolated.

Which blockchain is better? It depends on what you are looking for. A fully decentralized application, or a more scalable and cost-effective one?

Cliche? Maybe. Choices. Isn’t that the reason for the availability of different blockchains?

While Ethereum smart contract is like Play-Doh, Symbol plugins are like Lego. Play-Doh can make models in any shape but more fragile while models made by Lego are with edges but more sturdy. Essentially, both can build anything.

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run,” — Roy Amara.

There are much more developments worth looking forward to. Watch this space and let’s witness the revolution together!

Special thanks to Anthony and David for reviewing this article.

References

  1. https://medium.com/thundercore/a-deep-dive-into-smart-contracts-ec446c27887f
  2. https://blockgeeks.com/ethereum-smart-contract-clients/
  3. https://blockgeeks.com/guides/different-smart-contract-platforms/
  4. https://academy.ivanontech.com/blog/defi-deep-dive-smart-contract-security
  5. Solidity Fundamentals https://ferdikurt.medium.com/
  6. https://ethereum.org/en/developers/docs/smart-contracts/
  7. https://www.forbes.com/sites/davidblack/2019/02/04/blockchain-smart-contracts-arent-smart-and-arent-contracts/?sh=5d16d06a1e6a
  8. https://medium.com/@lookfwd/solidity-smart-contract-development-is-very-hard-abe36d69414b
  9. https://docs.symbolplatform.com/concepts/plugin.html#extending-symbol
  10. https://github.com/nemgrouplimited/symbol-bootstrap/blob/main/config/node/resources/config-network.properties.mustache
  11. https://docs.symbolplatform.com/catapult-whitepaper/main.pdf

Join Coinmonks Telegram group and learn about crypto trading and investing

Also, Read

Get Best Software Deals Directly In Your Inbox

--

--

Ivy Fung
Coinmonks

On a mission to talk to everyone about Blockchain.