Published on October 27, 2018
1. Demystifying Smart Contracts Bernard Peh (Founder - Whale Tech)
2. About Me 201 1 2013 2015 2017
3. Why Whale Tech? Whale Tech is an Australian Based Blockchain development and education company aiming to help the companies adapt to the new Blockchain revolution.
4. What is a Smart Contract? Smart: Digital automation. Disputes is enforced by code and immutable. Contract: an agreement between multiple parties which could be used as evidence should dispute between the parties arises.
5. We are living in the world of contracts We exchange services everyday. We make agreements - verbal, physical or digital.
6. Formula for a contract to work A contract requires 4 criteria in order to work: ● Identity verification ● Immutability Evidence ● Commitment by staking something of value to you ● Enforcement of rightful behaviour.
7. Blockchain + SC = Matchmate in Heaven ● Blockchain (aka DLT) - Identity and Immutability ● Smart contracts - Staking of value and Rules enforcement
8. The Blockchain Revolution “The technology of tomorrow has expired today.” •Blockchain 1.0: Store of value (Cryptocurrency). Eg Bitcoin, Ripple •Blockchain 2.0: Store of value and Smart Contracts (Distributed Apps or DAPPS in short). Eg Ethereum, EOS, Cardano, Neo •Blockchain 3.0: Store of value, Smart Contracts, IOT, AI, Scaling solutions and Inter-chain Operability.
9. 3 Types of Smart Contracts •Value to value: Exchanging one cryptocurrency to another (ICO, Atomic Swaps) •Value to Service/Service to Value: Paying a service with cryptocurrency. Example Smart City parking, parcel delivery, voting for the next president. •Service to service: Exchanging a service with another service. Example creating a website in exchange for free medical treatment.
10. Value to Value - Blockbid ICO
11. Value to Service - Uber Post
12. Service to Service - Labour exchange
13. Anatomy of a Smart Contract •What is the Purpose? •How to get Commitment from Parties Involved? •What are the Moving Parts? •What Constitute a Successful Outcome? •How to Validate Successful Completion of Task? •What Constitute an Unsuccessful Outcome?
14. Anatomy of a Smart Contract •What Happens After the Deal? •Any Punishment for Malicious Behaviour?
15. Upgradable Smart Contracts Unlike typical Software design, upgrading Smart Contracts poses many monetary and philosophical dilemma which puts a lot of stress on Smart Contract developers to get it right the first time.
16. Upgradable Smart Contracts •Pros: Save space. Efficient code. Bug fixes. •Cons: Break immutability law and decentralisation. What are people going to think if you have the ability to upgrade the business rules in the middle of an ICO?
17. The Dangers ● immeasurable success criteria ● Unexpected behaviours ● Unaudited code (writing test isn’t enough) ● Assets being hacked ● Assets being frozen
18. The Wins ● Automation: Saves time and money because there are no middle man. ● Nothing to hid. Contract is open for the public to scrutinise. ● Forces you to think of all possible outcomes and things that could go wrong. ● Forces you to define all conditions and play fair.
19. Blockchain + SC + IOT + AI at work ● Your washing machine has a part that needs repair. ● As your machine is also a node and connected to the internet, it is also connected to the Blockchain of the company. ● Your machine creates a Smart Contract onchain describing the problem and asks for repair quotes from different vendors also connected to the same Blockchain.
20. Blockchain + SC + IOT + AI at work ● Each vendor submits a quote and your Smart Contract chooses the best quote based on some intelligent criteria. ● The vendor comes to your house and repair the machine. ● If Machine is happy with the repair (working for the next 3 months), it will release the funds in the Smart Contract to the vendor.
21. Conclusion ● Plan well ahead before even before starting to code. Remember its not like building a website where you can tweak and patch all the time. ● All conditions in the Smart Contracts must be measurable and codable.
22. Conclusion ● KISS principle applies. Less ambiguity in successful/failure conditions -> lesser logic -> lesser code -> lesser chance to be hacked -> more smiling faces.