Locality-Preserving Blockchain Implementation Maxime Sierro DEDIS - - PowerPoint PPT Presentation

locality preserving blockchain implementation
SMART_READER_LITE
LIVE PREVIEW

Locality-Preserving Blockchain Implementation Maxime Sierro DEDIS - - PowerPoint PPT Presentation

Locality-Preserving Blockchain Implementation Maxime Sierro DEDIS Lab Supervisors : Kelong Cong, Cristina Basescu Responsible : Prof. Bryan Ford Introduction Project goal : implement a blockchain system which is adapted to Nyle. A Nyle


slide-1
SLIDE 1

Locality-Preserving Blockchain Implementation

Maxime Sierro DEDIS Lab Supervisors : Kelong Cong, Cristina Basescu Responsible : Prof. Bryan Ford

slide-2
SLIDE 2

Introduction

slide-3
SLIDE 3

Project goal : implement a blockchain system which is adapted to Nyle.

A Nyle network is comprised of different subregions

slide-4
SLIDE 4

Each region has its own associated blockchain. Focus on the network's handling of transactions (consensus protocol already implemented)

slide-5
SLIDE 5

Main goals :

  • Get transactions validated automatically
  • Efficient storage system
  • Secure against double spending
  • Cross region transactions
slide-6
SLIDE 6

Design

slide-7
SLIDE 7

Transactions

Emphasis on the network, not the actors : Transactions should be simple

slide-8
SLIDE 8

Transaction structure

  • The coin's identity
  • A reference to the previous transaction for this coin
  • The sender’s public key
  • The receiver's public key
  • The sender's signature
slide-9
SLIDE 9

Transaction validity

  • The previous transaction referenced is the last one the

node considers valid for this coin

  • That previous transaction’s receiver is the current

transaction’s sender

  • The signature was produced by the sender
slide-10
SLIDE 10

Process

Transactions should be submitted for approval, propagated and stored. Let's explain the process with an example

slide-11
SLIDE 11

4 overlapping inclusive regions Simple example : only one tree per region

slide-12
SLIDE 12

Roots of the 4 trees corresponding to each region. Suppose the red root learns of a transaction

slide-13
SLIDE 13

Goal : launch a consensus for every tree it is a part of: Yellow, green and red

slide-14
SLIDE 14

Red tree : can launch the protocol by itself since it is the root

slide-15
SLIDE 15

Green tree : Need to transmit the transaction to the root Then this root launches the protocol

slide-16
SLIDE 16

Yellow tree : same process

slide-17
SLIDE 17

All 3 happen concurrently. When a protocol is a success : the root propagates the transaction and the agg

slide-18
SLIDE 18

=> Every node receives the transaction but only the aggregate signatures they helped create

slide-19
SLIDE 19

Number of aggregate signatures each node receives Since the initial node was not part of the blue tree, it had no impact.

3 3 3 2 2 1 1 1 1

slide-20
SLIDE 20

Storage

  • Don't store duplicate transactions
  • Store signatures along the corresponding transaction
  • Keep track of each coin's latest transaction for each tree
slide-21
SLIDE 21

Implementation

slide-22
SLIDE 22

Cothority layers

There are 3 layers :

  • Protocol : validates transactions and signs

them

  • Service : launches protocols, propagates and

stores data

  • API : sends data to services

Let's see how they interact step by step.

slide-23
SLIDE 23

API Service Protocol Storage :

Transactions, signatures Coin's latest transaction Coin availability

The "coin availability" storage section is mandatory against double spending. Each tree has its own availabilities and they are atomic.

slide-24
SLIDE 24

API Service Protocol Storage :

Step 1: Setup Each service accesses the network's information to store which trees it is a part of.

Setup

Transactions, signatures Coin's latest transaction Coin availability

slide-25
SLIDE 25

API Service Protocol

Step 2 : Genesis transaction handling Transaction stored. For every tree : new coin is available and its latest transaction is the genesisTx.

New coin + First holder

GenesisTx

Storage :

H(GenesisTx) Available 1 2

Transactions, signatures Coin's latest transaction Coin availability

slide-26
SLIDE 26

API Service Protocol

Step 3 : Transaction handling Service relays transaction to roots If 3 conditions OK : start protocols concurrently

Transaction

Storage :

Transaction

Transaction

Transaction validity check 1 2 3 4

Transactions, signatures Coin's latest transaction Coin availability

slide-27
SLIDE 27

API Service Protocol

Step 4 : Transaction validation Protocols mark the coin as unavailable for their tree. Each node checks for the 3 conditions inside the protocol.

Storage :

Available => unavailable Transaction validity check

Aggregate signature

1 2

Transactions, signatures Coin's latest transaction Coin availability

slide-28
SLIDE 28

API Service Protocol

Step 5 : Propagation and storing Root services propagate the Tx and signature along the corresponding trees. Services verify the signature, then update the storage.

Storage :

Transaction + aggregate signature

Transactions, signatures Coin's latest transaction Coin availability

1 2 Transaction + aggregate signature H(Transaction) Unavailable => available 3

slide-29
SLIDE 29

Cross region spending

What if 2 successive transactions on a same coin happen in different regions ?

Tx1 : A sends coin "0" to B Tx2 : B sends coin "0" to C

Nodes will only launch a protocol for Tx2 on a tree if it fulfils the 3 conditions : => the latest Tx for that tree needs to be Tx1.

slide-30
SLIDE 30

If Tx1 happens in the red region, then Tx2 happens in the blue region...

slide-31
SLIDE 31

The blue root will refuse to launch the protocol because Tx1 was not marked as the latest Tx for this tree. It can only contact the yellow root which will accept launching a global protocol for Tx2.

slide-32
SLIDE 32

Easiest solution : When a node marks a Tx as the coin's latest for a tree, it should automatically mark it as the latest for each of the subtrees as well.

slide-33
SLIDE 33

Simulation

slide-34
SLIDE 34

Transaction size

  • Public key of the sender : 128B
  • Public key of the receiver : 128B
  • Sender’s signature : 64B
  • Payload of dummy data : 650B

Total : 1KB

slide-35
SLIDE 35

Simulation summary

  • 100 unrelated transactions of 1KB each, sent to different

services "fairly"

  • Aggregate signatures of 64B
  • API computes the average storage used per "number of

trees a node is a part of" for those 100 transactions

  • 3 simulations on networks of different sizes
slide-36
SLIDE 36

Theoretical storage used for 100 transactions

slide-37
SLIDE 37

100*(1'000 + 32 + 3*64) = 122′400 bytes

Upper bound 1000 : transaction size 32 : index size in the storage system 3*64 : aggregate signatures size

Upper bound for 3 nodes :

slide-38
SLIDE 38

100*(1'000 + 32 + 22*64) = 244′000 bytes

1000 : transaction size 32 : index size in the storage system 22*64 : aggregate signatures size

Upper bound for 22 nodes :

slide-39
SLIDE 39

100*(1'000 + 32 + 4*64) = 128′800 bytes

1000 : transaction size 32 : index size in the storage system 4*64 : aggregate signatures size

Upper bound for 4 nodes :

slide-40
SLIDE 40

Runtimes : 50-nodes network : 2:16 75 nodes network : 4:03 100-nodes network : 7:50

slide-41
SLIDE 41

Future work

slide-42
SLIDE 42
  • Implement subtree functionality in the "tree-based"

version of the project

  • Concurrent unrelated transactions
  • Redesign set-based storing