Word presented in EUMAS-AT '18 conference at Bergen (NO). Proposes a robust consensus model that allows detecting cheating nodes. Application to distributed ledger (DLT)
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Distributed Ledger and Robust Consensus for Agreements
1. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Distributed Ledger and Robust Consensus for
Agreements
M. Rebollo,C. Carrascosa, A. Palomares
Grupo de Tec. Inform´atica – Inteligencia Artificial
Universitat Polit`ecnica de Val`encia
{mrebollo,carrasco,apalomares}@dsic.upv.es
AT, Bergen 2018
c b a
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
3. Introduction Cheat Detection Distributed Ledger Performance Conclusions
What consensus is?
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
4. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
5. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
6. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
7. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
8. Introduction Cheat Detection Distributed Ledger Performance Conclusions
What are consensus used for?
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
9. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
10. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
11. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
12. Introduction Cheat Detection Distributed Ledger Performance Conclusions
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
13. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Consensus algorithm (Olfati, 2007)
Given
undirected graph
G = (V , E)
set of initial values
x = (x1, . . . , xn)T
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
14. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Consensus algorithm (Olfati, 2007)
1 each node has its initial
value
1 2
3 4
x1 = 0.4 x2 = 0.2
x3 = 0.3 x4 = 0.9
x1 = 0.4
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
15. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Consensus algorithm (Olfati, 2007)
1 each node has its initial
value
2 pass the value to its
neighbors
1 2
3 4
x1 = 0.4 x2 = 0.2
x3 = 0.3 x4 = 0.9
x1 = 0.4
x1 = 0.4
x1 = 0.4
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
16. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Consensus algorithm (Olfati, 2007)
1 each node has its initial
value
2 pass the value to its
neighbors
3 receive the values from its
neighbors
1 2
3 4
x1 = 0.4 x2 = 0.2
x3 = 0.3 x4 = 0.9
x2 = 0.2
x4 = 0.9
x3 = 0.3
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
17. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Consensus algorithm (Olfati, 2007)
1 each node has its initial
value
2 pass the value to its
neighbors
3 receive the values from its
neighbors
4 calculates the new value
1 2
3 4
x1 = 0.45 x2 = 0.425
x3 = 0.325 x4 = 0.6
x1 = 0.4
x(t + 1) = x(t) + ε
j∈Ni
[xj(t) − xi (t)]
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
18. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Consensus algorithm (Olfati, 2007)
The network converges to
the mean value
lim
t→∞
xi (t) =
1
n i
xi (0)
0 5 10 15 20 25 30
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
x = 0.45
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
19. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Problem
Failure detection on consensus process
Only with one agent not following the algorithm, the network
converges to a value different from the average
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
20. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Altering Consensus
xi (t + 1) = xi (t) + ε
j∈Ni
[xj(t) − xi (t)] + ui (t)
1
23
4
5
6
7 8
9
10
0 10 20 30 40 50
time
0
2
4
6
8
10
xi
Consensus with Malicious Agent
10 agents, x = (1, 2, . . . , 10)T , ∆x5 = 4
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
21. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Altering Consensus
xi (t + 1) = xi (t) + ε
j∈Ni
[xj(t) − xi (t)] + ui (t)
1
23
4
5
6
7 8
9
10
0 10 20 30 40 50
time
0
2
4
6
8
10
xi
Consensus with Malicious Agent
10 agents, x = (1, 2, . . . , 10)T , ∆x5 = 4
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
22. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Cheat Detection
From
xi (t + 1) = xi (t) + ε
j∈Ni
[xj(t) − xi (t)]
clearing
0 = xi (t + 1) + (εdeg(i) − 1)xi (t) − ε
j∈Ni
xj(t)
dvi (t)
and the process must fulfil that
dvi (t) = 0 ∀t > 0
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
23. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Correction of the Deviations
xi (t + 1) = xi (t) + ε
j∈Ni
[xj(t) − xi (t)] + ui (t), with ui (t) > 0
ui (t) is divided into the neighbors as follows
the agent keeps (1 − εdeg(i))ui (t)
each neighbor receives εui (t)
therefore, dvi (t) = εui (t) → ui (t) = dvi (t)
ε
in general dvi (t)
ε = j∈Ni
uj(t)
total deviation Di (t) = t
s=0 dvi (s)
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
24. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Correction of the Deviation
Consensus over (Di |wi )
Di cumulated deviation
wi number of detected deviations
Corrected value
ˆxi(t) = xi (t) −
Di (t)
εwi (t)
ci (t))
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
25. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Failure Causes in Distributed Networks
stop: the agent stops sending information
byzantine failures: unexpected erratic behavior or deliberate
errors
unfair behavior, but admitted because of rationality,
self-interest or incentive policies.
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
26. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Application to Distributed Ledger Technology (DLT)
L1 L2 L3 L4 L5 L6
Hash 1+2 Hash 3+4 Hash 5+6
Hash
1+2+3+4
Hash 5+6
Hash
1+2+3+4+5+6
Distributed ledger stored in a Merkle tree
only leaves have information
each brach from root belongs to one agent
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
27. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Sample Merkle tree for 4 nodes
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
28. Introduction Cheat Detection Distributed Ledger Performance Conclusions
DLT by consensus
agent i creates a block with its transactions s
inserts the block in its tree
obtains the hash of the root hr
generates (s|hr |yi = 1)
the rest do ( | |yi = 0)
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
31. Introduction Cheat Detection Distributed Ledger Performance Conclusions
0 20 40 60 80 100
time
1160
1180
1200
1220
1240
1260
x
i
DLT by Consensus with Cheating
10 15 20 25 30
1190
1200
1210
1220
1230
0 20 40 60 80 100
time
0
0.05
0.1
0.15
0.2
0.25
x
i
Evolution of Corrections for DLT
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
32. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Result after final correction
{"iotcount":2,"readings":[{"iotid":1,
"result":0.9058,
"phenomenonTime":"2018-10-05T08:55.08.504Z"}
{"iotcount":2,"readings":[{"iotid":1,
"result":0.9058,
"phenomenonTime":"2018-10-05T08:55.08.504Z"}
{"iotcount":2,"readings":[{"iotid":1,
"result":0.9058,
"phenomenonTime":"2018-10-05T08:55.08.504Z"}
...
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
33. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Differences
test over random
networks
if m cheat,
then
n ≥ 3 + 1
half the
neighbors are
confident
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
34. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Successful Corrections
1,000
repetitions
corrections of
100% follow
a Power-law
with
γ = −0.44
0 20 40 60 80 100
#cheating nodes
200
400
600
800
1000
freq.
Successful corrections
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements
35. Introduction Cheat Detection Distributed Ledger Performance Conclusions
Conclusions
Extension of consensus algorithm
robust algorithm for consensus in networks
deviation from expected values detected
correction mover the final result
applied to DLT
Limitations
1st exchange must be correct
correction possible if m < n
3 and m < |Ni |
2
cheating agents undetected if only cheat once
@mrebollo UPV
Distributed Ledger and Robust Consensus for Agreements