From f42eb183d2236c468c614e1e677e8b71a8cdd18b Mon Sep 17 00:00:00 2001 From: emergent-reasons Date: Sat, 13 Apr 2019 23:13:03 +0900 Subject: [PATCH] bring flowchart from plugin repo --- SPECIFICATION.md | 2 +- images/single-player-flowchart.svg | 1050 ++++++++++++++++++++++++++++ 2 files changed, 1051 insertions(+), 1 deletion(-) create mode 100644 images/single-player-flowchart.svg diff --git a/SPECIFICATION.md b/SPECIFICATION.md index 0a9eb7f..825adad 100644 --- a/SPECIFICATION.md +++ b/SPECIFICATION.md @@ -37,7 +37,7 @@ Work in Progress ## Flow -[Flowchart (work in progress)](https://github.com/Electron-Cash/Electron-Cash/wiki/CashShuffle-Protocol-Flowcharts) +[Flowchart (work in progress)](/images/single-player-flowchart.svg) ### Entering a Shuffle diff --git a/images/single-player-flowchart.svg b/images/single-player-flowchart.svg new file mode 100644 index 0000000..cb2e54f --- /dev/null +++ b/images/single-player-flowchart.svg @@ -0,0 +1,1050 @@ + + + + + + + + + + +
+
Player X
+
+
+Player X +
+
+ + + + +
+
generate new key pair
+
+
+generate new key pair<br> +
+
+ + + + +
+
check for players
sufficient funds
+
+
+check for players <br>sufficient funds +
+
+ + + + +
+
got outputs from last player
+
+
+got outputs from last player +
+
+ + + + + + + +
+
Comminication
Media
+
+
+Comminication<br>Media<br> +
+
+ + + + +
+
broadcast encryption key
+
+
+broadcast encryption key<br> +
+
+ + + + +
+
got encryption keys
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
encryption key 1
+
+
+encryption key 1 +
+
+ + + + + +
+
encryption key 2
+
+
+encryption key 2 +
+
+ + + + + +
+
encryption key N
+
+
+encryption key N +
+
+ + + +
+
...
+
+
+... +
+
+ + + + + +
+
Blockchain network
+
+
+Blockchain network +
+
+ + + + + +
+
encryption key X
+
+
+encryption key X +
+
+ + + + + +
+
check unspent
+
+
+check unspent +
+
+ + + + + +
+
unspent list
+
+
+unspent list +
+
+ + + + +
+
encrypt output with encryption key
of other players and send it
to next player
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
encrypted outputs
+
+
+encrypted outputs +
+
+ + + + + +
+
first player only
+
+
+first player only +
+
+ + + + +
+
got encrypted outputs from  
previous player.
+
+
+[Not supported by viewer] +
+
+ + + + +
+
check for different ciphertexts
+
+
+check for different ciphertexts<br> +
+
+ + + + +
+
+
decrypt outputs with decryption key.
+
encrypt outputs with encryption 
+
keys of subsequent players.
+
shuffle the outputs. 
+
sent it to the next player
+
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
outputs from
previous player
+
+
+outputs from <br>previous player +
+
+ + + + + +
+
encrypted output
+
+
+encrypted output +
+
+ + + + + +
+
not first player and not last player
+
+
+not first player and not last player +
+
+ + + + +
+
got encrypted outputs from  
previous player.
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
outputs from
previous player
+
+
+outputs from <br>previous player +
+
+ + + + +
+
+
decrypt outputs with decryption key.
+
add players output
+
shuffle outputs
+
broadcast outputs
+
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
outputs
+
+
+outputs +
+
+ + + + + +
+
last player only
+
+
+last player only +
+
+ + + + + +
+
outputs from
last player
+
+
+[Not supported by viewer] +
+
+ + + + +
+
compute verification hash
broadcast verification hash
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
verification hash X
+
+
+verification hash X +
+
+ + + + +
+
got verification hashes
from all players
+
+
+got verification hashes <br>from all players<br> +
+
+ + + + + +
+
verification hash 1
+
+
+verification hash 1 +
+
+ + + + + +
+
verification hash 2
+
+
+verification hash 2 +
+
+ + + + + +
+
verification key N
+
+
+verification key N +
+
+ + + +
+
...
+
+
+... +
+
+ + + + +
+
verify hash
+
+
+verify hash +
+
+ + + + +
+
make unsigned transaction
sign the players input
broadcast inputs signature
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
input X signature
+
+
+input X signature +
+
+ + + + +
+
got inputs signatures 
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
input 1 signature
+
+
+input 1 signature +
+
+ + + + + +
+
input 2 signature
+
+
+input 2 signature +
+
+ + + + + +
+
input N signature
+
+
+input N signature +
+
+ + + +
+
...
+
+
+... +
+
+ + + + +
+
verify inputs signatures
+
+
+verify inputs signatures +
+
+ + + + +
+
add signatures to transaction
broadcast transaction
+
+
+add signatures to transaction<br>broadcast transaction<br> +
+
+ + + + + +
+
broadcast transaction
+
+
+broadcast transaction +
+
+ + + + + +
+
Insufficient funds 
+
+
+Insufficient funds  +
+
+ + + + + +
+
same ciphertexts
+
+
+same ciphertexts +
+
+ + + + + +
+
wrong hashes
+
+
+wrong hashes +
+
+ + + + + +
+
wrong inputs
signatures
+
+
+wrong inputs <br>signatures +
+
+ + + + +
+
broadcast blame message
with reason "Insuficcient Funds"
containign list of players
with insufficient funds
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message
from player X
+
+
+blame message <br>from player X +
+
+ + + + +
+
got blame messages 
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message 1
+
+
+blame message 1 +
+
+ + + + + +
+
blame message 2
+
+
+blame message 2 +
+
+ + + + + +
+
blame message N
+
+
+blame message N +
+
+ + + +
+
...
+
+
+... +
+
+ + + + +
+
ban the liar
+
+
+ban the liar<br> +
+
+ + + + + +
+
ban message
from player X
+
+
+ban message <br>from player X +
+
+ + + + + + +
+
broadcast blame message
with reason "Shuffle Failure"
containing hashes
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message
from player X
+
+
+blame message <br>from player X +
+
+ + + + +
+
got blame messages 
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message 1
+
+
+blame message 1 +
+
+ + + + + +
+
blame message 2
+
+
+blame message 2 +
+
+ + + + + +
+
blame message N
+
+
+blame message N +
+
+ + + +
+
...
+
+
+... +
+
+ + + + +
+
check if all hashes are the same
+
+
+check if all hashes are the same<br> +
+
+ + + + + + +
+
different hashes
+
+
+different hashes +
+
+ + + + +
+
broadcast blame message
with reason
"Shuffle and Equivocation Failure"
containing player's encryption key,
player's decryption key,
and messages from other players
on phase "shuffling" 
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message
from player X
+
+
+blame message <br>from player X +
+
+ + + + +
+
got blame messages 
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message 1
+
+
+blame message 1 +
+
+ + + + + +
+
blame message 2
+
+
+blame message 2 +
+
+ + + + + +
+
blame message N
+
+
+blame message N +
+
+ + + +
+
...
+
+
+... +
+
+ + + + +
+
replaying shuffling phase,
 identifying the cheater
and ban him
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
ban message
from player X
+
+
+ban message <br>from player X +
+
+ + + + + + +
+
broadcast blame message
with reason  "Equivocation Failure"
containing all messages from
"Announcment" phase and
"Equivocation" phase 
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message
from player X
+
+
+blame message <br>from player X +
+
+ + + + +
+
got blame messages 
from all players
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
blame message 1
+
+
+blame message 1 +
+
+ + + + + +
+
blame message 2
+
+
+blame message 2 +
+
+ + + + + +
+
blame message N
+
+
+blame message N +
+
+ + + +
+
...
+
+
+... +
+
+ + + + +
+
Identify which player
send the wrong message
and ban him
+
+
+[Not supported by viewer] +
+
+ + + + + +
+
ban message
from player X
+
+
+ban message <br>from player X +
+
+ + + + + +
+
Use
+
+
+Use +
+
+ +
+