George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil...

65
Graphene: A New Protocol for Block Propagation Using Set Reconciliation A. Pinar Ozisik George Bissias Gavin Andresen Amir Houmansadr Brian Neil Levine

Transcript of George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil...

Page 1: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

Graphene: A New Protocol for Block Propagation Using Set Reconciliation

A. Pinar OzisikGeorge Bissias

Gavin AndresenAmir Houmansadr

Brian Neil Levine

Page 2: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Problem Definition• This presentation is focused on relaying information quickly to a neighbor.

• on the fast Relay Network or the p2p network.

• It’s about avoiding sending a lot of data between peers, like so:

Alice Bob

has block

wants block

mempool

Page 3: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Problem Definition• This presentation is focused on relaying information quickly to a neighbor.

• on the fast Relay Network or the p2p network.

• It’s about avoiding sending a lot of data between peers, like so:

Alice Bob

invhas

blockwants block

mempool

Page 4: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Problem Definition• This presentation is focused on relaying information quickly to a neighbor.

• on the fast Relay Network or the p2p network.

• It’s about avoiding sending a lot of data between peers, like so:

Alice Bob

getdatainv

has block

wants block

mempool

Page 5: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Problem Definition• This presentation is focused on relaying information quickly to a neighbor.

• on the fast Relay Network or the p2p network.

• It’s about avoiding sending a lot of data between peers, like so:

Alice Bobheader, full txns

getdatainv

has block

wants block

mempool

Page 6: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Problem Definition• This presentation is focused on relaying information quickly to a neighbor.

• on the fast Relay Network or the p2p network.

• It’s about avoiding sending a lot of data between peers, like so:

Alice Bob

invgetdata

header, full txns

has block

wants block

mempool

Page 7: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Problem Definition

• Block announcements propagate faster when they are smaller.

• Faster propagation means less orphaning, which means mining is efficient.

• This isn’t a presentation about reducing the size of the stored blockchain.

Alice Bob

invgetdata

header, full txns

has block

wants block

mempool

Page 8: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Results• Graphene’s block announcements are ⅒ the size of current methods.

• No increase in roundtrip time. • Not a significant use of storage or CPU.

• Combines two known tools from set reconciliation literature in a nifty way. • Bloom Filters and IBLTs

• Why does it work? We are optimizing Bitcoin’s special case: • Everyone needs to know everything. • Blocks are comprised of transactions that everyone should have heard already.

Page 9: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Overview• A series of protocols:

• Compact Blocks • Xtreme Thin Blocks • Soot [fake] • IBLTs • Graphene

Page 10: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 1: Compact Blocks

• We don’t need to send the full transactions.

• We can send just the 2xSHA256 (32-byte) transaction IDs.

• And we only need the first 5 or 6 bytes. Odds of mistake are 1 in a trillion.

Alice Bob

invgetdatahas

blockwants block

BIP 152 Matt Corallo

mempool

Page 11: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 1: Compact Blocks

• We don’t need to send the full transactions.

• We can send just the 2xSHA256 (32-byte) transaction IDs.

• And we only need the first 5 or 6 bytes. Odds of mistake are 1 in a trillion.

Alice Bob

invgetdatahas

blockwants block

BIP 152 Matt Corallo

mempoolheader, txnIDs

Page 12: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 1: Compact Blocks

• We don’t need to send the full transactions.

• We can send just the 2xSHA256 (32-byte) transaction IDs.

• And we only need the first 5 or 6 bytes. Odds of mistake are 1 in a trillion

• Now a 1MB block with can be expressed in 80+4200*5 = 21KB • An 8MB block reduces to 80+4200*8*5 = 164KB

Alice Bobheader, txnIDs

getdatainv

has block

wants block

mempool

BIP 152 Matt Corallo

Page 13: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Evaluation• Linear growth with the

number of transactions included in the block.

• Size is independent of mempool.

●●●●

0 8000 16000 24000 32000 40000

020406080

100120140160180200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

Protocol ●● Compact Blocks

●●●●

0 8000 16000 24000 32000 40000

020406080

100120140160180200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

Protocol ●● Compact Blocks

https://bitcoincore.org/en/2016/06/07/compact-blocks-faq/

Page 14: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 2: Bloom Filters• Can we do better? Yes!

• Our neighbors already have these transactions IDs.

• They are likely only missing a few.

• Alice can each express the set of transactions in the block or her mempoolas a Bloom Filter.

• Bob could do the same thing!

• Bloom filters allow us to quickly check if an item is a member of a set.

Page 15: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

0 0 0 0 0 0 0

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

Page 16: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

insert: txn1H1(txn1) = 1 H2(txn1) = 4

0 0 0 0 0 0 0

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

Page 17: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

insert: txn1H1(txn1) = 1 H2(txn1) = 4

0 0 0 0 0 0 01

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

Page 18: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

insert: txn1H1(txn1) = 1 H2(txn1) = 4

0 0 0 0 0 0 01 1

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

Page 19: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

insert: txn1H1(txn1) = 1 H2(txn1) = 4

0 0 0 0 0 0 01 1

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

insert: txn2H1(txn2) = 0 H2(txn2) = 4

Page 20: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

insert: txn1H1(txn1) = 1 H2(txn1) = 4

0 0 0 0 0 0 01 1

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

insert: txn2H1(txn2) = 0 H2(txn2) = 4

1

Page 21: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Bloom Filter: Insertion [0] [1] [2] [3] [4] [5] [6]

insert: txn1H1(txn1) = 1 H2(txn1) = 4

0 0 0 0 0 0 01 1

B. Bloom: Space/Time Trade-offs in Hash Coding with Allowable Errors. Communications of the ACM 13(7), 422–426 (Jul 1970)

insert: txn2H1(txn2) = 0 H2(txn2) = 4

1 1

Page 22: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

1

Bloom Filters: Check [0] [1] [2] [3] [4] [5] [6]

0 0 0 011

Page 23: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

1

Bloom Filters: Check [0] [1] [2] [3] [4] [5] [6]

Is txn1 in the set? H1(txn1) = 1, H2(txn1) = 4

cell 1 = 1cell 4 = 1

Yes!

0 0 0 011

True Positive

Page 24: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

1

Bloom Filters: Check [0] [1] [2] [3] [4] [5] [6]

Is txn1 in the set? H1(txn1) = 1, H2(txn1) = 4

cell 1 = 1cell 4 = 1

Yes!

0 0 0 011

Is txn3 in the set? H1(txn3) = 1, H2(txn3) = 5

cell 1 = 1cell 5 = 0

No!True Positive True Negative

Page 25: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

1

Bloom Filters: Check [0] [1] [2] [3] [4] [5] [6]

Is txn1 in the set? H1(txn1) = 1, H2(txn1) = 4

cell 1 = 1cell 4 = 1

Yes!

0 0 0 011

Is txn3 in the set? H1(txn3) = 1, H2(txn3) = 5

cell 1 = 1cell 5 = 0

No!

Is txn4 in the set? H1(txn4) = 0, H2(txn4) = 1

cell 0 = 1cell 1 = 1

Yes!True Positive True Negative False Positive

Page 26: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

1

Bloom Filters: Check [0] [1] [2] [3] [4] [5] [6]

Is txn1 in the set? H1(txn1) = 1, H2(txn1) = 4

cell 1 = 1cell 4 = 1

Yes!

0 0 0 011

Is txn3 in the set? H1(txn3) = 1, H2(txn3) = 5

cell 1 = 1cell 5 = 0

No!

Is txn4 in the set? H1(txn4) = 0, H2(txn4) = 1

cell 0 = 1cell 1 = 1

Yes!True Positive True Negative False Positive

False Negatives are not possible.

Page 27: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

1

Bloom Filters: Check [0] [1] [2] [3] [4] [5] [6]

Is txn1 in the set? H1(txn1) = 1, H2(txn1) = 4

cell 1 = 1cell 4 = 1

Yes!

0 0 0 011

Is txn3 in the set? H1(txn3) = 1, H2(txn3) = 5

cell 1 = 1cell 5 = 0

No!

Is txn4 in the set? H1(txn4) = 0, H2(txn4) = 1

cell 0 = 1cell 1 = 1

Yes!True Positive True Negative False Positive

False Negatives are not possible.

The False Positive Rate is tunable: More bits will lower the FPR.

Page 28: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 2: Xtreme Thinblocks

• We are sending all txnIDs and we are sending a Bloom Filter.

• This is more data across the network than Compact Blocks.

Alice

has block

Bob

wants block

mempool

Peter Tschipper

Page 29: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 2: Xtreme Thinblocks

• We are sending all txnIDs and we are sending a Bloom Filter.

• This is more data across the network than Compact Blocks.

inv

Alice

has block

Bob

wants block

mempool

Peter Tschipper

Page 30: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 2: Xtreme Thinblocks

• We are sending all txnIDs and we are sending a Bloom Filter.

• This is more data across the network than Compact Blocks.

getdata, Bloom(mempool)inv

Alice

has block

Bob

wants block

mempool

Peter Tschipper

Page 31: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 2: Xtreme Thinblocks

• We are sending all txnIDs and we are sending a Bloom Filter.

• This is more data across the network than Compact Blocks.

header, txnIDs

getdata, Bloom(mempool)inv

Alice

has block

Bob

wants block

mempool

Peter Tschipper

Page 32: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• Soot is not a real protocol…

• Send INV for each TXNs in the block ahead of the block INV.

• if they haven’t already been sent or received.

Alice

has block

Bob

wants block

mempool

• We need a low FPR for the Sender’s Bloom filter.

• Can’t base it on size of the block!

• Let m be the number of transactions in the mempool.

Page 33: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• Soot is not a real protocol…

• Send INV for each TXNs in the block ahead of the block INV.

• if they haven’t already been sent or received.

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempool

• We need a low FPR for the Sender’s Bloom filter.

• Can’t base it on size of the block!

• Let m be the number of transactions in the mempool.

Page 34: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• Soot is not a real protocol…

• Send INV for each TXNs in the block ahead of the block INV.

• if they haven’t already been sent or received.

inv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempool

• We need a low FPR for the Sender’s Bloom filter.

• Can’t base it on size of the block!

• Let m be the number of transactions in the mempool.

Page 35: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• Soot is not a real protocol…

• Send INV for each TXNs in the block ahead of the block INV.

• if they haven’t already been sent or received.

getdata, minv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempool

• We need a low FPR for the Sender’s Bloom filter.

• Can’t base it on size of the block!

• Let m be the number of transactions in the mempool.

Page 36: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• Soot is not a real protocol…

• Send INV for each TXNs in the block ahead of the block INV.

• if they haven’t already been sent or received.

getdata, minv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempoolheader, S=Bloom(txnIDs)fpr=1/m

• We need a low FPR for the Sender’s Bloom filter.

• Can’t base it on size of the block!

• Let m be the number of transactions in the mempool.

Page 37: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• Soot is not a real protocol…

• Send INV for each TXNs in the block ahead of the block INV.

• if they haven’t already been sent or received.

getdata, minv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempoolheader, S=Bloom(txnIDs)fpr=1/m

• We need a low FPR for the Sender’s Bloom filter.

• Can’t base it on size of the block!

• Let m be the number of transactions in the mempool.

Block = mempool found in S

Page 38: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

Bob

wants block

mempoolgetdata, m

inv(prioritize TXN inv’s)

Block = mempool found in SAlice

has block

header, S=Bloom(txnIDs)fpr=1/m

• If FPR=1/m, then we expect 1 transaction from mempool to falsely appear to be in the block.

• Block reconstruction will fail every block!

Page 39: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 3: Soot

• If FPR=1/m, then we expect 1 transaction from mempool to falsely appear to be in the block.

• Block reconstruction will fail every block!

• If FPR=1/(100m), once every 100 blocks, the receiver will fail to reconstruct the block.

• In that case, fall back to Compact Blocks.

Bob

wants block

mempoolgetdata, m

inv(prioritize TXN inv’s)

Block = mempool found in SAlice

has block

header, S=Bloom(txnIDs)fpr=1/m

Page 40: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Performance of 1/(100m) Soot

Performance now depends on size of the mempool.

●●●●●

●●●●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

●●●●●

●●●●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

●●●●●

●●●●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

Page 41: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Performance of 1/(100m) Soot

Performance now depends on size of the mempool.

●●●●●

●●●●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

●●●●●

●●●●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

●●●●●

●●●●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

●●

●●

02468

101214161820222426

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● 1001000

10000100000

Compact Blocks

Page 42: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Invertible Bloom Lookup Tables (IBLTs)• Can we do better? Yes!

• M. Goodrich and M. Mitzenmacher "Invertible Bloom Lookup Tables” Proc. Conf. on Comm., Control, and Computing. pp. 792–799, Sept 2011

• D. Eppstein, M. Goodrich, F. Uyeda, G. Varghese"What's the difference?: efficient set reconciliation without prior context." Prof. ACM SIGCOMM 2011

Page 43: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Invertible Bloom Lookup Tables (IBLTs)• Invertible Bloom Lookup Tables are a generalization of Bloom Filters.

• Instead of a bit, cells include a count and actual content.

A,B, C, D, E, F, G

Page 44: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Invertible Bloom Lookup Tables (IBLTs)• Invertible Bloom Lookup Tables are a generalization of Bloom Filters.

• Instead of a bit, cells include a count and actual content.

A,B, C, D, E, F, G

• Special IBLT feature: • If you have two lists that differ by no more than ~15%, you can compare

an IBLT of each list and recover the items that are different.

Page 45: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Invertible Bloom Lookup Tables (IBLTs)• Invertible Bloom Lookup Tables are a generalization of Bloom Filters.

• Instead of a bit, cells include a count and actual content.

A,B, C, D, E, F, G

A,B, C, X, E, F, G

• Special IBLT feature: • If you have two lists that differ by no more than ~15%, you can compare

an IBLT of each list and recover the items that are different.

Page 46: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Invertible Bloom Lookup Tables (IBLTs)• Invertible Bloom Lookup Tables are a generalization of Bloom Filters.

• Instead of a bit, cells include a count and actual content.

A,B, C, D, E, F, G

A,B, C, X, E, F, G

— = +D-X

• Special IBLT feature: • If you have two lists that differ by no more than ~15%, you can compare

an IBLT of each list and recover the items that are different.

Page 47: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Invertible Bloom Lookup Tables (IBLTs)• Invertible Bloom Lookup Tables are a generalization of Bloom Filters.

• Instead of a bit, cells include a count and actual content.

A,B, C, D, E, F, G

A,B, C, X, E, F, G

— = +D-X

• Special IBLT feature: • If you have two lists that differ by no more than ~15%, you can compare

an IBLT of each list and recover the items that are different. • The size of IBLTs does not depend on the original list. • The size depends on only the expected difference between the two lists.

Page 48: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 4: IBLTs

• Works very well until the receiver’s mempool size is much larger than the block.

• The size of the IBLT will depend on the symmetric difference between the block and the receiver’s mempool.

• But we don’t know this value and don’t want to waste roundtrip times failing.

Alice

has block

Bob

wants block

Gavin Andresen;Rosenbaum and Russell

mempool

Page 49: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 4: IBLTs

• Works very well until the receiver’s mempool size is much larger than the block.

• The size of the IBLT will depend on the symmetric difference between the block and the receiver’s mempool.

• But we don’t know this value and don’t want to waste roundtrip times failing.

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

Gavin Andresen;Rosenbaum and Russell

mempool

Page 50: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 4: IBLTs

• Works very well until the receiver’s mempool size is much larger than the block.

• The size of the IBLT will depend on the symmetric difference between the block and the receiver’s mempool.

• But we don’t know this value and don’t want to waste roundtrip times failing.

inv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

Gavin Andresen;Rosenbaum and Russell

mempool

Page 51: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 4: IBLTs

• Works very well until the receiver’s mempool size is much larger than the block.

• The size of the IBLT will depend on the symmetric difference between the block and the receiver’s mempool.

• But we don’t know this value and don’t want to waste roundtrip times failing.

getdatainv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

Gavin Andresen;Rosenbaum and Russell

mempool

Page 52: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 4: IBLTs

• Works very well until the receiver’s mempool size is much larger than the block.

• The size of the IBLT will depend on the symmetric difference between the block and the receiver’s mempool.

• But we don’t know this value and don’t want to waste roundtrip times failing.

getdatainv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

header, I=IBLT(txnIDs)

Gavin Andresen;Rosenbaum and Russell

mempool

Page 53: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 4: IBLTs

• Works very well until the receiver’s mempool size is much larger than the block.

• The size of the IBLT will depend on the symmetric difference between the block and the receiver’s mempool.

• But we don’t know this value and don’t want to waste roundtrip times failing.

getdatainv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

I’= IBLT(mempool)if (I-I’) decodes, DONE

else repeat with larger IBLT

header, I=IBLT(txnIDs)

Gavin Andresen;Rosenbaum and Russell

mempool

Page 54: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Performance• Bytes are proportional to

symmetric difference between block and mempool.

• Can we do better? Yes!

●●●●●

●●

●●

0 8000 16000 24000 32000 40000

0

50

100

150

200

250

300

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

●● Compact BlocksMempool=100

Mempool=1000Mempool=10000

Page 55: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 5: Graphene• It’s expensive to make Bloom Filters when symmetric difference is high.

It’s expensive to make IBLTs when symmetric difference is high.

• Solution: • use a Bloom Filter to reduce the symmetric difference between block and

mempool.• use the IBLT to recover from small errors in the Bloom Filter

• We don’t need a very low FPR for the Bloom Filter because the IBLT will help us recover.

• Recall that the size of the IBLT is based on only the difference between two lists.

Page 56: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Optimally Small• We shrink the Bloom filter to an FPR=1/m.

• We expect one false positive. • Make an IBLT expecting just one difference. It will be a small IBLT. • The output of comparing the two IBLTs will be exactly which txnID is the false positive.

• It turns out, we can parameterize the FPR and IBLT together so that the sum bytes are optimally small.

• Roughly, given a block of n transactions and a mempool of m transactions, the FPR that provides the optimally small sized of IBLT and BF is FPR =

Page 57: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 5: Graphene

• We ensure that the IBLT decodes by setting the FPR correctly. • Decode failure is 1 in a 1000.

inv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempool

Page 58: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 5: Graphene

• We ensure that the IBLT decodes by setting the FPR correctly. • Decode failure is 1 in a 1000.

getdata, minv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

mempool

Page 59: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 5: Graphene

• We ensure that the IBLT decodes by setting the FPR correctly. • Decode failure is 1 in a 1000.

getdata, minv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

header, S=Bloom(txnIDs),I=IBLT(txnIDs) mempool

Page 60: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Protocol 5: Graphene

• We ensure that the IBLT decodes by setting the FPR correctly. • Decode failure is 1 in a 1000.

getdata, minv

Alice

has block

Bob

wants block

(prioritize TXN inv’s)

m’ = mempool found in S I’= IBLT(m’)if I-I’ decodes, DONE; else repeat with larger IBLT

header, S=Bloom(txnIDs),I=IBLT(txnIDs) mempool

Page 61: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Graphene Performance

0 1000 2000 3000 4000

02468

101214161820222426

02468101214161820222426

0.0 0.2 0.4 0.6 0.8 1.0

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

Resulting Block (KB)

●● Compact Blocks

Mempool=0

Mempool=100

Mempool=1000

Mempool=10000

Mempool=100000

Page 62: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Graphene Performance

●●●●

●●

●●

0 10000 20000 30000 40000

0

20

40

60

80

100

120

140

160

180

200

0

20

40

60

80

100

120

140

160

180

200

0 1 2 3 4 5 6 7 8 9 10

txns

Original Block Size (MB)

Res

ultin

g Bl

ock

(KB)

Resulting Block (KB)

●● Compact Blocks

Mempool=0

Mempool=100

Mempool=1000

Mempool=10000

Mempool=100000

Page 63: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

U N I V E R S I T Y O F M A S S A C H U S E T T S A M H E R S T

Conclusions• Graphene’s block announcements are ⅒ the size of current methods.

• Fits within one IP packet • No increase in roundtrip time of Compact Blocks • Not a significant use of storage or CPU.

• Combines two known tools from set reconciliation literature in a nifty way. • Bloom Filters and IBLTs

• PDF: http:forensics.cs.umass.edu/graphene

Page 64: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation
Page 65: George Bissias for Block Propagation Gavin Andresen Using ...€¦ · Amir Houmansadr Brian Neil Levine. UNIVERSITY OF MASSACHUSETTS AMHERST Problem Definition • This presentation

200,000

100,000

50,000

25,000

75,000

125,000

175,000

150,000

0May June July August September October November

2017

Unconfirmed Transaction Count (Mempool)

https://core.jochen-hoenicke.de/queue/#all