Smart contrat & blockc kchain : As Aspect ects te techniques - - PowerPoint PPT Presentation

smart contrat blockc kchain as aspect ects te techniques
SMART_READER_LITE
LIVE PREVIEW

Smart contrat & blockc kchain : As Aspect ects te techniques - - PowerPoint PPT Presentation

Smart contrat & blockc kchain : As Aspect ects te techniques Une approche calidoscopique des Smart Contracts en droit suisse Neuchtel, 13. Septembre 2018 Jrn Erbguth joern@erbguth.ch +41 787256027 Agenda Blockchain Hash


slide-1
SLIDE 1

Smart contrat & blockc kchain : As Aspect ects te techniques

Une approche caléidoscopique des Smart Contracts en droit suisse Neuchâtel, 13. Septembre 2018 Jörn Erbguth joern@erbguth.ch +41 787256027
slide-2
SLIDE 2 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #2

Agenda

Blockchain

  • Hash functions
  • Electronic signatures
  • Consensus mechanisms

Smart Contracts

  • What is the essence of a Smart Contract ?
  • Transparency & Trust
  • Example & use cases
slide-3
SLIDE 3 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #3

Blockchain

  • Stores data, mostly transactions and hashes
  • Immutable
  • Existing blocks are never deleted or modified
slide-4
SLIDE 4 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #4

Blockchain

  • Stores data
  • Immutable
  • Distributed worldwide
  • Decentralized

Every node is a complete copy Special consensus mechanism

slide-5
SLIDE 5 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #5

Blockchain

  • Stores data
  • Immutable
  • Distributed worldwide
  • Rules in program code
  • Rules determine which transactions are permitted to be

integrated into new blocks.

slide-6
SLIDE 6 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #6

Why Blockchain ?

slide-7
SLIDE 7 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #7

Why Blockchain?

Trust Trust

slide-8
SLIDE 8 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #8

How does Blockchain create trust ?

Cryptography + Decentralization

slide-9
SLIDE 9 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #9

Cryptography

Hash functions + Electronic signatures

slide-10
SLIDE 10 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #10

Hash functions

  • Serve as digital finger prints
  • Unique
  • Same length
  • For digital objects of any size
  • Cannot be calculated backwards
Demo 2
slide-11
SLIDE 11 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #11

Example for hash values

  • Switzerland
2275583196D791405892AACA0D87743C872F3FC0CF3308A6C3EF82528918AA8A
  • Switzerland.
43CF6F3ECA7253FFAB1FD5104172280189B91FDD5FA26774FCA6475FFA1E2EC9
  • A
8C4B4C4E211BA8C1A62DE2A3A6CA5AC8BFF501C14410100DD90D5077A0AC061E
slide-12
SLIDE 12 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #12

Using a hash-function to chain blocks

Changing an old block requires to change all subsequent blocks

010110101010100 010101000101010 001001000010010 100111001010101 111010100101101 010101000101010 001010100010010 000100101001110 101010001010100 010101000100100 001001010011100 101010111011010
slide-13
SLIDE 13 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #13

Using a hash-function to time-stamp an object

Hash: F4D38DFFE4304CB887587E3FC6B15717328E23471BECD259F58E0F3CB63722D2
slide-14
SLIDE 14 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #14

From encryption to electronic signatures

Symmetric encryption Asymmetric encryption

slide-15
SLIDE 15 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #15

From encryption to electronic signatures

Asymmetric encryption Electronic signature

slide-16
SLIDE 16 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #16
  • Assets are connected to at least one public key
  • Assets can be transferred to another public key
  • Asset transactions need to be signed with the

corresponding private key of the current owner

Alice’s public key

Use of electronic signatures in Blockchains

Bob’s public key Signed with Alice’s private key
slide-17
SLIDE 17 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #17

Energy consumption of proof of work

Source:
slide-18
SLIDE 18 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #18

Consensus mechanisms

  • Cryptographic signatures only ensure that no

unauthorized transaction can be added.

  • Consensus mechanisms ensure that no transaction can

be removed “Double Spending”

slide-19
SLIDE 19 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #19

Putting a Transaction on a Blockchain

1.

Signing the transaction

2.

Distribution to the mining nodes

slide-20
SLIDE 20 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #20

Putting a Transaction on a Blockchain

1.

Signing the transaction

2.

Distribution to the mining nodes

3.

Every miner collects new transactions for a new block

slide-21
SLIDE 21 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #21

Putting a Transaction on a Blockchain

1.

Signing the transaction

2.

Distribution to the mining nodes

3.

Every miner collects new transactions for a new block

4.

Every miner tries to be the first to find a suitable Nonce

Nonce: ???
slide-22
SLIDE 22 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #22

Mining

Creating a block takes time and energy

010110101010100 010101000101010 001001000010010 100111001010101 Nonce 43785 Mining means, finding a Nonce value so that the hash value starts with the required number of zeros 000000000000000000002f345d3ab230101251217fd8419034678bb4bc0231b5
slide-23
SLIDE 23 Weblaw Brown Bag 16.8.2017 Smart Contracts auf der Blockchain Jörn Erbguth, joern@erbguth.ch #23

Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Transaction Tra nsaction Transa ction Transactio n Transakcon Tr Transaction Tra nsaction Transa ction Transactio n Transaction Tr Transaction Tra nsaction Transa ction Transactio n Transaction Tr Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Mining – Proof of Work

A transaction is signed and distributed to the miners
slide-24
SLIDE 24 Weblaw Brown Bag 16.8.2017 Smart Contracts auf der Blockchain Jörn Erbguth, joern@erbguth.ch #24

Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Mining – Proof of Work

Transaction Tra nsaction Transa ction Transactio n Transaction Tr Transaction Tra nsaction Transa ction Transactio n Transakcon Tr Transaction Tra nsaction Transa ction Transactio n Transaction Tr Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Transaction Tra nsaction Transa ction Transcktio n Transaction Tr

Transaction Tra nsaction Transa ction Transactio n Transaction Tr Miners are trying to find a matching Nonce-value
slide-25
SLIDE 25 Weblaw Brown Bag 16.8.2017 Smart Contracts auf der Blockchain Jörn Erbguth, joern@erbguth.ch #25 Transaction Tra nsaction Transa ction Transactio n Transaction Tr Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Transaction Tra nsaction Transa ction Transactio n Transaction Tr Transaction Tra nsaction Transa ction Transactio n Transakcon Tr

Transaction Tra nsaction Transa ction Transactio n Transaction Tr

Mining – Proof of Work

Transaction Tra nsaction Transa ction Transactio n Transaction Tr

The miner who found a matching Nonce first, gets the reward and distributes the block to the
  • ther miners. They will start mining the next block on top of this block.
slide-26
SLIDE 26 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #26

Proof of Work – voting by computing power

slide-27
SLIDE 27 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #27

Proof of Stake – voting by number of shares

slide-28
SLIDE 28 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #28

Proof of Authority – voting by designation

slide-29
SLIDE 29 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #29

Smart Contracts

slide-30
SLIDE 30 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #30

What is a Smart Contract?

  • All programs for programmable blockchains?
  • A contract (or a part of it) is defined as code rather than legalese
  • Automated contract execution
  • Conclusion of a contract and its authentic execution on a blockchain
slide-31
SLIDE 31 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #31

Smart Contracts

  • Some blockchains are programmable
  • A smart contract can define its own

variables and set of transactions

  • The smart contract code determines

what kind of transactions are possible

§§
slide-32
SLIDE 32 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #32

Need for transparency

slide-33
SLIDE 33 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #33

Trust through Smart Contracts

  • No unauthorized manipulation possible
  • Code is transparent
  • Exact execution of the code is granted
  • Bugs are always possible
  • Need for dispute resolution
slide-34
SLIDE 34 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #34

Transparency of Smart Contracts

  • Smart Contract code is public
  • Code on the Blockchain is byte code and even its

translation into opcode is difficult to understand

  • Verification with source code possible
  • Variety of decompilers available
slide-35
SLIDE 35 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #35

Blockchain

Smart contract developer

Smart contract – example used software licenses

§§ §§ ABC Ltd. Original purchaser License verification So Software XYZ Software V 1.2 Se Serial Numbe ber 123456789 Or Orig igin inal l Purchaser ABC Ltd. Or Orig igin inal l Purchase Da Date 1.8.2017 Ve Verification 1.2.2018 Of Offer 10 Ether DEF Ltd. Second purchaser Ac Accept ptance DEF Ltd. Da Date 1.5.2018 Of Offer 8 Ether Ac Accept ptance GHI Ltd. Da Date 1.8.2018 GHI Ltd. Third purchaser
slide-36
SLIDE 36 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #36

Use case Initial Coin Offerings

slide-37
SLIDE 37 Smart contrat & blockc kchain : A : Aspects ects techni techniques ues Neuchâtel, 13. Septembre 2018 Jörn Erbguth, joern@erbguth.ch #37

Thank you for your attention

Questions