WHAT DO WE KNOW ABOUT THE TOPOLOGY? WHAT DO WE KNOW ABOUT THE - - PowerPoint PPT Presentation

what do we know about the topology what do we know about
SMART_READER_LITE
LIVE PREVIEW

WHAT DO WE KNOW ABOUT THE TOPOLOGY? WHAT DO WE KNOW ABOUT THE - - PowerPoint PPT Presentation

# SFBW19 TxProbe: Discovering Bitcoins Network Topology Using Orphan Transactions Sergi Delgado-Segura , Surya Bakshi, Cristina Prez-Sol, James Litton, Andrew Pachulski, Andrew Miller and Bobby Bhattacharjee sr_gi WHAT DO WE KNOW ABOUT THE


slide-1
SLIDE 1

Sergi Delgado-Segura, Surya Bakshi, Cristina Pérez-Solà, James Litton, Andrew Pachulski, Andrew Miller and Bobby Bhattacharjee

TxProbe: Discovering Bitcoin’s Network Topology Using Orphan Transactions

sr_gi

#SFBW19

slide-2
SLIDE 2

WHAT DO WE KNOW ABOUT THE TOPOLOGY?

slide-3
SLIDE 3

WHAT DO WE KNOW ABOUT THE TOPOLOGY?

Number of nodes and location of them

slide-4
SLIDE 4

WHAT DO WE KNOW ABOUT THE TOPOLOGY?

Number of nodes and location of them

slide-5
SLIDE 5

WHAT DO WE KNOW ABOUT THE TOPOLOGY?

Number of nodes and location of them The edges are hidden by design

slide-6
SLIDE 6

WHY HAVE A HIDDEN TOPOLOGY?

An open topology could ease different types of attacks:

  • Transaction deanonymization
  • Network based attacks (e.g: Eclipse attacks)

The current approach of the Bitcoin Core is to keep it hidden

slide-7
SLIDE 7

WHY HAVE AN OPEN TOPOLOGY?

We know nothings about how the network really is:

  • Is the network decentralised?
  • Are there supernodes controlling the network traffic?
  • Information withholding
  • Censorship
  • Are there weak spots in the network that can be easily isolated?

Security by obscurity does not seem the proper way to go

slide-8
SLIDE 8

THE TOPOLOGY SHOULD LOOK RANDOM

How Bitcoin (Core client) nodes choose their peers?

  • Pseudorandomly from the addrman
  • 8 outbound connections by default

No pair of nodes in the same /16 (IPv4)

  • 117 inbound connection by default (no IP restriction here)

Bitcoin forks based on the Core client follow the same approach

slide-9
SLIDE 9

BACKGROUND

Our inferring technique is based on transaction propagation We take advantage of how transactions are handled by nodes:

  • orphans transactions
  • double-spending transactions
slide-10
SLIDE 10

Valid transaction are stored in mempool Transaction in mempool are eventually propagated throughout the node neighborhood

A B

TRANSACTION PROPAGATION IN BITCOIN

slide-11
SLIDE 11

Valid transaction are stored in mempool Transaction in mempool are eventually propagated throughout the node neighborhood

A B i n v ( h ( t x

n

) ) a n n

  • u

n c e

TRANSACTION PROPAGATION IN BITCOIN

slide-12
SLIDE 12

Valid transaction are stored in mempool Transaction in mempool are eventually propagated throughout the node neighborhood

A B i n v ( h ( t x

n

) ) get_data(h(txn)) a n n

  • u

n c e request

TRANSACTION PROPAGATION IN BITCOIN

slide-13
SLIDE 13

Valid transaction are stored in mempool Transaction in mempool are eventually propagated throughout the node neighborhood

A B i n v ( h ( t x

n

) ) get_data(h(txn)) a n n

  • u

n c e request

TRANSACTION PROPAGATION IN BITCOIN

Wait for tx up to 2 min

slide-14
SLIDE 14

Valid transaction are stored in mempool Transaction in mempool are eventually propagated throughout the node neighborhood

A B inv(h(txn)) get_data(h(txn)) tx(txn) announce request deliver

TRANSACTION PROPAGATION IN BITCOIN

Wait for tx up to 2 min

slide-15
SLIDE 15

A transaction is orphan if some of the referenced UTXOs are unknown They can not be validated, so they are stored in a separated data structure known as MapOrphanTransactions (or OrphanPool for short) Transactions in MapOrphanTransactions are NOT forwarded to any node If the same transactions is offered again to the node (inv message), it will not requested back (getaddr)

ORPHAN TRANSACTIONS

txB txC txD Orphan transaction

slide-16
SLIDE 16

DOUBLE-SPENDING TRANSACTIONS

A

id = 4F3…ED

Source: 4F3…ED

To: Bob

Source: 4F3…ED

To: Alice

txB txB’

B

. . .

B’s mempool

txn-1 tx0

slide-17
SLIDE 17

DOUBLE-SPENDING TRANSACTIONS

A

id = 4F3…ED

Source: 4F3…ED

To: Bob

Source: 4F3…ED

To: Alice

txB txB’

B

. . .

B’s mempool

txn-1 tx0

slide-18
SLIDE 18

DOUBLE-SPENDING TRANSACTIONS

A

id = 4F3…ED

Source: 4F3…ED

To: Bob

Source: 4F3…ED

To: Alice

txB txB’

B

. . .

B’s mempool

txn-1 tx0 txB

slide-19
SLIDE 19

DOUBLE-SPENDING TRANSACTIONS

A

id = 4F3…ED

Source: 4F3…ED

To: Bob

Source: 4F3…ED

To: Alice

txB txB’

B

. . .

B’s mempool

txn-1 tx0 txB

slide-20
SLIDE 20

DOUBLE-SPENDING TRANSACTIONS

A

id = 4F3…ED

Source: 4F3…ED

To: Bob

Source: 4F3…ED

To: Alice

txB txB’

B

. . .

B’s mempool

txn-1 tx0 txB

slide-21
SLIDE 21

A BASIC TOPOLOGY INFERRING TECHNIQUE

Two nodes Three transactions Observation tool (like coinscope)

slide-22
SLIDE 22

A BASIC TOPOLOGY INFERRING TECHNIQUE

A

B

Two nodes Three transactions Observation tool (like coinscope)

slide-23
SLIDE 23

A BASIC TOPOLOGY INFERRING TECHNIQUE

A

B

Two nodes Three transactions Observation tool (like coinscope)

txP txM Parent tx Marker tx txF Flood tx

id = 4F3…ED

slide-24
SLIDE 24

A BASIC TOPOLOGY INFERRING TECHNIQUE

A

B

Two nodes Three transactions Observation tool (like coinscope)

txP txM Parent tx Marker tx txF Flood tx

id = 4F3…ED

US

slide-25
SLIDE 25

POSITIVE INFERRING TECHNIQUE

A B

slide-26
SLIDE 26

POSITIVE INFERRING TECHNIQUE

A B

US

slide-27
SLIDE 27

POSITIVE INFERRING TECHNIQUE

A B

US

slide-28
SLIDE 28

∅ ∅

A’s Mempool B’s Mempool

POSITIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions

US

slide-29
SLIDE 29

∅ ∅

A’s Mempool B’s Mempool

POSITIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions txP txF (1) ( 1 )

US

slide-30
SLIDE 30

∅ ∅

A’s Mempool B’s Mempool

POSITIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions

US

slide-31
SLIDE 31

∅ ∅

A’s Mempool B’s Mempool

POSITIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-32
SLIDE 32

txP txF

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-33
SLIDE 33

txP txF

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-34
SLIDE 34

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-35
SLIDE 35

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2)

US

slide-36
SLIDE 36

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-37
SLIDE 37

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2) (2)

US

slide-38
SLIDE 38

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2) (2) txM (3)

US

slide-39
SLIDE 39

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2) (2)

US

slide-40
SLIDE 40

POSITIVE INFERRING TECHNIQUE

A B

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2) (2) txM (3)

US

slide-41
SLIDE 41

∅ ∅

A’s Mempool B’s Mempool

NEGATIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions

US

slide-42
SLIDE 42

∅ ∅

A’s Mempool B’s Mempool

NEGATIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions

US

txP txF (1) ( 1 )

slide-43
SLIDE 43

∅ ∅

A’s Mempool B’s Mempool

NEGATIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions

US

slide-44
SLIDE 44

∅ ∅

A’s Mempool B’s Mempool

NEGATIVE INFERRING TECHNIQUE

A B

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-45
SLIDE 45

A B

NEGATIVE INFERRING TECHNIQUE

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2)

US

slide-46
SLIDE 46

A B

NEGATIVE INFERRING TECHNIQUE

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1)

US

slide-47
SLIDE 47

A B

NEGATIVE INFERRING TECHNIQUE

∅ ∅

A’s Mempool B’s Mempool

B’s MapOrphanTransactions txP txF (1) (1) txM (2)

US

slide-48
SLIDE 48

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A BASIC TOPOLOGY INFERRING TECHNIQUE

(1) (2) (1)

slide-49
SLIDE 49

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

(1) (2) (1)

slide-50
SLIDE 50

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

(1) (2) (1)

slide-51
SLIDE 51

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

get_data(h(txM))

(1) (2) (1)

slide-52
SLIDE 52

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

edge does not exist

get_data(h(txM))

(1) (2) (1)

slide-53
SLIDE 53

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

(1) (2) (1)

slide-54
SLIDE 54

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

(1) (2) (1)

slide-55
SLIDE 55

US US

txM (2)

Positive edge inferring Negative edge inferring

(1) (3) (1)

A B inv(h(txM))

US

A BASIC TOPOLOGY INFERRING TECHNIQUE

edge does exist

(1) (2) (1)

slide-56
SLIDE 56

ITS NOT THAT EASY

A B

Coinscope

US

slide-57
SLIDE 57

ITS NOT THAT EASY

A B

Coinscope

Long story short, the technique will fail if we add an additional node to the picture

US

slide-58
SLIDE 58

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-59
SLIDE 59

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-60
SLIDE 60

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

ITS NOT THAT EASY

A B

Coinscope

C

t x P (1) txF (1)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-61
SLIDE 61

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-62
SLIDE 62

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-63
SLIDE 63

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

ITS NOT THAT EASY

A B

Coinscope

C

t x P (2)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-64
SLIDE 64

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-65
SLIDE 65

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-66
SLIDE 66

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

t x M (3)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-67
SLIDE 67

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

Long story short, the technique will fail if we add an additional node to the picture

US

slide-68
SLIDE 68

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-69
SLIDE 69

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

t x M (4)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-70
SLIDE 70

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-71
SLIDE 71

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

txM

(4)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-72
SLIDE 72

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

txM

(4)

txM (5)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-73
SLIDE 73

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

txM

(4)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-74
SLIDE 74

∅ ∅ ∅ ∅

A’s Mempool C’s Mempool B’s Mempool B’s MapOrphanTransactions

txM

(5)

txP

(1)

txF

(1)

txP

(2)

ITS NOT THAT EASY

A B

Coinscope

C

txM

(3)

txM

(4)

Long story short, the technique will fail if we add an additional node to the picture

US

slide-75
SLIDE 75

Isolation

MAKE THIS WORK IN A REAL NETWORK

Synchrony Efficiency

A

txP

A

txP

B

txF

≈ O(n)

≈ O( n)

n = #nodes

slide-76
SLIDE 76

Isolation

MAKE THIS WORK IN A REAL NETWORK

Synchrony Efficiency

A

txP

A

txP

B

txF

≈ O(n)

≈ O( n)

n = #nodes

slide-77
SLIDE 77

t x P (2)

ISOLATION

A B

Coinscope

C

US

slide-78
SLIDE 78

t x P (2)

ISOLATION

A B

Coinscope

C

US

slide-79
SLIDE 79

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

slide-80
SLIDE 80

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

INV

slide-81
SLIDE 81

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

GETDATA INV

slide-82
SLIDE 82

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

GETDATA TX INV

slide-83
SLIDE 83

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

GETDATA TX INV

slide-84
SLIDE 84

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

GETDATA TX INV

slide-85
SLIDE 85

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

GETDATA TX INV

HOW?

slide-86
SLIDE 86

t x P (2)

ISOLATION

A B

Coinscope

C

US

A B

C

GETDATA TX INV

HOW? INVBLOCKING

slide-87
SLIDE 87

INVBLOCKING

A B

Coinscope

C

US

slide-88
SLIDE 88

INVBLOCKING

A B

Coinscope

C

US

slide-89
SLIDE 89

INV(txP) INV(txP) INV(txP)

INVBLOCKING

A B

Coinscope

C

US

slide-90
SLIDE 90

INVBLOCKING

A B

Coinscope

C

US

slide-91
SLIDE 91

INVBLOCKING

A B

Coinscope

C

US

txP txP txP

slide-92
SLIDE 92

GETDATA (txP) GETDATA (txP) GETDATA (txP)

INVBLOCKING

A B

Coinscope

C

US

txP txP txP

slide-93
SLIDE 93

INVBLOCKING

A B

Coinscope

C

US

txP txP txP

slide-94
SLIDE 94

INVBLOCKING

A B

Coinscope

C

US

txP txP txP

We have a 2-min window where isolation and synchrony are not a problem!

slide-95
SLIDE 95

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

A’s Mempool B’s Orphanpool

C’s Orphanpool

slide-96
SLIDE 96

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

txP

C’s Mempool

A’s Mempool B’s Orphanpool

C’s Orphanpool

slide-97
SLIDE 97

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

A’s Mempool B’s Orphanpool

C’s Orphanpool

slide-98
SLIDE 98

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-99
SLIDE 99

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

INV(txP )

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-100
SLIDE 100

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-101
SLIDE 101

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-102
SLIDE 102

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-103
SLIDE 103

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

txF

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-104
SLIDE 104

B’s Mempool

txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-105
SLIDE 105

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-106
SLIDE 106

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

txF

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-107
SLIDE 107

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-108
SLIDE 108

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-109
SLIDE 109

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

txF

C’s Mempool

txF txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-110
SLIDE 110

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

txF

C’s Mempool

txF txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-111
SLIDE 111

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

txF

C’s Mempool

txF txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-112
SLIDE 112

B’s Mempool

txF txP txP txP

SIMPLIFIED TXPROBE

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP

B’s Orphanpool

C’s Orphanpool

slide-113
SLIDE 113

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP txM

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

slide-114
SLIDE 114

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

slide-115
SLIDE 115

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP txM

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

slide-116
SLIDE 116

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP txM txM

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

slide-117
SLIDE 117

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP txM

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

slide-118
SLIDE 118

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP txM

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

txM

slide-119
SLIDE 119

B’s Mempool

txF txP txP txP

A B

Coinscope

C

US

C’s Mempool

txF txP

A’s Mempool

txP txM

SIMPLIFIED TXPROBE

B’s Orphanpool

C’s Orphanpool

txM

slide-120
SLIDE 120
  • Choose a target node
  • Create Parent, Marker and Flood transactions
  • INVBLOCK the network
  • Send Flood to all connected nodes but target
  • Let Flood propagate
  • Send Parent to target
  • Send Marker to target
  • Let Marker propagate
  • Request marker back from all nodes but target

TXPROBE - PROTOCOL OVERVIEW

slide-121
SLIDE 121
  • Choose a target node
  • Create Parent, Marker and Flood transactions
  • INVBLOCK the network
  • Send Flood to all connected nodes but target
  • Let Flood propagate
  • Send Parent to target
  • Send Marker to target
  • Let Marker propagate
  • Request marker back from all nodes but target

TXPROBE - PROTOCOL OVERVIEW

For every node in the network

slide-122
SLIDE 122

For a network like Bitcoin mainnet: nodes ≈ 10000 time ≈ 8.25 hours cost = 573210-764280 satoshi (5 sat/byte) ≈ $(20-30)

TXPROBE - COSTS ESTIMATION

slide-123
SLIDE 123

We run 5 Bitcoin Core nodes as ground truth We define our precision / recall by checking how well can we infer the ground truth nodes connections Over 40 trials and with 95% confidence:

  • Precision = 100%
  • Recall = 93.86% - 95.45%

TXPROBE - DATA VALIDATION (TESTNET)

slide-124
SLIDE 124

TXPROBE - TESTNET TOPOLOGY

precision = 100% recall = 97.40% size degree color Community unfolding

Higher community structure and modularity than random graph

slide-125
SLIDE 125

FIXES

slide-126
SLIDE 126

FIXES

slide-127
SLIDE 127

FIXES

Truly randomised orphan transaction eviction

slide-128
SLIDE 128

FIXES

slide-129
SLIDE 129

FIXES

slide-130
SLIDE 130

FIXES

Fixes INVBLOCKING

slide-131
SLIDE 131

FIXES

slide-132
SLIDE 132

FIXES

slide-133
SLIDE 133

FIXES

Creates block-only relay connections

slide-134
SLIDE 134

FIXES

slide-135
SLIDE 135

FIXES

Bitcoin Core 0.18.0 Bitcoin Core 0.19.0 More info about the fixes: https://bitcoinops.org/en/newsletters/2019/09/18/ h/t David A. Harding (@hrdng)

slide-136
SLIDE 136

sr_gi

QUESTIONS

#SFBW19

slide-137
SLIDE 137

Testnet vs Mainnet INVBLOCKING (no-link) Efficiency / Orphan pool eviction

BONUS TRACK

slide-138
SLIDE 138
  • TxProbe is rather invasive: it empties the MapOrphanTransactions

pool of all nodes in the network every round

  • We could not measure the implication that such behavior may have

had on the propagation of regular transactions

WHY TESTNET AND NO MAINNET?

slide-139
SLIDE 139

INVBLOCKING V2

A B

Coinscope

C

US

A’s Mempool

C’s Mempool

B’s Mempool

slide-140
SLIDE 140

INV(txF) INV(txP)

INVBLOCKING V2

A B

Coinscope

C

US

A’s Mempool

C’s Mempool

B’s Mempool

slide-141
SLIDE 141

INVBLOCKING V2

A B

Coinscope

C

US

A’s Mempool

C’s Mempool

B’s Mempool

slide-142
SLIDE 142

INVBLOCKING V2

A B

Coinscope

C

US

txP txF

A’s Mempool

C’s Mempool

B’s Mempool

slide-143
SLIDE 143

GETDATA (txF) GETDATA (txP)

INVBLOCKING V2

A B

Coinscope

C

US

txP txF

A’s Mempool

C’s Mempool

B’s Mempool

slide-144
SLIDE 144

INVBLOCKING V2

A B

Coinscope

C

US

txP txF

A’s Mempool

C’s Mempool

B’s Mempool

slide-145
SLIDE 145

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

slide-146
SLIDE 146

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

slide-147
SLIDE 147

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

slide-148
SLIDE 148

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

slide-149
SLIDE 149

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

slide-150
SLIDE 150

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

slide-151
SLIDE 151

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

INV(txF)

txF

txF

slide-152
SLIDE 152

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

slide-153
SLIDE 153

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

slide-154
SLIDE 154

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

slide-155
SLIDE 155

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txP

txF

txF

slide-156
SLIDE 156

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

slide-157
SLIDE 157

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

txP

slide-158
SLIDE 158

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txP

txF

txF

txP

slide-159
SLIDE 159

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txP

txF

txF

txP

slide-160
SLIDE 160

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txP

txF

txF

txP

slide-161
SLIDE 161

A’s Mempool

C’s Mempool

B’s Mempool

txP txF

INVBLOCKING V2

A B

Coinscope

C

US

txF

txF

txP

slide-162
SLIDE 162

INVBLOCKING COMPARISON

A B

Coinscope

C

US

A B

Coinscope

C

US

A’s Mempool

txP

B’s Mempool

txF

C’s Mempool

txF

A’s Mempool

txP

B’s Mempool

txF

C’s Mempool

txF

slide-163
SLIDE 163

Isolation

MAKE THIS WORK IN A REAL NETWORK

Synchrony Efficiency

A

txP

A

txP

B

txF

≈ O(n)

≈ O( n)

n = #nodes

slide-164
SLIDE 164

ORPHANPOOL EVICTION (BEFORE v0.18)

while (mapOrphanTransactions.size() > nMaxOrphans) { // Evict a random orphan: uint256 randomhash = rng.rand256(); std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.lower_bound(randomhash); if (it == mapOrphanTransactions.end()) it = mapOrphanTransactions.begin(); EraseOrphanTx(it->first); ++nEvicted; }

source: https://github.com/bitcoin/bitcoin/blob/273d025/src/net_processing.cpp#L783-L791

slide-165
SLIDE 165

ORPHANPOOL EVICTION (BEFORE v0.18)

while (mapOrphanTransactions.size() > nMaxOrphans) { // Evict a random orphan: uint256 randomhash = rng.rand256(); std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.lower_bound(randomhash); if (it == mapOrphanTransactions.end()) it = mapOrphanTransactions.begin(); EraseOrphanTx(it->first); ++nEvicted; }

source: https://github.com/bitcoin/bitcoin/blob/273d025/src/net_processing.cpp#L783-L791

  • Pick a random 256-bit value R
  • Get the orphan transaction (O) with hash closer to, but greater

than, R

  • Evict O
  • Repeat until mapOrphanTransaction is not full (default: 100)
  • Double-spends are not checked for orphans
slide-166
SLIDE 166

TXPROBE TRANSACTIONS OVERVIEW

Markeri

Flood

UTXO1

Parenti Markeri

UTXO0

Cleanser

Markeri

Squatteri

slide-167
SLIDE 167

MAKE ROOM IN THE ORPHANPOOL

Cleanser

Markeri

Squatteri

  • Create the cleanser (regular transaction) and 100 squatters (double-

spends between each other)

  • Every squatter is created in a POW-ish way (e.g. re-sign until its hash

falls bellow a certain threshold)

  • All squatters are sent to the flood set nodes to replace any existing
  • rphan.
  • Finally, the cleanser is sent to empty the orphanpool
slide-168
SLIDE 168

sr_gi

QUESTIONS

#SFBW19