+ Law, Science and Technology MSCA ITN EJD n. 814177 Smart - - PowerPoint PPT Presentation

law science and technology msca itn ejd n 814177 smart
SMART_READER_LITE
LIVE PREVIEW

+ Law, Science and Technology MSCA ITN EJD n. 814177 Smart - - PowerPoint PPT Presentation

+ Law, Science and Technology MSCA ITN EJD n. 814177 Smart contracts and Proof of Location in Mirko Zichichi Smart Cities Outline Preliminaries Authentication Introduction to Distributed Systems Distributed systems


slide-1
SLIDE 1

+

Smart contracts and Proof of Location in Smart Cities Mirko Zichichi

Law, Science and Technology MSCA ITN EJD n. 814177

slide-2
SLIDE 2

+ Outline

▪ Preliminaries ▪ Authentication ▪ Introduction to Distributed Systems ▪ Distributed systems ▪ Blockchain ▪ Smart Contracts ▪ Decentralized computing ▪ Proof of Location in Smart Cities ▪ FOAM ▪ Zero Knowledge PoL

slide-3
SLIDE 3

+

Mirko Zichichi

Some preliminary notions

  • Hash functions
  • Digital signature
  • Timestamp
slide-4
SLIDE 4

+

Cryptographic Hash function

slide-5
SLIDE 5

+

Cryptographic Hash function One-way

Practically infeasible to invert:

slide-6
SLIDE 6

+

Cryptographic Hash function One-way

Practically infeasible to invert:

slide-7
SLIDE 7

+

Cryptographic Hash function SHA256

admitted by eIDAS regulation

slide-8
SLIDE 8

+

Cryptographic Hash function SHA256

admitted by eIDAS regulation

slide-9
SLIDE 9

+

Cryptographic Hash function

digest length is always the same (256 bit in the case of SHA256)

SHA256

admitted by eIDAS regulation

slide-10
SLIDE 10

+

Cryptographic Hash function

digest length is always the same (256 bit in the case of SHA256) Collision free : the probability of two inputs with the same digest is very small

SHA256

admitted by eIDAS regulation

slide-11
SLIDE 11

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).
slide-12
SLIDE 12

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).

Employs Asymmetric Cryptography:

public key (associated to a pub certificate)

private key

slide-13
SLIDE 13

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).

Employs Asymmetric Cryptography:

public key (associated to a pub certificate)

private key SHA256( ) =

Docu ment digest

slide-14
SLIDE 14

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).

Employs Asymmetric Cryptography:

public key (associated to a pub certificate)

private key SHA256( ) =

Docu ment digest

sign( + ) =

signature digest private key

slide-15
SLIDE 15

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).

Employs Asymmetric Cryptography:

public key (associated to a pub certificate)

private key SHA256( ) =

Docu ment digest

sign( + ) =

signature digest private key

verify( + ) =

signature digest public key

anyone can

slide-16
SLIDE 16

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).

Employs Asymmetric Cryptography:

public key (associated to a pub certificate)

private key Integrity: grants that the message was not altered in transit (digest) SHA256( ) =

Docu ment digest

sign( + ) =

signature digest private key

verify( + ) =

signature digest public key

anyone can

slide-17
SLIDE 17

+

Digital Signature

Scheme for verifying the authenticity

  • f digital messages (documents).

Employs Asymmetric Cryptography:

public key (associated to a pub certificate)

private key Integrity: grants that the message was not altered in transit (digest) Authentication: A valid digital signature gives a recipient very strong reason to believe that the message was created by a known sender. When can you associate the pub key to an identity (e.g. the sender)? SHA256( ) =

Docu ment digest

sign( + ) =

signature digest private key

verify( + ) =

signature digest public key

anyone can

slide-18
SLIDE 18

+ eIDAS recognizes 3 e-signature types

Electronic signatures

eIDAS sets a foundation for all electronic signatures by asserting that no signature can be denied legal admissibility solely because it's in electronic form e.g.: Signing an e-mail with your personal name or entering a PIN code

slide-19
SLIDE 19

+ eIDAS recognizes 3 e-signature types

Electronic signatures

eIDAS sets a foundation for all electronic signatures by asserting that no signature can be denied legal admissibility solely because it's in electronic form e.g.: Signing an e-mail with your personal name or entering a PIN code

Advanced Electronic Signatures (AdES)

With AdES, signatures must be uniquely linked to, and capable of identifying, the signer. Signers create their signature using data solely under their control and the final document is tamper-evident.

←Digital Signatures

(XAdES, PAdES, CAdES,

Associated Signature Container Baseline Profile without qualified Certificate, Graphometric signature, biometric signature, etc.)

slide-20
SLIDE 20

+ eIDAS recognizes 3 e-signature types

Electronic signatures

eIDAS sets a foundation for all electronic signatures by asserting that no signature can be denied legal admissibility solely because it's in electronic form e.g.: Signing an e-mail with your personal name or entering a PIN code

Advanced Electronic Signatures (AdES)

With AdES, signatures must be uniquely linked to, and capable of identifying, the signer. Signers create their signature using data solely under their control and the final document is tamper-evident.

←Digital Signatures

(XAdES, PAdES, CAdES,

Associated Signature Container Baseline Profile without qualified Certificate, Graphometric signature, biometric signature, etc.)

Qualified Electronic Signatures (QES)

QES is a stricter form of AdES. Same legal value as handwritten

  • signatures. It requires signers to use

certificate-based digital ID issued by a qualified EU Trust Service Provider (TSP), along with a qualified signature creation device (QSCD) e.g.: XAdES, PAdES, CAdES with Qualified Certificate and secure device: smart card, USB token, or mobile with a one-time passcode

slide-21
SLIDE 21

+ Electronic Time Stamp eIDAS

Data in electronic form which binds other data in electronic form to a particular time establishing evidence that the latter data existed at that time

slide-22
SLIDE 22

+ Electronic Time Stamp eIDAS

Data in electronic form which binds other data in electronic form to a particular time establishing evidence that the latter data existed at that time

links the date and time with the data so that the possibility of modifying the data without being detected is reasonably eliminated

document digest

slide-23
SLIDE 23

+ Electronic Time Stamp eIDAS

Data in electronic form which binds other data in electronic form to a particular time establishing evidence that the latter data existed at that time

links the date and time with the data so that the possibility of modifying the data without being detected is reasonably eliminated

is based on a temporary information source linked to Coordinated Universal Time

document digest date time

slide-24
SLIDE 24

+ Electronic Time Stamp eIDAS

Data in electronic form which binds other data in electronic form to a particular time establishing evidence that the latter data existed at that time

links the date and time with the data so that the possibility of modifying the data without being detected is reasonably eliminated

is based on a temporary information source linked to Coordinated Universal Time

has been signed using an AdES or stamped with an advanced electronic stamp of the TSP or by any equivalent method

document digest private key date time

slide-25
SLIDE 25

+ Electronic Time Stamp eIDAS

Data in electronic form which binds other data in electronic form to a particular time establishing evidence that the latter data existed at that time

links the date and time with the data so that the possibility of modifying the data without being detected is reasonably eliminated

is based on a temporary information source linked to Coordinated Universal Time

has been signed using an AdES or stamped with an advanced electronic stamp of the TSP or by any equivalent method sign( + + ) =

signature document digest private key date time

slide-26
SLIDE 26

+ Legal validity of the qualified electronic time stamp

  • Art. 41 of eIDAS

A qualified electronic time stamp shall enjoy the presumption

  • f the accuracy of the date and the time it indicates and the

integrity of the data to which the date and time are bound.

slide-27
SLIDE 27

+ In Italy

The digital document signed with qualified digital signature(s) should be closed by a qualified time stamp in order to fix the date when the qualified certificate(s) of the digital signature(s) is/are valid.

Over the time the qualified certificates expire and it is not possible to validate the validity of the certificates in the moment of the signature.

slide-28
SLIDE 28

+

Digitally signed and time stamped Document

Alice’s Certificate TSP signature Alice Priv Alice Pub

slide-29
SLIDE 29

+

Digitally signed and time stamped Document

Alice’s Certificate TSP signature Alice Priv Alice Pub

SHA256( ) =

Docu ment digest

sign( + ) = signature

digest Alice Priv Docu ment signature Alice’s Certificate

slide-30
SLIDE 30

+

Digitally signed and time stamped Document

Alice’s Certificate TSP signature Alice Priv Alice Pub

SHA256( ) =

Docu ment digest

sign( + ) = signature

digest Alice Priv Docu ment signature Alice’s Certificate digest 2

SHA256( ) =

slide-31
SLIDE 31

+

Digitally signed and time stamped Document

Alice’s Certificate TSP signature Alice Priv Alice Pub

SHA256( ) =

Docu ment digest

sign( + ) = signature

digest Alice Priv Docu ment signature Alice’s Certificate digest 2

+

date time

Request signature to TSP

TSP’s Certificate Other TSP signature TSP Priv TSP Pub

SHA256( ) =

slide-32
SLIDE 32

+

Digitally signed and time stamped Document

Alice’s Certificate TSP signature Alice Priv Alice Pub

SHA256( ) =

Docu ment digest

sign( + ) = signature

digest Alice Priv Docu ment signature Alice’s Certificate digest 2

+

date time

Request signature to TSP

sign( + + ) =

signature 2 digest 2 date time TSP Priv TSP’s Certificate Other TSP signature TSP Priv TSP Pub

SHA256( ) =

slide-33
SLIDE 33

+

Digitally signed and time stamped Document

Alice’s Certificate TSP signature Alice Priv Alice Pub

SHA256( ) =

Docu ment digest

sign( + ) = signature

digest Alice Priv Docu ment signature Alice’s Certificate digest 2

+

date time

Request signature to TSP

sign( + + ) =

signature 2 digest 2 date time TSP Priv TSP’s Certificate Other TSP signature TSP Priv TSP Pub

SHA256( ) =

Docu ment signature signature 2 date time Alice’s Certificate TSP’s Certificate

slide-34
SLIDE 34

+

Mirko Zichichi

Introduction to Distributed Systems

and Blockchains

slide-35
SLIDE 35

+

A system architecture is the conceptual model that defines the structure, behavior, and more views of a system

Client/Server Architecture

slide-36
SLIDE 36

+

A system architecture is the conceptual model that defines the structure, behavior, and more views of a system

Client/Server Architecture

Client Server

slide-37
SLIDE 37

+

A system architecture is the conceptual model that defines the structure, behavior, and more views of a system

Client/Server Architecture

Client Server request

slide-38
SLIDE 38

+

A system architecture is the conceptual model that defines the structure, behavior, and more views of a system

Client/Server Architecture

Client Server request response

slide-39
SLIDE 39

+

A system architecture is the conceptual model that defines the structure, behavior, and more views of a system

Client/Server Architecture

APP

Client Server request response

slide-40
SLIDE 40

+

A system architecture is the conceptual model that defines the structure, behavior, and more views of a system

Client/Server Architecture

APP

Client Server request response

slide-41
SLIDE 41

+

Alice pays Bob 5 euros

Client/Server Architecture

Client Server

Example

DB

slide-42
SLIDE 42

+

Alice pays Bob 5 euros

Client/Server Architecture

Client Server pay(Bob,5)

Example

DB 1°

slide-43
SLIDE 43

+

Alice pays Bob 5 euros

Client/Server Architecture

Client Server pay(Bob,5)

Example

DB update(Alice,-5) update(Bob,+5) 1° 2° 3°

slide-44
SLIDE 44

+

Alice pays Bob 5 euros

Client/Server Architecture

Client Server pay(Bob,5)

  • k

Example

DB update(Alice,-5) update(Bob,+5) 1° 2° 3° 4°

slide-45
SLIDE 45

+

Client Server request response

Client/Server Architecture

slide-46
SLIDE 46

+

Peers are Client and Server simultaneously request response Server Client request response Client Server

slide-47
SLIDE 47

+

Peers are Client and Server simultaneously

Peer to Peer (P2P) Architecture

Peer Node Peer Node request response request response

slide-48
SLIDE 48

+

Peers are Client and Server simultaneously

Peer to Peer (P2P) Architecture

Peer Node Peer Node request response request response

APP APP

slide-49
SLIDE 49

+

49

Distributed Systems

Systems that don’t share memory (or clock) but connect and relay information over a communication medium. The different nodes in distributed system have their own memory, OS and local resources.

slide-50
SLIDE 50

+

Client

One node does everything

Centralized

50

Distributed Systems

Server DB

Systems that don’t share memory (or clock) but connect and relay information over a communication medium. The different nodes in distributed system have their own memory, OS and local resources.

slide-51
SLIDE 51

+

Client

One node does everything A node distribute work to sub-nodes

Centralized Semi-centralized

51

Distributed Systems

Server Client Server Server DB DB

Systems that don’t share memory (or clock) but connect and relay information over a communication medium. The different nodes in distributed system have their own memory, OS and local resources.

slide-52
SLIDE 52

+

Client

One node does everything A node distribute work to sub-nodes

Centralized Semi-centralized Distributed system Non-centralized (P2P)

52

Distributed Systems

Server Client Server Server DB DB Peer Peer DB DB

Systems that don’t share memory (or clock) but connect and relay information over a communication medium. The different nodes in distributed system have their own memory, OS and local resources.

slide-53
SLIDE 53

+

53

BLOCKCHAIN

A Distributed System based on a P2P network

slide-54
SLIDE 54

+ Blockchain

It is a technology which is part of the realm of the DLT: Distributed Ledger Technologies

slide-55
SLIDE 55

+ Blockchain

It is a technology which is part of the realm of the DLT: Distributed Ledger Technologies

A ledger is distributed among nodes in a network, that update their local copy following a unique consensus mechanism

slide-56
SLIDE 56

+ Blockchain

It is a technology which is part of the realm of the DLT: Distributed Ledger Technologies

A ledger is distributed among nodes in a network, that update their local copy following a unique consensus mechanism

A blockchain is a DLT where the ledger takes the form of a set of block (relatively) chronologically ordered

slide-57
SLIDE 57

+ Blockchain

we can distinguish between

slide-58
SLIDE 58

+ Blockchain

we can distinguish between

How the ledger is structured: chain of blocks

slide-59
SLIDE 59

+ Blocks

Content of Bi : Transactions

Bi

Others

slide-60
SLIDE 60

+ Blocks

Content of Bi : Transactions

Bi

SHA256( )

Content

  • f Bi-1

Others

slide-61
SLIDE 61

+ Blocks

Content of Bi : Transactions

Bi

SHA256( )

Content

  • f Bi-1

Others

Bi+1

SHA256( )

Content

  • f Bi
slide-62
SLIDE 62

+ Blocks

Content of Bi : Transactions

Bi

SHA256( )

Content

  • f Bi-1

Others Content of Bi+1 : Transactions

Bi+1

SHA256( )

Content

  • f Bi

Others Content of Bi+2 : Transactions

Bi+2

SHA256( )

Content

  • f Bi+1

Others

slide-63
SLIDE 63

+ Blocks

Content of Bi :

Bi

Others Content of Bi+1 :

Bi+1

Others Content of Bi+2 :

Bi+2

Others

slide-64
SLIDE 64

+ What is Mining?

To solve a cryptographical puzzle, e.g. finding the 'needle in a haystack'

slide-65
SLIDE 65

+ What is Mining?

To solve a cryptographical puzzle, e.g. finding the 'needle in a haystack'

Content of Bi : Transactions SHA256( )

Content

  • f Bi-1

0000001

slide-66
SLIDE 66

+ What is Mining?

To solve a cryptographical puzzle, e.g. finding the 'needle in a haystack'

Content of Bi : Transactions SHA256( )

Content

  • f Bi-1

0000001 SHA256( ) =

Content

  • f Bi

Puzzle: this digest must start with 9 zeros

slide-67
SLIDE 67

+ What is Mining?

To solve a cryptographical puzzle, e.g. finding the 'needle in a haystack'

Content of Bi : Transactions SHA256( )

Content

  • f Bi-1

0000001 SHA256( ) = 5AE3454B...9B8163F

Content

  • f Bi

Puzzle: this digest must start with 9 zeros

slide-68
SLIDE 68

+ What is Mining?

To solve a cryptographical puzzle, e.g. finding the 'needle in a haystack'

Content of Bi : Transactions SHA256( )

Content

  • f Bi-1

0000002 SHA256( ) = 4DB6544...A12168D5

Content

  • f Bi

Puzzle: this digest must start with 9 zeros

slide-69
SLIDE 69

+ What is Mining?

To solve a cryptographical puzzle, e.g. finding the 'needle in a haystack'

Content of Bi : Transactions SHA256( )

Content

  • f Bi-1

0000003 SHA256( ) = 000000000...5BB589

Content

  • f Bi

Puzzle: this digest must start with 9 zeros

slide-70
SLIDE 70

+ Consensus: Proof of Work and propagation

slide-71
SLIDE 71

+ Consensus: Proof of Work and propagation

  • 1. Node solves PoW
slide-72
SLIDE 72

+ Consensus: Proof of Work and propagation

  • 1. Node solves PoW
  • 2. Broadcasts block

to neighbors

slide-73
SLIDE 73

+ Consensus: Proof of Work and propagation

  • 1. Node solves PoW
  • 2. Broadcasts block

to neighbors

  • 3. Nodes check that:
  • PoW is valid
  • Block content is

valid then they broadcast to their neighbors

slide-74
SLIDE 74

+ Consensus: Fork

slide-75
SLIDE 75

+

Consensus: Fork

slide-76
SLIDE 76

+ Blockchain

we can distinguish between

How the ledger is structured: chain of blocks

What to write in the ledger: transactions

slide-77
SLIDE 77

+ Transactions

TX 1 TX 2 TX 3 ■

If the ledger maintains the state of the system, a transaction is the

  • peration that alters this state
slide-78
SLIDE 78

+ Transactions

TX 1 TX 2 TX 3 ■

If the ledger maintains the state of the system, a transaction is the

  • peration that alters this state

The state of the system at a certain time (snapshot) is a list of transactions

slide-79
SLIDE 79

+ Transactions

TX 1 TX 2 TX 3 ■

If the ledger maintains the state of the system, a transaction is the

  • peration that alters this state

The state of the system at a certain time (snapshot) is a list of transactions

A new transaction refers to a previous one and updates the state of the system

+ TX 4

slide-80
SLIDE 80

+ Transactions

TX 1 TX 2 TX 3 ■

If the ledger maintains the state of the system, a transaction is the

  • peration that alters this state

The state of the system at a certain time (snapshot) is a list of transactions

A new transaction refers to a previous one and updates the state of the system

A valid transaction is signed using the digital signature of the account that holds the previous one

+ TX 4 TX 1 TX 2 TX 3 TX 4

slide-81
SLIDE 81

+

TX 0 : --> 8A3..45 TX 1 : TX 0 --> 92E..12

  • -> A43..B3

TX 2 : TX 1 --> 532..AB TX 3 : TX 1 --> public keys

Alice Priv Alice Pub

Transactions

Alice Pub

Wallet

slide-82
SLIDE 82

+

TX 0 : --> 8A3..45 TX 1 : TX 0 --> 92E..12

  • -> A43..B3

TX 2 : TX 1 --> 532..AB TX 3 : TX 1 -->

+

TX 4 : TX 3 --> 6D5..34 public keys

sign(TX 4, )

Alice Priv Alice Pub

Transactions

Alice Priv Alice Pub

Wallet

slide-83
SLIDE 83

+

TX 0 : --> 8A3..45 TX 1 : TX 0 --> 92E..12

  • -> A43..B3

TX 2 : TX 1 --> 532..AB TX 3 : TX 1 -->

+

TX 4 : TX 3 --> 6D5..34 public keys

sign(TX 4, )

Alice Priv Alice Pub

Transactions

Alice Priv Alice Pub

TX 0 : --> 8A3..45 TX 1 : TX 0 --> 92E..12

  • -> A43..B3

TX 2 : TX 1 --> 532..AB TX 3 : TX 1 --> TX 4 : TX 3 --> 6D5..34

Alice Pub

Wallet

slide-84
SLIDE 84

+ In Italy

«the storage of a digital document using technology based on DLT produces legal effects of the time stamping of the article 41 of the regulation EU n. 919/2014….»

«La memorizzazione di un documento informatico attraverso l'uso di tecnologie basate su registri distribuiti produce gli effetti giuridici della validazione temporale elettronica di cui all'articolo 41 del regolamento (UE) n. 910/2014 del Parlamento europeo e del Consiglio, del 23 luglio 2014.»

slide-85
SLIDE 85

+

Alice pays Bob 5 euros

Example comparison

Client Server pay(Bob,5)

  • k

DB update(Alice,-5) update(Bob,+5) 1° 2° 3° 4°

slide-86
SLIDE 86

+

Alice pays Bob 5 bitcoin

Example comparison

Client Blockchain Node pay(Bob,5) 1°

dAPP

slide-87
SLIDE 87

+

Alice pays Bob 5 bitcoin

Example comparison

Client Blockchain Node pay(Bob,5) 1°

dAPP

It means to issue a new transaction in the blockchain, hence Alice must refer to a past TX were she received at least 5 bitcoin

slide-88
SLIDE 88

+

Alice pays Bob 5 bitcoin

Example comparison

Client Blockchain Node pay(Bob,5)

  • k

broadcastTX (Alice,Bob,5) 1° 2° 4°

dAPP

It means to issue a new transaction in the blockchain, hence Alice must refer to a past TX were she received at least 5 bitcoin newBlock (Alice,Bob,5) 3° Blockchain Node

slide-89
SLIDE 89

+

Alice pays Bob 5 bitcoin

Example comparison

Client Blockchain Node pay(Bob,5)

  • k

mineNewBlock andBroadcast (Alice,Bob,5) 1° 2°/3° 4°

dAPP

It means to issue a new transaction in the blockchain, hence Alice must refer to a past TX were she received at least 5 bitcoin Blockchain Node

slide-90
SLIDE 90

+

Mirko Zichichi

Smart Contracts

Ethereum

slide-91
SLIDE 91

+ A Smart Contract is (simply) a program

that is executed by all the nodes in a blockchain network

slide-92
SLIDE 92

+

92

APP APP APP APP

Data Center

ISP ISP ISP ISP

Decentralized computing

Traditional apps make requests that are processed by one or a few servers

slide-93
SLIDE 93

+

93

dAPP dAPP APP APP APP APP dAPP dAPP

Data Center

ISP ISP ISP ISP ISP ISP ISP ISP ISP ISP ISP ISP ISP

Decentralized computing

Traditional apps make requests that are processed by one or a few servers dApps make requests that are processed by all the nodes in the blockchain network (Ethereum)

slide-94
SLIDE 94

+

94

Decentralized Applications

Blockchain-based user-facing interfaces which connect the end user to the technology through a combination of underlying Smart Contracts dAPP

Smart Contracts Blockchain

slide-95
SLIDE 95

+

95

Decentralized Applications

Blockchain-based user-facing interfaces which connect the end user to the technology through a combination of underlying Smart Contracts The relationship between dApps, Smart Contracts and the Blockchain is similar to traditional web

  • applications. Client/server app interacts with a

particular server to access its database. Similarly, dApps use Smart Contracts in order to connect to the particular Blockchain upon which they are based (e.g. Ethereum). APP API

DB

dAPP

Smart Contracts Blockchain

slide-96
SLIDE 96

+

96

Trust without a third party

1.

If you have N independent nodes in a network and the majority (⅔ + 1) of them follows the same “consensus mechanism”

slide-97
SLIDE 97

+

97

Trust without a third party

1.

If you have N independent nodes in a network and the majority (⅔ + 1) of them follows the same “consensus mechanism”

2.

If you trust the consensus mechanism (including also the source code it is built upon -> open source)

slide-98
SLIDE 98

+

98

Trust without a third party

1.

If you have N independent nodes in a network and the majority (⅔ + 1) of them follows the same “consensus mechanism”

2.

If you trust the consensus mechanism (including also the source code it is built upon -> open source) then you can trust the correct execution of the program

slide-99
SLIDE 99

+

Practical example why you can trust a smart contract

slide-100
SLIDE 100

+

Practical example why you can trust a smart contract

Client Client Alice Bob Server

slide-101
SLIDE 101

+

Practical example why you can trust a smart contract

Client Client Alice Bob Server

Collusion

slide-102
SLIDE 102

+

Practical example why you can trust a smart contract

Client Client Alice Bob Blockchain network

The majority is honest

dAPP dAPP

slide-103
SLIDE 103

+

103

Practical example why you can not trust a smart contract

slide-104
SLIDE 104

+

104

Practical example why you can not trust a smart contract

  • When a Smart Contract has some bugs

  • > assess the programming code before using it

  • > use standards and common libraries (OpenZeppelin)
slide-105
SLIDE 105

+

105

Practical example why you can not trust a smart contract

  • When a Smart Contract has some bugs

  • > assess the programming code before using it

  • > use standards and common libraries (OpenZeppelin)
  • When the blockchain code has some bugs

○ The DAO attack, 3.6 million ether robbed (~ 70$ million) ○ Force the entire network to revert transactions in the ledger (difficult)

slide-106
SLIDE 106

+

106

Ethereum Smart Contracts

  • Allow to easily maintain data structures in the blockchain
slide-107
SLIDE 107

+

107

Ethereum Smart Contracts

  • Allow to easily maintain data structures in the blockchain
  • A new transaction refers to a previous one and updates the state of the

system

slide-108
SLIDE 108

+

108

Ethereum Smart Contracts

  • Allow to easily maintain data structures in the blockchain
  • A new transaction refers to a previous one and updates the state of the

system ○ In this case the state of the system considers not only monetary transactions, but also data structures in smart contracts

slide-109
SLIDE 109

+

109

Ethereum Smart Contracts

  • Allow to easily maintain data structures in the blockchain
  • A new transaction refers to a previous one and updates the state of the

system ○ In this case the state of the system considers not only monetary transactions, but also data structures in smart contracts ○ The previous one refers to a transaction that holds the contract (machine) code

slide-110
SLIDE 110

+

110

Ethereum Smart Contracts

  • Allow to easily maintain data structures in the blockchain
  • A new transaction refers to a previous one and updates the state of the

system ○ In this case the state of the system considers not only monetary transactions, but also data structures in smart contracts ○ The previous one refers to a transaction that holds the contract (machine) code ○ The new transaction indicate a piece of code to execute in the contract

slide-111
SLIDE 111

+

Example: A voting

  • peration in a

Smart Contract

Wallet Alice Blockchain network

dAPP

Node

slide-112
SLIDE 112

+

Example: A voting

  • peration in a

Smart Contract

Wallet Alice Blockchain network

dAPP

Node execute( SmartContractAddress: VotingContract, methodToExecute: vote, parameters: challengeID, true )

slide-113
SLIDE 113

+

Example: A voting

  • peration in a

Smart Contract

Wallet Alice Blockchain network

dAPP

Node execute( SmartContractAddress: VotingContract, methodToExecute: vote, parameters: challengeID, true )

slide-114
SLIDE 114

+

Example: A voting

  • peration in a

Smart Contract

slide-115
SLIDE 115

+

Mirko Zichichi

Proof Of Location

in Smart Cities

slide-116
SLIDE 116

+

FOAM is an open protocol for a decentralized geospatial data market

slide-117
SLIDE 117

+

FOAM is an open protocol for a decentralized geospatial data market

Crypto-Spatial Coordinate (CSC)

A standard for location in Ethereum Smart Contracts (SC)

slide-118
SLIDE 118

+

FOAM is an open protocol for a decentralized geospatial data market

Crypto-Spatial Coordinate (CSC) Spatial Index and Visualizer (SIV)

A blockchain explorer that enables users to engage and act with spatial data A standard for location in Ethereum Smart Contracts (SC)

slide-119
SLIDE 119

+

FOAM is an open protocol for a decentralized geospatial data market

Crypto-Spatial Coordinate (CSC) Spatial Index and Visualizer (SIV) Proof of Location (POL)

Consensus on whether an event or agent is verifiably at a certain point in time and space A blockchain explorer that enables users to engage and act with spatial data A standard for location in Ethereum Smart Contracts (SC)

slide-120
SLIDE 120

+

CRYPTO-SPATIAL COORDINATES (CSC)

CSC allow any SC to make an immutable claim to a specific location, using:

  • The location geohash
slide-121
SLIDE 121

+

CRYPTO-SPATIAL COORDINATES (CSC)

CSC allow any SC to make an immutable claim to a specific location, using:

  • The location geohash
  • A corresponding Ethereum address
slide-122
SLIDE 122

+

CRYPTO-SPATIAL COORDINATES (CSC)

CSC allow any SC to make an immutable claim to a specific location, using:

  • The location geohash
  • A corresponding Ethereum address
slide-123
SLIDE 123

+

CRYPTO-SPATIAL COORDINATES (CSC)

CSC allow any SC to make an immutable claim to a specific location, using:

  • The location geohash
  • A corresponding Ethereum address
slide-124
SLIDE 124

+

CRYPTO-SPATIAL COORDINATES (CSC)

CSC allow any SC to make an immutable claim to a specific location, using:

  • The location geohash
  • A corresponding Ethereum address

A registry SC takes a CSC and decode its location and Ethereum address Any user can verify if a CSC is where it claims to be by visiting the location The resolution is one square meter -> 500 trillion unique locations

slide-125
SLIDE 125

+

SPATIAL INDEX AND VISUALIZER (SIV)

A General Purpose Visual Blockchain Explorer front-end interface to visualize SC on a map.

slide-126
SLIDE 126

+

A General Purpose Visual Blockchain Explorer front-end interface to visualize SC on a map. NAVIGATE CSCs Spatially-specific CSC- referenced SC are displayed directly in the application

SPATIAL INDEX AND VISUALIZER (SIV)

slide-127
SLIDE 127

+

A General Purpose Visual Blockchain Explorer front-end interface to visualize SC on a map. NAVIGATE CSCs Spatially-specific CSC- referenced SC are displayed directly in the application DEPLOY A SC A SC is directly deployed using an Ethereum Wallet

SPATIAL INDEX AND VISUALIZER (SIV)

slide-128
SLIDE 128

+

A General Purpose Visual Blockchain Explorer front-end interface to visualize SC on a map. VISUALIZE NEW CSC New CSC-referenced SCs are automatically shown NAVIGATE CSCs Spatially-specific CSC- referenced SC are displayed directly in the application DEPLOY A SC A SC is directly deployed using an Ethereum Wallet

SPATIAL INDEX AND VISUALIZER (SIV)

slide-129
SLIDE 129

+ FOAM

PROOF OF LOCATION

Provides the framework and infrastructure to support a decentralized, censorship resistant alternative to GPS.

slide-130
SLIDE 130

+ FOAM

PROOF OF LOCATION

Provides the framework and infrastructure to support a decentralized, censorship resistant alternative to GPS.

Dynamic Pol

■ Provide consensus on whether an event or agent is verifiably at a certain point in time and space

slide-131
SLIDE 131

+ FOAM

PROOF OF LOCATION

Provides the framework and infrastructure to support a decentralized, censorship resistant alternative to GPS.

Static PoL

■ Used for Geographic Points of Interest (PoI) ■ Token Curated Registries (TCRs) are a crypto-economic model for curating human readable lists of POI

Dynamic Pol

■ Provide consensus on whether an event or agent is verifiably at a certain point in time and space

slide-132
SLIDE 132

Static PoL

CONSUMERS

Utilize registry

CANDIDATES Want to be on registry CARTOGRAPHERS

Curate registry

slide-133
SLIDE 133

Static PoL

CONSUMERS

Utilize registry

1. Candidates submit a FOAM Token deposit in order to add a PoI to the registry They wait out an initial challenge CANDIDATES Want to be on registry CARTOGRAPHERS

Curate registry

slide-134
SLIDE 134

Static PoL

CONSUMERS

Utilize registry

1. Candidates submit a FOAM Token deposit in order to add a PoI to the registry They wait out an initial challenge 2. If honest and reputable, the PoI will become part of the list 2. If a Cartographer feels that the proposed POI will degrade the quality of the TCR, he issues a challenge, by submitting an equal amount of tokens: CANDIDATES Want to be on registry CARTOGRAPHERS

Curate registry

+

slide-135
SLIDE 135

Static PoL

CONSUMERS

Utilize registry

1. Candidates submit a FOAM Token deposit in order to add a PoI to the registry They wait out an initial challenge 2. If honest and reputable, the PoI will become part of the list 2. If a Cartographer feels that the proposed POI will degrade the quality of the TCR, he issues a challenge, by submitting an equal amount of tokens: CANDIDATES Want to be on registry CARTOGRAPHERS

Curate registry

+

a. This initiates a voting period among Cartographers They have the ability to verify PoI in person and vote

slide-136
SLIDE 136

Static PoL

CONSUMERS

Utilize registry

1. Candidates submit a FOAM Token deposit in order to add a PoI to the registry They wait out an initial challenge 2. If honest and reputable, the PoI will become part of the list 2. If a Cartographer feels that the proposed POI will degrade the quality of the TCR, he issues a challenge, by submitting an equal amount of tokens: CANDIDATES Want to be on registry CARTOGRAPHERS

Curate registry

+

a. This initiates a voting period among Cartographers They have the ability to verify PoI in person and vote b. If the challenging Cartographer succeeds, the Candidate's deposit is distributed to the winning Cartographers as a reward for helping to curate TCR

+

slide-137
SLIDE 137

Static PoL

CONSUMERS

Utilize registry

1. Candidates submit a FOAM Token deposit in order to add a PoI to the registry They wait out an initial challenge 2. If honest and reputable, the PoI will become part of the list 2. If a Cartographer feels that the proposed POI will degrade the quality of the TCR, he issues a challenge, by submitting an equal amount of tokens: CANDIDATES Want to be on registry CARTOGRAPHERS

Curate registry

+

a. This initiates a voting period among Cartographers They have the ability to verify PoI in person and vote b. If the challenging Cartographer succeeds, the Candidate's deposit is distributed to the winning Cartographers as a reward for helping to curate TCR b. If the challenge is unsuccessful, a percentage of the loser Cartographer’s deposit is forfeited to the Candidate whose PoI was affirmed and to the winning Cartographers

+

slide-138
SLIDE 138

+

  • FOAM PoL implementation is based on LPWAN, a new class of

radio highly promising for IoT

Dynamic PoL (IoT guys!)

Low Power Wide Area Networks

slide-139
SLIDE 139

+

  • FOAM PoL implementation is based on LPWAN, a new class of

radio highly promising for IoT

  • LPWAN can offer the low power and longer battery life of

bluetooth with the range of cellular, and access to the unlicensed radio spectrum

Dynamic PoL (IoT guys!)

Low Power Wide Area Networks

slide-140
SLIDE 140

+

Low Power Wide Area Networks

  • FOAM PoL implementation is based on LPWAN, a new class of

radio highly promising for IoT

  • LPWAN can offer the low power and longer battery life of

bluetooth with the range of cellular, and access to the unlicensed radio spectrum

  • Trade-off are low data

rate and higher latency

  • One of the most promising

new radios, LoRa, can travel 5–15km at 150 MHz and 1 GHz bands and provide bidirectional communication

Dynamic PoL (IoT guys!)

slide-141
SLIDE 141

+

  • 1. ANCHORS &

AUTHORITIES

Independent Radio beacons (Anchors) and Radio gateways (Authorities) start participating in the network by deposing some FOAM Tokens

Dynamic PoL

slide-142
SLIDE 142

+

  • 1. ANCHORS &

AUTHORITIES

Independent Radio beacons (Anchors) and Radio gateways (Authorities) start participating in the network by deposing some FOAM Tokens

  • 2. ZONE FORMATION

Authorities start to establish a Zone and pledge to offer location services that are enforced by a SC

Dynamic PoL

slide-143
SLIDE 143

+

  • 1. ANCHORS &

AUTHORITIES

Independent Radio beacons (Anchors) and Radio gateways (Authorities) start participating in the network by deposing some FOAM Tokens

  • 2. ZONE FORMATION

Authorities start to establish a Zone and pledge to offer location services that are enforced by a SC

  • 3. CLOCK SYNC

Anchors and Authorities send messages until a consensus can be formed on the precise time. This allows to calculate location and to determine the network geometry

Dynamic PoL

slide-144
SLIDE 144

+

  • 1. ANCHORS &

AUTHORITIES

Independent Radio beacons (Anchors) and Radio gateways (Authorities) start participating in the network by deposing some FOAM Tokens

  • 2. ZONE FORMATION

Authorities start to establish a Zone and pledge to offer location services that are enforced by a SC

  • 3. CLOCK SYNC

Anchors and Authorities send messages until a consensus can be formed on the precise time. This allows to calculate location and to determine the network geometry

  • 4. TRIANGULATION

Zones can provide Presence Claims for Customers for a transaction fee. Customer sends a broadcast message to the Zone and Authorities validate his presence through Time Difference Of Arrival

Dynamic PoL

slide-145
SLIDE 145

+

  • 1. ANCHORS &

AUTHORITIES

Independent Radio beacons (Anchors) and Radio gateways (Authorities) start participating in the network by deposing some FOAM Tokens

  • 2. ZONE FORMATION

Authorities start to establish a Zone and pledge to offer location services that are enforced by a SC

  • 3. CLOCK SYNC

Anchors and Authorities send messages until a consensus can be formed on the precise time. This allows to calculate location and to determine the network geometry

  • 5. VERIFIERS

Zones reach consensus through a local blockchain. Verifiers incentivized to check this Zone blockchain for frauds

  • 4. TRIANGULATION

Zones can provide Presence Claims for Customers for a transaction fee. Customer sends a broadcast message to the Zone and Authorities validate his presence through Time Difference Of Arrival

Dynamic PoL

slide-146
SLIDE 146

+

  • 1. ANCHORS &

AUTHORITIES

Independent Radio beacons (Anchors) and Radio gateways (Authorities) start participating in the network by deposing some FOAM Tokens

  • 2. ZONE FORMATION

Authorities start to establish a Zone and pledge to offer location services that are enforced by a SC

  • 3. CLOCK SYNC

Anchors and Authorities send messages until a consensus can be formed on the precise time. This allows to calculate location and to determine the network geometry

  • 6. PROOF OF LOCATION

Verifiers send Verified or Fraud Proofs to the Ethereum Blockchain and the PoL certificates are created

  • 5. VERIFIERS

Zones reach consensus through a local blockchain. Verifiers incentivized to check this Zone blockchain for frauds

  • 4. TRIANGULATION

Zones can provide Presence Claims for Customers for a transaction fee. Customer sends a broadcast message to the Zone and Authorities validate his presence through Time Difference Of Arrival

Dynamic PoL

slide-147
SLIDE 147

+

Platin is a decentralized, incentivized and privacy preserving location credentials service

Secure Verification

  • f Location Claims

User location detection is secured through the use of different mechanisms

Zero Knowledge Proof of Location

User data is protected using the Zero Knowledge Proof protocol

slide-148
SLIDE 148

+

Secure Verification of Location Claims

1. Sensor Fusion

■ Location-relevant sensors: GPS, Bluetooth, WiFi, cellular network and accelerometers

slide-149
SLIDE 149

+

Secure Verification of Location Claims

1. Sensor Fusion 2. Behavior Over Time

■ Location-relevant sensors: GPS, Bluetooth, WiFi, cellular network and accelerometers ■ Tracks user behavior over longer periods of time and builds up users’ reputation scores ■ AI technologies enable to secure both sensor fusion and behavior over time (XAIN Technologies)

slide-150
SLIDE 150

+

Secure Verification of Location Claims

1. Sensor Fusion 2. Behavior Over Time 3. P2P Witnessing

■ Location-relevant sensors: GPS, Bluetooth, WiFi, cellular network and accelerometers ■ Tracks user behavior over longer periods of time and builds up users’ reputation scores ■ AI technologies enable to secure both sensor fusion and behavior over time (XAIN Technologies) ■ Users will be able to act as witnesses for each others’ locations through the use of short-range communication ■ Users’ efforts in verifying other’s location claims will be rewarded

slide-151
SLIDE 151

+

Zero Knowledge Proof of Location

Protocol that allows a Verifier to test whether position committed by a Prover is inside or

  • utside the radius of a service area, without revealing exact location
slide-152
SLIDE 152

+ Zero Knowledge Proof of Location

[1\2]

Sphere Equation

ALICE

Prover

BOB

Verifier Alice’s position Reference point’s position

slide-153
SLIDE 153

+ Zero Knowledge Proof of Location

[1\2]

Sphere Equation

ALICE

Prover

BOB

Verifier Alice’s position Reference point’s position

slide-154
SLIDE 154

+

Alice’s position Reference point’s position

Zero Knowledge Proof of Location [1\2]

Sphere Equation

ALICE

Prover

BOB

Verifier

slide-155
SLIDE 155

+

No tuple exists for negative differences (points outside the range)

Alice’s position Reference point’s position

Zero Knowledge Proof of Location [2\2]

Lagrange Theorem

ALICE

Prover

BOB

Verifier

slide-156
SLIDE 156

+ Discrete logarithm to hide the secret

Let p and q be primes, n = pq. Then for some (properly chosen) positive g < n, the function: is a one-way function if p and q are unknown. Hence Alice only needs to report values , and in order to let Bob verify the distance, without knowing , through the equality:

ALICE

Prover

BOB

Verifier

slide-157
SLIDE 157

+

PLATIN

Use case Tokyo Olympics 2020

slide-158
SLIDE 158

+ Questions?

I ask you: Could Proof of Location be used as evidence?