depolymerization

wire gateway for Bitcoin/Ethereum
Log | Files | Refs | Submodules | README | LICENSE

commit f1cd4f82bb5022168487c476074c8addfadc279c
parent 4a83288341cca887481a09b77b8ac30264856846
Author: Antoine A <>
Date:   Thu, 27 Jan 2022 18:45:03 +0100

presentation: progress

Diffstat:
Mdocs/presentation.tex | 138+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 114 insertions(+), 24 deletions(-)

diff --git a/docs/presentation.tex b/docs/presentation.tex @@ -33,10 +33,10 @@ \begin{block}{Common blockchain limitation} \begin{itemize} - \item \textbf{Delayed} block and confirmation delay - \item \textbf{Expensive} transaction fees + \item \textbf{Delay} block and confirmation delay + \item \textbf{Cost} transaction fees \item \textbf{Scalability} limited amount of transaction per seconds - \item \textbf{Ecological cost} computation redundancy + \item \textbf{Ecological impact} computation redundancy \item \textbf{Privacy} \end{itemize} \end{block} @@ -80,21 +80,47 @@ \begin{frame}{Taler}{Off the chain transaction} \begin{center} \begin{tikzpicture}[ - rect/.style={rectangle, draw=black}, - sym/.style={<->, shorten >= 2pt, shorten <= 2pt} + rect/.style={rectangle, draw=black, minimum width=28mm}, + sym/.style={<->, shorten >= 2pt, shorten <= 2pt}, + block/.style={rectangle,draw=black,fill=black!10,minimum size=7mm}, ] + + %% Architecture + \node(Tt){Taler}; \node[rect, below=0cm of Tt](Tc){Exchange}; \node[rect, fit={(Tt) (Tc)}](T){}; - \node[rect, below= of Tc](D) {Depolymerization}; + \node[rect, below=7mm of Tc](D) {Depolymerization}; - \node[rect, below= of D](Bc){Node}; - \node[below=0cmof Bc](Bt){Blockchain}; + \node[rect, below=7mm of D](Bc){Node}; + \node[below=0cm of Bc](Bt){Blockchain}; \node[rect, fit={(Bt) (Bc)}](B){}; \draw[sym] (T) -- (D); \draw[sym] (D) -- (B); + + %% Blockchain + \node[block,right=7mm of B] (1){}; + \node[block,right=4mm of 1] (2){}; + \node[block,right=4mm of 2] (3){}; + \node[block,right=4mm of 3] (4){}; + \node[block,right=4mm of 4] (5){}; + \node[block,right=4mm of 5] (6){}; + \draw[->] (1) -- (2); + \draw[->] (2) -- (3); + \draw[->] (3) -- (4); + \draw[->] (4) -- (5); + \draw[->] (5) -- (6); + + %% Taler + \node[block, right=18mm of T] (off){Off-chain transactions}; + + % Depolymerization + \node[right=11mm of D] {\small{Deposit}}; + \node[right=49mm of D] {\small{Withdraw}}; + \draw[dashed,->] (1.north) |- (off.west); + \draw[dashed,->] (off.east) -| (6.north); \end{tikzpicture} \end{center} \end{frame} @@ -109,41 +135,106 @@ \begin{frame}{Depolymerization}{Architecture} \begin{center} \begin{tikzpicture}[ - rect/.style={rectangle, draw=black}, + rect/.style={rectangle, draw=black, minimum height=6mm, minimum width=28mm}, sym/.style={<->, shorten >= 2pt, shorten <= 2pt} ] \node[rect](1) {Taler Exchange}; - \node[rect, below= of 1](2) {wire\_gateway}; - \node[rect, right= of 2](3) {PostgreSQL}; - \node[rect, right= of 3](4) {\#\#\#\_wire}; - \node[rect, above= of 4](5) {Full Node}; - - \draw[sym] (1) -- node [midway, right] {\tiny HTTP} (2); - \draw[sym] (2) -- node [midway, above] {\tiny SQL} (3); - \draw[sym] (3) -- node [midway, above] {\tiny SQL} (4); - \draw[sym] (4) -- node [midway, left] {\tiny RPC} (5); + \node[rect,below=of 1](2) {wire\_gateway}; + \node[rect,right=of 2](3) {PostgreSQL}; + \node[rect,right=of 3](4) {\#\#\#\_wire}; + \node[rect,above=of 4](5) {Full Node}; + + \draw[sym] (1) -- node [midway,right] {\tiny HTTP} (2); + \draw[sym] (2) -- node [midway,above] {\tiny SQL} (3); + \draw[sym] (3) -- node [midway,above] {\tiny SQL} (4); + \draw[sym] (4) -- node [midway,left ] {\tiny RPC} (5); \end{tikzpicture} \end{center} + Two processes sharing a common database for state and communication. wire\_gateway is currency agnostic and there is a specific wire binary for every supported currency. \end{frame} \section{btc\_wire} \begin{frame}{btc\_wire}{Architecture} - Three loops - Watcher: Notify other loops when a new block has been mined - Analyzer: Analyse blockchain to adapt defensively - Worker: Sync chain -> Send -> Bounce + \begin{center} + \begin{tikzpicture}[ + rect/.style={rectangle, draw=black, minimum height=6mm, minimum width=38mm}, + ] + + % Watcher loop + \node(wat) {Watcher}; + \node[rect, below=1mm of wat](wa1) {Wait for new block}; + \node[rect, below=4mm of wa1](wa2) {Notify new block}; + \draw[->] (wa1) -- (wa2); + \draw[->] (wa2) .. controls ([xshift=-0.3cm] wa2.west) and ([xshift=-0.3cm] wa1.west) .. (wa1); + + % Analysis loop + \node[below=5mm of wa2] (at) {Analysis}; + \node[rect, below=1mm of at](a1) {Wait for notification}; + \node[rect, below=4mm of a1](a2) {Analyse}; + \draw[->] (a1) -- (a2); + \draw[->] (a2) .. controls ([xshift=-0.3cm] a2.west) and ([xshift=-0.3cm] a1.west) .. (a1); + + % Worker loop + \node[rect, below right= -2mm and 1cm of wa1](wo1) {Wait for notification}; + \node[rect, below=4mm of wo1](wo2) {Synchronize}; + \node[rect, below=4mm of wo2](wo3) {Send}; + \node[rect, below=4mm of wo3](wo4) {Bounce}; + \node[above=1mm of wo1]{Worker}; + \draw[->] (wo1) -- (wo2); + \draw[->] (wo2) -- (wo3); + \draw[->] (wo3) -- (wo4); + \draw[->] (wo4) .. controls ([xshift=-0.4cm] wo4.west) and ([xshift=-0.4cm] wo1.west) .. (wo1); + \end{tikzpicture} + \end{center} + \centering + Three concurrent loops \end{frame} \begin{frame}{btc\_wire}{Security features} \begin{itemize} \item Reorg resilient - \item Handle stuck transaction + \item Resolve stuck transaction \item Adaptive confirmation \end{itemize} \end{frame} \begin{frame}{btc\_wire}{Reorg resilient} + \begin{center} + \begin{tikzpicture}[ + block/.style={rectangle,draw=black,fill=black!10,minimum size=7mm}, + ] + % Common + \node [block](1){1}; + \node [block, right=5mm of 1](2){2}; + \node [block, right=5mm of 2](3){3}; + \draw[->] (1) -- (2); + \draw[->] (2) -- (3); + + % Current + \node [block, right=5mm of 3](4){4}; + \node [block, right=5mm of 4](5){5}; + \node [block, right=5mm of 5](6){6}; + \draw[->] (3) -- (4); + \draw[->] (4) -- (5); + \draw[->] (5) -- (6); + + % Fork + \node [block, above=7mm of 4](4p){4'}; + \node [block, right=5mm of 4p](5p){5'}; + \node [block, right=5mm of 5p](6p){6'}; + \node [block, right=5mm of 6p](7p){7}; + \draw[->] (3.east) -- (4p.west); + \draw[->] (4p) -- (5p); + \draw[->] (5p) -- (6p); + \draw[->] (6p) -- (7p); + + % Indication + \node [right=5mm of 7p]{\emph{fork}}; + \node [right=17mm of 6]{\emph{active}}; + \end{tikzpicture} + \end{center} + A fork is when concurrent blockchain state coexists. Node will follow the longest chain replacing recent blocks if necessary. This is a blockchain reorganisation. \end{frame} \begin{frame}{btc\_wire}{Handle stuck transactions} @@ -175,7 +266,6 @@ \node [dot, above=15.5mm of C](D2) {}; \draw [dotted] (C) -- (D2); }; - \end{tikzpicture} \end{center} \only<1>{However, transaction fees are variable and can only be predicted}