Ardor Lightweight Contracts: Since Existing Smart Contracts Are Not So Smart

Advertisement

This is a submitted sponsored story. CCN urges readers to conduct their own research with due diligence into the company, product or service mentioned in the content below.

One thing has held true for more than five years – while the market goes up and down and over-funded market leaders delay upgrades, the teams behind Bitcoin, the first cryptocurrency, and NXT, the first pure proof of stake cryptocurrency, continue to quietly release innovative blockchain solutions at astoundingly fast rates.

Lightning Network has launched and grown to some 4000 nodes. Meanwhile, in January 2018, Jelurida, the company incorporated by the developers of NXT, launched the first live multi-chain full blockchain as a service platform, Ardor, to address issues of scalability, bloat, and interoperability. In August, Jelurida made their groundbreaking smart contract framework, Lightweight Contracts, available on the Ardor testnet, with a mainnet ETA of early 2019.

The Limits of Smart Contracts 1.0

Currently, well-known smart contract frameworks on the blockchain suffer from basic early development challenges, preventing them from becoming reliable tools for mainstream business adoption. Key shortcomings of existing frameworks can be summarized by five challenges:

  1. Contract life cycle management – Find a security bug? Good luck re-deploying.
  2. 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.
  3. 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.
  4. New coding languages – Solidity and RIDE 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.
  5. 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.

Lightweight Contracts: Smart Contracts 2.0

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:  

  1. 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.
  2. Sponsored Fees – Transaction fees can be sponsored by the app and service owners using customized “bundlers,” thus relieving the end users from the burden of dealing with cryptocurrency. They just use your service and you handle the fees on the backend.
  3. External Integrations – Interfacing with external systems, like cloud services and game engines, is enabled and encouraged.
  4. 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?

Hashed Secrets: Repurposing Existing Solutions to Solve Single Node Trust Issues

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.

Learn More

Documentation for the Ardor platform and its lightweight contracts can be found on the Ardor Learning Hub. Additionally, three coding challenges with a total $21,000 in prizes were announced in October to encourage testing of Lightweight Contracts. Developers are competing to automate the process of currency exchanges, cloud data storage and streaming, and blockchain based reputation management systems. To participate, check the submission requirements and deadlines on the Ardor Online Hackathon website.