How Lity Makes Programs Safer, a #CVM Mini-Series

Mark Brinkerhoff
CyberMiles
Published in
3 min readAug 20, 2018

Lity is set apart by, as previously mentioned in the first of our four-part series, a dynamically-extensible language, a compiler (Lityc), and CyberMiles’ own virtual machine (CVM) — all on the CyberMiles blockchain. As a superset of the Solidity language, it is more extensible, performative, and safe. How so?

  1. The Library + Ethereum Native Interface (libENI) dynamic virtual machine extension allows native functions to be added to the CVM on the fly, without stopping, forking or upgrading the blockchain.
  2. The Lity Rules Engine (coming soon) will allow formal business rules to be embedded in smart contracts, promising to drastically increase developer productivity and to reduce errors.
  3. The ERC checker not only checks but also automatically fixes common security bugs in smart contracts.

For the purpose of this exercise, let’s dive a little deeper into the security aspects of Lityc and CVM, those which make programs run more safely.

Take Advantage of Better Security
Our team has categorized known security issues with Ethereum Solidity smart contracts, extracted common coding patterns that lead to those issues, and installed checks for those patterns in both the Lity language compiler and CVM. We’ve taken proactive steps to safeguard against 95% of smart contract bugs that lead to money loss on Ethereum — bugs that are highly unlikely to occur in the first place on the CyberMiles blockchain.

Use Lityc to Secure Your Contract
Understanding the ERC checker and overflow protection is key to making proper use of Lityc.

The ERC checker is a Lity compiler facility, which ensures that smart contracts correctly comply to the ERC standards they claim to implement. Notably, in the ERC universe:

  • ERC20 is the most common token/coin issuance contract standard.

[Watch our ERC20 checker overview]

[See the ERC20 checker in action]

  • ERC223 is an enhancement to ERC20. It guards against inadvertent fund transfers to contract addresses, which is a common source of fund loss on Ethereum. (Incidentally, we recommend that all ERC20 contracts on CyberMiles conform to the ERC223 standard for better safety.)

[Watch our ERC223 checker overview]

[See the ERC223 checker in action]

  • ERC721 is the contract standard to issue non-fungible tokens.

[Watch our ERC721 checker overview]

[See the ERC721 checker in action]

  • ERC827 is another enhancement to make ERC20 easier and safer to use while maintaining compatibility with ERC20 tools.

[Watch our ERC827 checker overview]

[See the ERC827 checker in action]

  • ERC884 is a security token standard to issue stick certificates.

[Watch our ERC884 checker overview]

[See the ERC884 checker in action]

Integer overflow is one of the most common security issues in Ethereum smart contracts. Lity proactively eliminates the opportunities for integer overflow in smart contract code. How so?

  1. The Lityc checks for the use of SafeMath on integers. It throws warnings if integer operations are not wrapped around in SafetMath.
  2. The CVM detects integer overflow at runtime, and stops the contract execution with an error vs. continuing with the overflowed integer numbers.

Developed by The CyberMiles Foundation, Lity is released under GPL as a free software. Still interested? Then refer to our latest, most up-to-date documentation to get started today!

Additional Resources

--

--

Mark Brinkerhoff
CyberMiles

@5milesapp VP, comms. #ThinkBrink startup consultant. Co-founder, @GayForGood DFW. Former @SM_Dallas VP. Animal, movie, music lover. Raconteur. #TeamOverheard