Implementing and Mechanically Verifying Smart Contracts

Size: px
Start display at page:

Download "Implementing and Mechanically Verifying Smart Contracts"

Transcription

1 Implementing and Mechanically Verifying Smart Contracts Ilya Sergey ilyasergey.net

2 Smart Contracts Stateful mutable objects replicated via a (Byzantine) consensus protocol State typically involves a stored amount of funds/currency One or more entry points: invoked reactively by a client transaction Main usages: crowdfunding and ICO multi-party accounting voting and arbitration puzzle-solving games with distribution of rewards Supporting platforms: Ethereum, Tezos, Zilliqa, EOS,...

3 contract Accounting { /* Define contract fields */ address owner; mapping (address => uint) assets; Mutable fields /* This runs when the contract is executed */ function Accounting(address _owner) { owner = _owner; } Constructor } /* Sending funds to a contract */ function invest() returns (string) { if (assets[msg.sender].initialized()) { throw; } assets[msg.sender] = msg.value; return "You have given us your money"; } Entry point msg argument is implicit funds accepted implicitly can be called as a function from another contract

4 contract Accounting { /* Define contract fields */ address owner; mapping (address => uint) assets; /* This runs when the contract is executed */ function Accounting(address _owner) { owner = _owner; } /* Sending funds to a contract */ function invest() returns (string) { if (assets[msg.sender].initialized()) { throw; } assets[msg.sender] = msg.value; return "You have given us your money"; } } function stealmoney() { } if (msg.sender == owner) { owner.send(this.balance) }

5 Misconceptions about Smart Contracts Deployed in a low-level language Uniform compilation target Must be Turing-complete Run arbitrary computations Code is law What else if not the code?

6 Misconceptions about Smart Contracts Deployed in a low-level language Infeasible audit and verification Must be Turing-complete DoS attacks, cost semantics, exploits Code is law Cannot be amended once deployed

7 What about High-Level Languages? contract Accounting { /* Define contract fields */ address owner; mapping (address => uint) assets; } /* This runs when the contract is executed */ function Accounting(address _owner) { owner = _owner; } /* Sending funds to a contract */ function invest() returns (string) { if (assets[msg.sender].initialized()) { throw; } assets[msg.sender] = msg.value; return "You have given us your money"; } Ethereum's Solidity JavaScript-like syntax Calling a function = sending funds General recursion and loops Reflection, dynamic contract creation Lots of implicit conventions No formal semantics

8 What about High-Level Languages? contract Accounting { /* Define contract fields */ address owner; mapping (address => uint) assets; } /* This runs when the contract is executed */ function Accounting(address _owner) { owner = _owner; } /* Sending funds to a contract */ function invest() returns (string) { if (assets[msg.sender].initialized()) { throw; } assets[msg.sender] = msg.value; return "You have given us your money"; } Ethereum's Solidity JavaScript-like syntax Calling a function = sending funds General recursion and loops Reflection, dynamic contract creation Lots of implicit conventions No formal semantics

9 Sending a Message or Calling? contract Accounting { /* Other functions */ /* Sending funds to a contract */ function invest() returns (string) { if (assets[msg.sender].initialized()) { throw; } assets[msg.sender] = msg.value; return "You have given us your money"; } } function withdrawbalance() { uint amount = assets[msg.sender]; if (msg.sender.call.value(amount)() == false) { throw; } assets[msg.sender] = 0; }

10 Sending a Message or Calling? contract Accounting { /* Other functions */ /* Sending funds to a contract */ function invest() returns (string) { if (assets[msg.sender].initialized()) { throw; } assets[msg.sender] = msg.value; return "You have given us your money"; } } function withdrawbalance() { uint amount = assets[msg.sender]; if (msg.sender.call.value(amount)() == false) { throw; } assets[msg.sender] = 0; } Can reenter and withdraw again

11 Smart Contracts in a Nutshell Computations self-explanatory State Manipulation changing contract's fields Effects accepting funds, logging events Communication sending funds, calling other contracts

12 Computations State Manipulation Communication Effects

13 Verified Specification Communication Verified Specification State Manipulation Effects Verified Specification Computations

14 Verified Specification abstraction level Communication Verified Specification State Manipulation Effects Verified Specification Computations

15 Scilla Communication Verified Specification State Manipulation Effects Verified Specification Computations

16 Scilla Smart Contract Intermediate-Level Language Principled model for computations System F with small extensions Not Turing-complete Only primitive recursion/iteration Explicit Effects State-transformer semantics Communication Contracts are autonomous actors

17 Zilliqa Team ngapore and United Kingdom zilliqa.com me semancontracts he key lancipline for ted formal e the chaln Z tax, static, nteraction Types Primitive type P ::= Int Integer String Hash Block number Account address String Hash BNum Address Type T, S ::= P Map P T Message T -> S D htk i forall.t primitive type map message value function instantiated data type type variable polymorphic function

18 Expressions (pure) Term Expression Simple expression e f ::= ::= f let x h: T i = f in e l x { hentry ik } fun (x : T ) => e builtin b hx k i Selector Pattern sel pat ::= ::= x hx k i tfun => T C h {htk i} i hx k i match x with h sel k i end pat => e x C hpat k i ( pat ) _ Message entrry Name entry b ::= b :x Meaning simple expression let-form primitive literal variable Message function built-in application application type function type instantiation constructor instantiation pattern matching variable binding constructor pattern paranthesized pattern wildcard pattern identi er Description

19 Structural Recursion in Scilla Natural numbers (not Ints!) nat_rec : forall. -> (nat -> -> ) -> nat ->. {z } Result type number of iterations Value for 0 constructing the next value final result

20 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in 10 let zero = 0 in 11 let one = 1 in 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

21 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in Value for 0: (1, 0) 10 let zero = 0 in 11 let one = 1 in 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

22 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in 10 let zero = 0 in 11 let one = 1 in Iteration 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

23 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in 10 let zero = 0 in (x, y) (x + y, x) 11 let one = 1 in 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

24 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in 10 let zero = 0 in The result of iteration is a pair of integers 11 let one = 1 in 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

25 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in 10 let zero = 0 in Iterate n times 11 let one = 1 in 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

26 Example: Fibonacci Numbers 1 let fib = fun (n : Nat) => 2 let iter_nat nat_rec (Pair Int Int) in 3 let iter_fun = 4 fun (n: Nat) => fun (res : Pair Int Int) => 5 match res with 6 And x y => let z = builtin add x y in 7 And {Int Int} z x 8 end 9 in 10 let zero = 0 in return the first component of the result pair 11 let one = 1 in 12 let init_val = And {Int Int} one zero in 13 let res = iter_nat init_val iter_fun n in 14 fst res

27 Why Structural Recursion? Pros: All programs terminate Number of operations can be computed statically as a function of input size Cons: Some functions cannot be implemented efficiently (e.g., QuickSort) Cannot implement Ackerman function :( A(m, n) = 8 < : n +1 ifm =0 A(m 1, 1) if m>0 and n =0 A(m 1,A(m, n 1)) if m>0 and n>0

28 Statements (effectful) s ::= x <- f read from mutable field f := x store to a field x = e assign a pure expression match x with pat => s end pattern matching and branching x <- &B read from blockchain state accept accept incoming payment send ms send list of messages

29 Statement Semantics JsK : BlockchainState! Configuration! Configuration BlockchainState Immutable global data (block number etc.) Configuration = Env Fields Balance Incoming Emitted Immutable bindings Contract's own funds Messages to be sent Mutable fields Funds sent to contract

30 Global Execution Model Account X

31 Global Execution Model Account X m1 Contract C m6 m2 m4 Contract D m3 Contract E m5 Account Z Account Y

32 z } { Global Execution Model m1 m6 Conf C Conf 0 C Conf 00 C Conf D m2 Conf 0 D Final contract states m4 Conf E Conf 0 E Fixed MAX length of call sequence

33 Global Execution Model m1 m6 Conf C Conf 0 C Conf 00 C m2 Conf D Conf 0 D m4 Conf E Conf 0 E

34 Putting it All Together Scilla contracts are (infinite) State-Transition Systems Interaction between contracts via sending/receiving messages Messages trigger (effectful) transitions (sequences of statements) A contract can send messages to other contracts via send statement Most computations are done via pure expressions, no storable closures Contract's state is immutable parameters, mutable fields, balance

35 Contract Structure Library of pure functions Transition 1 Immutable parameters... Mutable fields Transition N

36 Working Example: Crowdfunding contract Parameters: campaign's owner, deadline (max block), funding goal Fields: registry of backers, "campaign-complete" boolean flag Transitions: Donate money (when the campaign is active) Get funds (as an owner, after the deadline, if the goal is met) Reclaim donation (after the deadline, if the goal is not met)

37 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end

38 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end Structure of the incoming message

39 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end Reading from blockchain state

40 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end Using pure library functions (defined above in the contract)

41 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with Manipulating with fields True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end

42 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end Accepting incoming funds

43 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with Creating and sending messages True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end

44 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with Amount of own funds True => bs <- backers; transferred in a message res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end

45 transition Donate (sender: Address, amount: Int) blk <- & BLOCKNUMBER; in_time = blk_leq blk max_block; match in_time with Numeric code to inform the recipient True => bs <- backers; res = check_update bs sender amount; match res with None => msg = {tag : Main; to : sender; amount : 0; code : already_backed}; msgs = one_msg msg; send msgs Some bs1 => backers := bs1; accept; msg = {tag : Main; to : sender; amount : 0; code : accepted_code}; msgs = one_msg msg; send msgs end False => msg = {tag : Main; to : sender; amount : 0; code : missed_dealine}; msgs = one_msg msg; send msgs end end

46 Demo

47 Verifying Scilla Contracts Scilla Coq Proof Assistant Local properties (e.g., "transition does not throw an exception") Invariants (e.g., "balance is always strictly positive") Temporal properties (something good eventually happens)

48 Coq Proof Assistant State-of-the art verification framework Based on dependently typed functional language Interactive requires a human in the loop Very small trusted code base Used to implement fully verified compilers operating systems distributed protocols (including blockchains)

49 z } { Temporal Properties Q since P as long R conf conf, conf R * conf, P(conf) Q(conf, conf ) m Conf C Conf 0 m Conf 00 C C P holds here R holds for intermediate messages Q holds here Token price only goes up No payments accepted after the quorum is reached No changes can be made after locking Consensus results are irrevocable

50 Temporal Properties Q since P as long R conf conf, conf R * conf, P(conf) Q(conf, conf ) Definition since_as_long (P : conf! Prop) (Q : conf! conf! Prop) (R : bstate * message! Prop) := sc conf conf', P st! (conf conf' sc) ( b, b sc! R b)! Q conf conf'.

51 Specifying properties of Crowdfunding Lemma 1: Contract will always have enough balance to refund everyone. Lemma 2: Contract will not alter its contribution records. Lemma 3: Each contributor will be refunded the right amount, if the campaign fails.

52 Lemma 2: Contract will not alter its contribution records. Definition donated (b : address) (d : amount) conf := b donated amount d conf.backers(b) == d. Definition no_claims_from (b : address) (q : bstate * message) := b didn t try to claim q.message.sender!= b. Lemma donation_preserved (b : address) (d : amount): since_as long (donated b d) (fun c c' => donated b d c') (no_claims_from b). b s records are preserved by the contract

53 Demo

54 Misconceptions, revisited Need a low-level language Need a language easy to reason about Must be Turing-complete Primitive recursion suffices in most cases Code is law Code should abide by a specification

55 What s next? Certified interpreter for Scilla contracts Compilation into an efficient back-end (LLVM, WASM) Certifications for Proof-Carrying Code (storable on a blockchain) Automated Model Checking smart contract properties PL support for sharded contract executions

56 To Take Away Formal verification of functional and temporal properties of smart contracts requires a language with a clear separation of concerns Scilla: is a Smart Contract Intermediate-Level Language that provides it: Small: builds on the polymorphic lambda-calculus with extensions. Principled: separates computations, effects, and communication. Verifiable: formal semantics and methodology for machine-assisted reasoning. Thanks!

57 Advertisement Do you want to work on formal proofs of correctness for practicaldistributed systems and smart contracts in Coq? Join the PhD program at National University of Singapore! To start in August 2019, apply by 15 December 2018 To start in January 2020, apply by 15 June 2019 Also, postdoc positions at Yale-NUS College are available starting early Get in touch with questions about topics and positions Check ilyaserey.net for my contact details.

Safe Smart Contract Programming with Scilla

Safe Smart Contract Programming with Scilla Safe Smart Contract Programming with Scilla Ilya Sergey Associate Professor, Yale-NUS College Lead Language Designer, Zilliqa http://ilyasergey.net Smart Contracts Stateful mutable objects replicated via

More information

ZILLIQA / ZILIKƏ/ NEXT GEN HIGH-THROUGHPUT BLOCKCHAIN PLATFORM DONG XINSHU, CEO JIA YAOQI, BLOCKCHAIN ZILLIQA.

ZILLIQA / ZILIKƏ/ NEXT GEN HIGH-THROUGHPUT BLOCKCHAIN PLATFORM DONG XINSHU, CEO JIA YAOQI, BLOCKCHAIN ZILLIQA. ZILLIQA / ZILIKƏ/ NEXT GEN HIGH-THROUGHPUT BLOCKCHAIN PLATFORM DONG XINSHU, CEO JIA YAOQI, BLOCKCHAIN ARCHITECT SCALABILITY OF PUBLIC BLOCKCHAIN BITCOIN 7 TX/S ETHEREUM 10 TX/S VISA 8000 TX/S SOME EXISTING

More information

A Concurrent Perspective on Smart Contracts. 1st Workshop on Trusted Smart Contracts

A Concurrent Perspective on Smart Contracts. 1st Workshop on Trusted Smart Contracts A Concurrent Perspective on Smart Contracts Ilya Sergey Aquinas Hobor 1st Workshop on Trusted Smart Contracts 7 April 2017 class ConcurrentQueue { public synchronized void enqueue(e elem) { public

More information

Lecture 10. A2 - will post tonight - due in two weeks

Lecture 10. A2 - will post tonight - due in two weeks Lecture 10 A2 - will post tonight - due in two weeks The DAO - $72M USD in Ether Decentralized Dragon's Den or Shark's Tank A pot of money that you could contribute to and receive voting shares for You

More information

Ethereum. Smart Contracts Programming Model

Ethereum. Smart Contracts Programming Model Cryptocurrency Technologies Recall: Bitcoin scripting: non Turing-complete limited/limiting Solutions: Add application-specific functionality in scripting of altcoin Create altcoin with Turing-complete

More information

SECURITY AUDIT REPORT

SECURITY AUDIT REPORT PUBLIC REPORT SECURITY AUDIT REPORT of Smart Contracts December 27, 2017 Produced by for Table of Contents Foreword... 1 Introduction... 2 TGE overview... 2 Token distribution... 3 Extra features... 3

More information

Denotational Semantics. Domain Theory

Denotational Semantics. Domain Theory Denotational Semantics and Domain Theory 1 / 51 Outline Denotational Semantics Basic Domain Theory Introduction and history Primitive and lifted domains Sum and product domains Function domains Meaning

More information

cchannel Generalized State Channel Specification

cchannel Generalized State Channel Specification cchannel Generalized State Channel Specification Celer Network Core Team May 27, 2018 cchannel of the Celer Network is a generalized state channel and sidechain suite that provides a framework to support

More information

Technical Specifications for Platform Development

Technical Specifications for Platform Development Technical Specifications for Platform Development Contents 1. General Information about the Product... 2 2. Software Requirements... 3 2.1. Functional Requirements... 3 2.2. Server Requirements... 4 3.

More information

Programming Language Pragmatics

Programming Language Pragmatics Chapter 10 :: Functional Languages Programming Language Pragmatics Michael L. Scott Historical Origins The imperative and functional models grew out of work undertaken Alan Turing, Alonzo Church, Stephen

More information

Blockchain for Enterprise: A Security & Privacy Perspective through Hyperledger/fabric

Blockchain for Enterprise: A Security & Privacy Perspective through Hyperledger/fabric Blockchain for Enterprise: A Security & Privacy Perspective through Hyperledger/fabric Elli Androulaki Staff member, IBM Research, Zurich Workshop on cryptocurrencies Athens, 06.03.2016 Blockchain systems

More information

Plutus and Extended UTxO

Plutus and Extended UTxO Plutus and Extended UTxO Manuel M T Chakravarty, Language Architect @ IOHK What is Plutus? Innovative development and execution platform for distributed contract applications on Cardano. The Three Pillars

More information

The Technology behind Smart Contracts

The Technology behind Smart Contracts The Technology behind Smart Contracts Florian Glaser, Chair of E-Finance, Information Systems Department Goethe University 01.09.2016 > Agenda Transactions in detail

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 12/02/2013 OCaml 1 Acknowledgement The material on these slides is based on notes provided by Dexter Kozen. 2 About OCaml A functional programming language All computation

More information

Organization of Programming Languages CS3200/5200N. Lecture 11

Organization of Programming Languages CS3200/5200N. Lecture 11 Organization of Programming Languages CS3200/5200N Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Functional vs. Imperative The design of the imperative languages

More information

The Substitution Model

The Substitution Model The Substitution Model Prof. Clarkson Fall 2017 Today s music: Substitute by The Who Review Previously in 3110: simple interpreter for expression language abstract syntax tree (AST) evaluation based on

More information

CSE 505: Concepts of Programming Languages

CSE 505: Concepts of Programming Languages CSE 505: Concepts of Programming Languages Dan Grossman Fall 2003 Lecture 6 Lambda Calculus Dan Grossman CSE505 Fall 2003, Lecture 6 1 Where we are Done: Modeling mutation and local control-flow Proving

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Winter 2017 Lecture 7b Andrew Tolmach Portland State University 1994-2017 Values and Types We divide the universe of values according to types A type is a set of values and

More information

What s new under the blockchain sun. HYPERLEDGER FABRIC AND A SHORT SURVEY OF INTERLEDGER. DIDIER PH MARTIN, PHD.

What s new under the blockchain sun. HYPERLEDGER FABRIC AND A SHORT SURVEY OF INTERLEDGER. DIDIER PH MARTIN, PHD. What s new under the blockchain sun. HYPERLEDGER FABRIC AND A SHORT SURVEY OF INTERLEDGER. DIDIER PH MARTIN, PHD. Where do come from? BITCOIN = MONEY BLOCKCHAIN NETWORK ETHEREUM = PROGRAMMABLE BLOCKCHAIN

More information

CS 251: Bitcoin and Cryptocurrencies Fall 2016

CS 251: Bitcoin and Cryptocurrencies Fall 2016 CS 251: Bitcoin and Cryptocurrencies Fall 2016 Homework 3 due : 2016-11-28, 23:59 via Gradescope (entry code M4YJ69 ) 1. Idioms of use: Consider the transaction graph in the figure below: rectangles represent

More information

The security and insecurity of blockchains and smart contracts

The security and insecurity of blockchains and smart contracts The security and insecurity of blockchains and smart contracts Jean-Pierre Flori, expert in cryptography, Agence Nationale de la Sécurité des Systèmes d Information (ANSSI) In J.P. Dardayrol, editor of

More information

The power of Blockchain: Smart Contracts. Foteini Baldimtsi

The power of Blockchain: Smart Contracts. Foteini Baldimtsi The power of Blockchain: Smart Contracts Foteini Baldimtsi The Blockchain at the heart of a cryptocurrency Alice sends 2 John sends 1 Dave sends 5 to Bob to Eve to Alice Bob sends 1 Eve sends 4 to Dave

More information

Work-in-progress: "Verifying" the Glasgow Haskell Compiler Core language

Work-in-progress: Verifying the Glasgow Haskell Compiler Core language Work-in-progress: "Verifying" the Glasgow Haskell Compiler Core language Stephanie Weirich Joachim Breitner, Antal Spector-Zabusky, Yao Li, Christine Rizkallah, John Wiegley June 2018 Let's prove GHC correct

More information

Better Stories, Better Languages

Better Stories, Better Languages Better Stories, Better Languages What Would Alyssa P. Hacker Do? François-René Rideau, TUNES Project Bay Area Lispers, 2009-12-29 http://fare.tunes.org/computing/bal2009.pdf 1 The Take Home Points Software

More information

Inductive Definitions, continued

Inductive Definitions, continued 1 / 27 Inductive Definitions, continued Assia Mahboubi Jan 7th, 2016 2 / 27 Last lecture Introduction to Coq s inductive types: Introduction, elimination and computation rules; Twofold implementation :

More information

A Java Framework for Smart Contracts

A Java Framework for Smart Contracts A Java Framework for Smart Contracts Fausto Spoto Università di Verona, Italy WTSC 2019, Saint Kitts February 22, 2019 1 / 19 Programming Smart Contracts Transactions are atomic computation steps of a

More information

Assertions, pre/postconditions

Assertions, pre/postconditions Programming as a contract Assertions, pre/postconditions Assertions: Section 4.2 in Savitch (p. 239) Specifying what each method does q Specify it in a comment before method's header Precondition q What

More information

Gnosis Safe Documentation. Gnosis

Gnosis Safe Documentation. Gnosis Gnosis Aug 14, 2018 Content 1 Learn more about Gnosis Safe 3 1.1 Smart Contract Overview........................................ 3 1.2 Services Overview............................................ 10

More information

ICO Review: Raiden Network (RDN)

ICO Review: Raiden Network (RDN) ICO Review: Raiden Network (RDN) Scalable Transfers for Ethereum October 10, 2017 What is Raiden Network? Raiden is an payment network built on top of the Ethereum network. PAYMENT CHANNEL NETWORK It aims

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University Functional Languages CSE 307 Principles of Programming Languages Stony Brook University http://www.cs.stonybrook.edu/~cse307 1 Historical Origins 2 The imperative and functional models grew out of work

More information

Table of contents. Abstract. Disclaimer. Scope. Procedure. AS-IS overview. Audit overview. Conclusion. Appendix A. Automated tools reports 12

Table of contents. Abstract. Disclaimer. Scope. Procedure. AS-IS overview. Audit overview. Conclusion. Appendix A. Automated tools reports 12 1 Table of contents Abstract 3 Disclaimer 3 Scope 3 Procedure 4 AS-IS overview 5 Audit overview 10 Conclusion 11 Disclaimer 12 Appendix A. Automated tools reports 12 2 Abstract In this report, we consider

More information

The Substitution Model. Nate Foster Spring 2018

The Substitution Model. Nate Foster Spring 2018 The Substitution Model Nate Foster Spring 2018 Review Previously in 3110: simple interpreter for expression language abstract syntax tree (AST) evaluation based on single steps parser and lexer (in lab)

More information

CS131 Typed Lambda Calculus Worksheet Due Thursday, April 19th

CS131 Typed Lambda Calculus Worksheet Due Thursday, April 19th CS131 Typed Lambda Calculus Worksheet Due Thursday, April 19th Name: CAS ID (e.g., abc01234@pomona.edu): I encourage you to collaborate. collaborations below. Please record your Each question is worth

More information

GENESIS VISION NETWORK

GENESIS VISION NETWORK GENESIS VISION NETWORK Contents 1. Description of the problem 7 11. Trust management 15 2. The problem with smart contracts 8 12. GVN Token 16 3. Centralised exchanges against decentralised 8 13. Deposit

More information

A Small Interpreted Language

A Small Interpreted Language A Small Interpreted Language What would you need to build a small computing language based on mathematical principles? The language should be simple, Turing equivalent (i.e.: it can compute anything that

More information

Hyperledger Quilt and Interledger Protocol. Nathan Aw - Technical Ambassador Edmund To - Organizer of Hyperledger Meetup Hong Kong

Hyperledger Quilt and Interledger Protocol. Nathan Aw - Technical Ambassador Edmund To - Organizer of Hyperledger Meetup Hong Kong Hyperledger Quilt and Interledger Protocol Nathan Aw - Technical Ambassador Edmund To - Organizer of Hyperledger Meetup Hong Kong Housekeeping Road Map of 2018 - More meet ups! Thank you to our sponsor

More information

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017 SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Ergo platform: from prototypes to a survivable cryptocurrency

Ergo platform: from prototypes to a survivable cryptocurrency January 2019 Dmitry Meshkov Ergo platform: from prototypes to a survivable cryptocurrency Outline Ergo Consensus Light Storage vision protocol clients fee Voting Smart Monetary Roadmap system contracts

More information

A Simple Supercompiler Formally Verified in Coq

A Simple Supercompiler Formally Verified in Coq A Simple Supercompiler Formally Verified in Coq IGE+XAO Balkan 4 July 2010 / META 2010 Outline 1 Introduction 2 3 Test Generation, Extensional Equivalence More Realistic Language Use Information Propagation

More information

Security Audit of FuzeX Smart Contract This report is public. ChainSecurity Ltd. January 11, 2018

Security Audit of FuzeX Smart Contract This report is public. ChainSecurity Ltd. January 11, 2018 Security Audit of FuzeX Smart Contract This report is public. ChainSecurity Ltd. January 11, 2018 1 Contents 1 System Overview 3 1.1 TGE Overview................................. 4 1.2 Token Rewards.................................

More information

Defining the Ethereum Virtual Machine for Interactive Theorem Provers

Defining the Ethereum Virtual Machine for Interactive Theorem Provers Defining the Ethereum Virtual Machine for Interactive Theorem Provers Ethereum Foundation Workshop on Trusted Smart Contracts Malta, Apr. 7, 2017 1/32 Outline 1 2 3 Remaining Problems 4 2/32 Outline 1

More information

Declarative Static Analysis of Smart Contracts

Declarative Static Analysis of Smart Contracts Declarative Static Analysis of Smart Contracts securify.ch Quentin Hibon Blockchain Security Engineer, ChainSecurity Smart Contract Bugs in the News Low-level Code Solidity High-level languages Vyper compilation

More information

Securify: Practical Security Analysis of Smart Contracts

Securify: Practical Security Analysis of Smart Contracts Securify: Practical Security Analysis of Smart Contracts https://securify.ch Dr. Petar Tsankov Scientific Researcher, ICE center, ETH Zurich Co-founder and Chief Scientist, ChainSecurity AG http://www.ptsankov.com/

More information

CS 360 Programming Languages Interpreters

CS 360 Programming Languages Interpreters CS 360 Programming Languages Interpreters Implementing PLs Most of the course is learning fundamental concepts for using and understanding PLs. Syntax vs. semantics vs. idioms. Powerful constructs like

More information

BLOCKCHAIN CADEC Pär Wenåker & Peter Larsson

BLOCKCHAIN CADEC Pär Wenåker & Peter Larsson BLOCKCHAIN CADEC 2018 - Pär Wenåker & Peter Larsson BITCOIN BITCOIN PAPER Posted 31/10 2008 Bitcoin v0.1 released Satoshi Nakamoto satoshi at vistomail.com Thu Jan 8 14:27:40 EST 2009 Previous message:

More information

COEN 241 Term Project. A Blockchain-based Cloud Service

COEN 241 Term Project. A Blockchain-based Cloud Service COEN 241 Term Project A Blockchain-based Cloud Service Submitted By : Team 2 Xiao Zhu, Yali Zhang Instructor : Prof. Ming Hwa Wang Santa Clara University Preface This project identifies the difficulties

More information

The design of a programming language for provably correct programs: success and failure

The design of a programming language for provably correct programs: success and failure The design of a programming language for provably correct programs: success and failure Don Sannella Laboratory for Foundations of Computer Science School of Informatics, University of Edinburgh http://homepages.inf.ed.ac.uk/dts

More information

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction Lecture content TDDA69 Data and Program Structure Introduction Cyrille Berger Course Introduction to the different Programming Paradigm The different programming paradigm Why different paradigms? Introduction

More information

ENEE 457: E-Cash and Bitcoin

ENEE 457: E-Cash and Bitcoin ENEE 457: E-Cash and Bitcoin Charalampos (Babis) Papamanthou cpap@umd.edu Money today Any problems? Cash is cumbersome and can be forged Credit card transactions require centralized online bank are not

More information

EXAMINATIONS 2012 END-OF-YEAR SWEN222. Software Design. Question Topic Marks 1. Design Quality Design Patterns Design by Contract 12

EXAMINATIONS 2012 END-OF-YEAR SWEN222. Software Design. Question Topic Marks 1. Design Quality Design Patterns Design by Contract 12 T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Student ID:..................... EXAMINATIONS 2012 END-OF-YEAR SWEN222 Software Design Time

More information

CS450 - Structure of Higher Level Languages

CS450 - Structure of Higher Level Languages Spring 2018 Streams February 24, 2018 Introduction Streams are abstract sequences. They are potentially infinite we will see that their most interesting and powerful uses come in handling infinite sequences.

More information

Leveraging Smart Contracts for Automatic SLA Compensation The Case of NFV Environments

Leveraging Smart Contracts for Automatic SLA Compensation The Case of NFV Environments AIMS 2018, June 4-5, Munich, Germany Leveraging Smart Contracts for Automatic SLA Compensation The Case of NFV Environments Eder John Scheid, Burkhard Stiller Department of Informatics IFI, Communication

More information

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define CS 6A Scheme Summer 207 Discussion 0: July 25, 207 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

CS4215 Programming Language Implementation. Martin Henz

CS4215 Programming Language Implementation. Martin Henz CS4215 Programming Language Implementation Martin Henz Thursday 26 January, 2012 2 Chapter 4 The Language simpl In this chapter, we are exting the language epl in order to provide a more powerful programming

More information

CSE 413 Languages & Implementation. Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341)

CSE 413 Languages & Implementation. Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341) CSE 413 Languages & Implementation Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341) 1 Goals Representing programs as data Racket structs as a better way to represent

More information

Kakadu and Java. David Taubman, UNSW June 3, 2003

Kakadu and Java. David Taubman, UNSW June 3, 2003 Kakadu and Java David Taubman, UNSW June 3, 2003 1 Brief Summary The Kakadu software framework is implemented in C++ using a fairly rigorous object oriented design strategy. All classes which are intended

More information

Inductive data types

Inductive data types Inductive data types Assia Mahboubi 9 juin 2010 In this class, we shall present how Coq s type system allows us to define data types using inductive declarations. Generalities Inductive declarations An

More information

Functional Programming. Big Picture. Design of Programming Languages

Functional Programming. Big Picture. Design of Programming Languages Functional Programming Big Picture What we ve learned so far: Imperative Programming Languages Variables, binding, scoping, reference environment, etc What s next: Functional Programming Languages Semantics

More information

CS 251: Bitcoin and Crypto Currencies Fall 2015

CS 251: Bitcoin and Crypto Currencies Fall 2015 CS 251: Bitcoin and Crypto Currencies Fall 2015 Final Exam The exam is open book and open notes. You have 2 hours. Please answer all five questions. All questions are weighted equally. You may use course

More information

Programming Languages: Application and Interpretation

Programming Languages: Application and Interpretation Programming Languages: Application and Interpretation Version 6.7 October 26, 2016 This is the documentation for the software accompanying the textbook Programming Languages: Application and Interpretation

More information

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015 SCHEME 7 COMPUTER SCIENCE 61A October 29, 2015 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Spring 2018 Discussion 7: March 21, Introduction. 2 Primitives

Spring 2018 Discussion 7: March 21, Introduction. 2 Primitives CS 61A Scheme Spring 2018 Discussion 7: March 21, 2018 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme

More information

kasko2go Token Contract Audit

kasko2go Token Contract Audit Version 1.0 / 17.04.2018 kasko2go Token Contract Audit inacta AG Eugen Lechner Cédric Walter Index 1. Introduction 2 2. Scope 2 3. Executive Summary

More information

Smart Contract Security Audit Report. Loopring Protocol Smart Contract version 2

Smart Contract Security Audit Report. Loopring Protocol Smart Contract version 2 Smart Contract Security Audit Report Loopring Protocol Smart Contract version 2 Dec 15, 2018 1. Introduction Loopring Protocol Smart Contract version 2 is a set of smart contracts in the Loopring ecosystem

More information

Haskell: Lists. CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Friday, February 24, Glenn G.

Haskell: Lists. CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Friday, February 24, Glenn G. Haskell: Lists CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Friday, February 24, 2017 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks

More information

SCHEME 10 COMPUTER SCIENCE 61A. July 26, Warm Up: Conditional Expressions. 1. What does Scheme print? scm> (if (or #t (/ 1 0)) 1 (/ 1 0))

SCHEME 10 COMPUTER SCIENCE 61A. July 26, Warm Up: Conditional Expressions. 1. What does Scheme print? scm> (if (or #t (/ 1 0)) 1 (/ 1 0)) SCHEME 0 COMPUTER SCIENCE 6A July 26, 206 0. Warm Up: Conditional Expressions. What does Scheme print? scm> (if (or #t (/ 0 (/ 0 scm> (if (> 4 3 (+ 2 3 4 (+ 3 4 (* 3 2 scm> ((if (< 4 3 + - 4 00 scm> (if

More information

Ergo platform. Dmitry Meshkov

Ergo platform. Dmitry Meshkov Ergo platform Dmitry Meshkov Prehistory Motivation Theory Practice Provably secure 1000 currencies New features Ad-hoc solutions Impractical Security issues Motivation Theory Provably secure New features

More information

Functional Programming

Functional Programming Functional Programming Björn B. Brandenburg The University of North Carolina at Chapel Hill Based in part on slides and notes by S. Olivier, A. Block, N. Fisher, F. Hernandez-Campos, and D. Stotts. Brief

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

Who wants to be a millionaire? A class in creating your own cryptocurrency

Who wants to be a millionaire? A class in creating your own cryptocurrency DEVNET-3626 Who wants to be a millionaire? A class in creating your own cryptocurrency Tom Davies, Sr. Manager, DevNet Sandbox Vallard Benincosa, Software Engineer Cisco Spark How Questions? Use Cisco

More information

CPS 506 Comparative Programming Languages. Programming Language Paradigm

CPS 506 Comparative Programming Languages. Programming Language Paradigm CPS 506 Comparative Programming Languages Functional Programming Language Paradigm Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming

More information

Fall 2017 Discussion 7: October 25, 2017 Solutions. 1 Introduction. 2 Primitives

Fall 2017 Discussion 7: October 25, 2017 Solutions. 1 Introduction. 2 Primitives CS 6A Scheme Fall 207 Discussion 7: October 25, 207 Solutions Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write

More information

Brown University. Yana Hrytsenko. Final Project: Blockchain for PKI: Using Blockchain data structure for Public Key. Infrastructure.

Brown University. Yana Hrytsenko. Final Project: Blockchain for PKI: Using Blockchain data structure for Public Key. Infrastructure. Brown University Yana Hrytsenko Final Project: Blockchain for PKI: Using Blockchain data structure for Public Key Infrastructure May 2017 1 Blockchain for PKI Using Blockchain data structure for Public

More information

Ergo platform overview

Ergo platform overview December 2018 Dmitry Meshkov Ergo platform overview Outline Ergo vision Decentralization Survivability Applicability Roadmap 2 Part 1 Ergo vision 3 History Research and Scorex framework development Testnet

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Verfying the SSH TLP with ProVerif

Verfying the SSH TLP with ProVerif A Demo Alfredo Pironti Riccardo Sisto Politecnico di Torino, Italy {alfredo.pironti,riccardo.sisto}@polito.it CryptoForma Bristol, 7-8 April, 2010 Outline Introduction 1 Introduction 2 3 4 Introduction

More information

5.Language Definition

5.Language Definition 5.Language Definition This chapter presents a complete description of the present state of the Joule language design. First, the computational primitives are described, along with typical techniques for

More information

CS 11 Haskell track: lecture 1

CS 11 Haskell track: lecture 1 CS 11 Haskell track: lecture 1 This week: Introduction/motivation/pep talk Basics of Haskell Prerequisite Knowledge of basic functional programming e.g. Scheme, Ocaml, Erlang CS 1, CS 4 "permission of

More information

(Refer Slide Time: 4:00)

(Refer Slide Time: 4:00) Principles of Programming Languages Dr. S. Arun Kumar Department of Computer Science & Engineering Indian Institute of Technology, Delhi Lecture - 38 Meanings Let us look at abstracts namely functional

More information

Smart Contract Security Tips. Ethereum devcon2 Sep Joseph Chow

Smart Contract Security Tips. Ethereum devcon2 Sep Joseph Chow Smart Contract Security Tips Ethereum devcon2 Sep 20 2016 - Joseph Chow One line of code spurred a series of momentous events in blockchain history June 12 2016 Community resource: for the community,

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programming Languages Functional Programming Prof. Robert van Engelen Overview What is functional programming? Historical origins of functional programming Functional programming today Concepts

More information

Optimization of Executable Formal Interpreters developed in Higher-order Theorem Proving Systems

Optimization of Executable Formal Interpreters developed in Higher-order Theorem Proving Systems Optimization of Executable Formal Interpreters developed in Higher-order Theorem Proving Systems Zheng Yang 1* zyang.uestc@gmail.com Hang Lei hlei@uestc.edu.cn 1 School of Information and Software Engineering,

More information

Functional Programming. Pure Functional Programming

Functional Programming. Pure Functional Programming Functional Programming Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends only on the values of its sub-expressions (if any).

More information

Principles of Programming Languages 2017W, Functional Programming

Principles of Programming Languages 2017W, Functional Programming Principles of Programming Languages 2017W, Functional Programming Assignment 3: Lisp Machine (16 points) Lisp is a language based on the lambda calculus with strict execution semantics and dynamic typing.

More information

Abstraction: Distributed Ledger

Abstraction: Distributed Ledger Bitcoin 2 Abstraction: Distributed Ledger 3 Implementation: Blockchain this happened this happened this happen hashes & signatures hashes & signatures hashes signatu 4 Implementation: Blockchain this happened

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Typed Scheme: Scheme with Static Types

Typed Scheme: Scheme with Static Types Typed Scheme: Scheme with Static Types Version 4.1.1 Sam Tobin-Hochstadt October 5, 2008 Typed Scheme is a Scheme-like language, with a type system that supports common Scheme programming idioms. Explicit

More information

Functional Programming. Pure Functional Languages

Functional Programming. Pure Functional Languages Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure

More information

Lecture 5: Lazy Evaluation and Infinite Data Structures

Lecture 5: Lazy Evaluation and Infinite Data Structures Lecture 5: Lazy Evaluation and Infinite Data Structures Søren Haagerup Department of Mathematics and Computer Science University of Southern Denmark, Odense October 3, 2017 How does Haskell evaluate a

More information

A Scalable Smart Contracts Platform

A Scalable Smart Contracts Platform A Scalable Smart Contracts Platform! Shehar Bano! Postdoc, InfoSec group! University College London!! s.bano@ucl.ac.uk! @thatbano https://github.com/chainspace The Team Mustafa Al-Bassam! (UCL) Alberto

More information

Blockchain (de)constructed

Blockchain (de)constructed Blockchain (de)constructed Fritz Henglein Department of Computer Science, University of Copenhagen (DIKU) DIKU Business Club meeting on blockchain January 11th, 2016 Fritz Henglein Professor of programming

More information

Exercise 1 ( = 18 points)

Exercise 1 ( = 18 points) 1 Exercise 1 (4 + 5 + 4 + 5 = 18 points) The following data structure represents polymorphic binary trees that contain values only in special Value nodes that have a single successor: data Tree a = Leaf

More information

CVO103: Programming Languages. Lecture 5 Design and Implementation of PLs (1) Expressions

CVO103: Programming Languages. Lecture 5 Design and Implementation of PLs (1) Expressions CVO103: Programming Languages Lecture 5 Design and Implementation of PLs (1) Expressions Hakjoo Oh 2018 Spring Hakjoo Oh CVO103 2018 Spring, Lecture 5 April 3, 2018 1 / 23 Plan Part 1 (Preliminaries):

More information

0xcert - Your ID, degree, artwork or house. 0xcert-ified on the blockchain.

0xcert - Your ID, degree, artwork or house. 0xcert-ified on the blockchain. 0xcert - Your ID, degree, artwork or house. 0xcert-ified on the blockchain. 0xcert protocol Lightpaper 0.2 (draft) Authors: Kristijan Sedlak, Jure Zih, Mitja Pirc, Urban Osvald Date: June 24th, 2018 Version:

More information

Active Planning Committee John Lindsay, Patent Attorney Tony Schuman, Investment Advisor Todd Russell, Gov t Contract Opportunities

Active Planning Committee John Lindsay, Patent Attorney Tony Schuman, Investment Advisor Todd Russell, Gov t Contract Opportunities Agenda 11:30-11:45 Check-In, networking 11:45-12:45 12:45 Announcements, Networking Active Planning Committee John Lindsay, Patent Attorney Tony Schuman, Investment Advisor Todd Russell, Gov t Contract

More information

Data dependent execution order data dependent control flow

Data dependent execution order data dependent control flow Chapter 5 Data dependent execution order data dependent control flow The method of an object processes data using statements, e.g., for assignment of values to variables and for in- and output. The execution

More information

Ethereum in Enterprise Context

Ethereum in Enterprise Context Ethereum in Enterprise Context Blockchain Innovation Week Djuri Baars May 25th, 2018 Introduction Djuri Baars Lead Blockchain Team Djuri.Baars@rabobank.nl Blockchain Acceleration Lab Support organization

More information

Functional Languages. Hwansoo Han

Functional Languages. Hwansoo Han Functional Languages Hwansoo Han Historical Origins Imperative and functional models Alan Turing, Alonzo Church, Stephen Kleene, Emil Post, etc. ~1930s Different formalizations of the notion of an algorithm

More information

FRAC: Language Reference Manual

FRAC: Language Reference Manual FRAC: Language Reference Manual Justin Chiang jc4127 Kunal Kamath kak2211 Calvin Li ctl2124 Anne Zhang az2350 1. Introduction FRAC is a domain-specific programming language that enables the programmer

More information