Lity¶
This documentation for Lity is still work-in-progress.
Overview¶
Lity is an open-source language enhanced from Solidity. With new grammar extension, it is highly optimized for enterprise and easy to use for financial industry developers. The flexible interface and unlimited built-in functions can reduce gas cost and accelerate executing time. You can now encrypt large-sized data in the blink of an eye without running out of gas anymore.
How Lity Enhances Security¶
With ERC Checker and Overflow Protection.
How Lity Improves Performance¶
With Ethereum Native Interface (ENI).
See libENI on Github and the libENI documentation.
Lity by Example¶
Here we will provide a contract example and explain a little bit.
pragma solidity ^0.4.23;
contract ReverseContract {
function reverse(string input) public returns(string) {
string memory output = eni("reverse", input);
return output;
}
}
Contents¶
Getting Started with Lity¶
See the documentation for how to download and install Lity.
Use Lityc to Secure Your Contract¶
Some instructions to use ERC checker and overflow protection.
Use ENI in Your Contract¶
How to Download Lity¶
Build from source¶
git clone https://github.com/CyberMiles/lity.git
cd lity
mkdir build
cd build
sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev
cmake ..
make
./lityc/lityc --help
What’s Special About Lity¶
Better Security¶
Make your contract more secure with
ERC Checker¶
Overflow Protection¶
In order to prevent crypto token leak incident like BeautyChain(BEC), Lity offers automatic overflow free guarantee by Lity compiler or Lity’s Ethereum virtual machine(EVM). In either solution, an integer overflow would cause the contract execution fail. So contract programmers do not need to worry about overflow detection anymore.
See here for more details.
More Flexibility¶
Provide more flexibility for your EVM with
Ethereum Native Interface¶
Conventional Smart contracts are compiled to Ethereum byte codes and then executed on EVM. This works well for simple smart contracts. However, for complex contracts such as RSA encrytion/decryption, it is too slow and costs too much gas so that many applications are not feasible. Therefore, we develop a native interface for EVM, called Ethereum Native Interface(ENI).
Smart contracts can call native libraries to speed up execution and save much gas. So performance bottleneck due to EVM can be resolved. Native library are installed with EVM and updated over the air(OTA). See here for more details.
Note that new ENI operations are added without recompiling EVM, rather than pre-compiled contracts.
Business Rule Engine¶
Lity Rule Language¶
Lity incorporates rule language(like Drools and Jess) into smart contract. The rules engine shall match patterns(facts) to rules, and resolve potential conflicts. See Lity rule language for reference. Lity’s rule grammar is very similar with Drools.
This feature is compatible with official Ethereum Virtual Machine. Because, Lity directly compiles rule language into official EVM byte code.
Check the tutorial for writing Lity rules.
Documentation¶
Beginner’s Guide¶
Developer’s Guide¶
How to Contribute¶
Help is always appreciated!
This document briefly explains the process to report an issue or submit a pull request.
See the contribution guidelines in the Solidity documentation for more information.
Report an Issue¶
Please provide the following information as much as possible.
- The version (commit-ish) your using.
- Your platform, environment setup, etc.
- Steps to reproduce the issue.
- Your expected result of the issue.
- Current result of the issue.
Create a Pull Request¶
- Fork from the lity branch.
- Avoid to create merge commits when you update from lity by using
git rebase
orgit pull --rebase
(instead ofgit merge
). - Add test cases for your pull request if you’re proposing new features or major bug fixes.
- Build and test locally before submit your pull request.
- Respect the coding style for this project.