Tutorial Seminar on Turing-complete Lightweight Contracts

This tutorial seminar on Turing-complete Lightweight Contracts featuring Lior Yaffe, core developer of Ardor was filmed at the Danube Game Jams in August, 2018 when the revolutionary approach to smart contracts was added to the Ardor Blockchain Testnet for developers to begin using.

Lightweight Contracts will be available at the Ardor Mainnet on block height 543000 which is expected on January 10, 2019. This technical overview will still apply and is helpful to anyone wishing to understand or deploy a Lightweight Smart Contract.

Index of Topics and Timestamps:

  • 0:00 Introduction
  • 1:18 Start of the Seminar
  • 2:31 Skill and Software Requirements for Developing Lightweight Contracts
  • 3:30 Next Steps: Updating Ardor blockchain and Opening your IntelliJ IDE project
  • 4:22 What is included in the Ardor software package?
  • 5:20 Best Practice: Unit Tests for each Contract
  • 5:40 Get Started With Basic Sample Contracts
  • 6:15 ContractSuiteRunner
  • 6:30 2-step Process for Deploying Lightweight Contracts to the Blockchain: Contract Manager Utility
  • 7:50 Executing Contracts on the Blockchain: Contract Runner and Triggers
  • 8:36 4 Ways to Trigger Contracts: Trigger Transactions
  • 9:45 What Happens with the “Hello World” Sample Contract? Messaging
  • 9:59 What Happens with the “Random Payments” Sample Contract? Randomization
  • 10:40 4 Ways to Trigger Contracts: Block Trigger
  • 10:55 4 Ways to Trigger Contracts: Voucher Trigger
  • 11:37 4 Ways to Trigger Contracts: Trigger by API
  • 11:59 Benefits of LWCs – No Systematic Risk to Network
  • 12:25 Benefits of LWCs – No Contract Metering or Gas
  • 12:40 Overview of the Context Object: Your Interface with the Blockchain
  • 13:56 Lightweight Contracts are Stateless – What does this mean?
  • 14:20 Best Practice on Contract Design
  • 14:59 Parallel Contracts
  • 15:08 Versioning and Upgrading Contracts
  • 15:50 No Costly Data Migration
  • 16:00 Integration with Java Libraries
  • 16:28 Oracle Contracts and External Integration
  • 18:03 Security of Lightweight Contracts
  • 19:01 Risk Mitigation #1: Expired Transactions
  • 20:30 Risk Mitigation #2: Block Trigger on Forks – Double Spend
  • 21:54 Risk Mitigation #3: Trusting a Single Node
  • 22:51 Basic Mitigation: Verification Nodes
  • 24:00 Advanced Mitigation: Account Control and Approval Nodes
  • 25:30 Risk Mitigation #4: Trusting a Contract Runner Node to Execute
  • 26:27 Conclusion