Ardor announced they are launching smart contracts on their system and how does it work compared to the other platforms like Ethereum, EOS, and Lisk?
First off, Lisk doesn't have full turing-complete smart contracts so there isn't much of a comparison on that front.
Key shortcomings of existing frameworks like Ethereum can be summarized by five challenges:
- Contract life cycle management – Find a security bug? Good luck re-deploying.
- Transaction fees – Want to use my service? First, you’ll have to buy some “gas,” in the form of cryptocurrency, to use to sponsor your transaction fees – no matter what service you are trying to use. This means there will be some crypto-tax implications for your end users.
- Integration with External Services – Want to leverage an existing database? Contracts are part of the blockchain consensus, which means they cannot interact with external systems like a cloud service or game engine.
- New coding languages – Solidity on Ethereum and RIDE on Waves are complex and relatively unknown to most experienced software developers, creating a substantial barrier to entry. There are also fewer reliable libraries and tools to leverage in the development process.
- Privacy – Looking to create verifiably replicable random numbers and store secret information? It’s either not possible, or incredibly complex.
This combination of factors has already led to numerous instances of user funds being locked up because of vulnerable smart contracts such as in the instance of the DAO and the Paritytech Wallet Freeze.
Lightweight Contracts on the Ardor platform offer a comprehensive solution to these issues. These new “stateless” contracts are written in Java, allowing developers to automate business processes on the blockchain in a comfortable coding language, while leveraging 250+ APIs to launch digital assets, marketplaces, voting systems, cloud storage solutions, messaging applications, and more. Reflecting on the issues of first-generation smart contracts, lightweight contracts address those issues of contract lifecycle management, transaction fees, integration with external systems, and random number generation as follows:
- Two Step Deployment – Contract code is deployed to child chains, such as Ignis, as a cloud data item, which stores a signed and time-stamped copy of the executable code on the blockchain, and a contract reference, which serves as a pointer from a specific contract runner account to the contract code, while defining setup parameters for the contract. This level of indirection simplifies contract upgrades- all developers need to do is deploy a new version of the contract and then gradually update existing references to it.
- External Integrations – Interfacing with external systems, like cloud services and game engines, is enabled and encouraged.
- Privacy – Random numbers can be generated in a reproducible method and secret information can be saved privately.
Lightweight Contracts are deployed on individual nodes, with optional verification and approval nodes reproducing results to ensure transparency and fairness. This provides a significant level of confidence in the output transactions of Lightweight Contracts, but what happens if a user sends a transaction to the node running a “contract runner” – and the node fails to execute the contract?
The trust problem lies at the core of all systems looking to deploy smart contracts on individual nodes. After several months of research, the developers at Jelurida finally found their solution by repurposing a lesser-known feature deployed on NXT back in 2015, known as phased transactions by hashed secrets. The basic idea is that funds sent by the user are not credited to the contract runner account. Instead, funds are held in a temporary escrow by the blockchain itself until the contract runner executes the contract and the user, after validating the resulting transaction, reveals the secret. As a result, the user transaction and the contract reply transactions are either both approved or both ignored and funds are unable to be permanently locked or stolen.
Documentation for the Ardor platform and its lightweight contracts can be found on the Ardor Learning Hub at ardordocs.jelurida.com. This response was modified from an article on CCN: https://www.ccn.com/ardor-lightweight-contracts-since-existing-smart-contracts-are-not-so-smart/