diff --git a/.gitignore b/.gitignore index b837ec3..665fa9c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,14 @@ *.kate-swp gitversion.txt gitversion.tex + +# Node.js DEX +dex/node_modules +dex/package-lock.json + +# texstudio +tagion_tech_paper.run.xml + +*.o +*.html +gossip \ No newline at end of file diff --git a/abstract.tex b/abstract.tex index fd07457..d6661fc 100644 --- a/abstract.tex +++ b/abstract.tex @@ -1,5 +1,5 @@ \begin{abstract} This paper describes an alternative implementation of a Distributed Ledger Technology (DLT) network compared to a classical network such as Bitcoin. Most other DLT networks use a Proof-of-Work consensus mechanism to secure the Byzantine Fault Tolerance (BFT) of the data storage. In the Tagion network, the BFT is based on the Hashgraph algorithm and data storage on a new type of Distributed Hash Table (DHT) which makes it efficient to maintain a distributed database and guarantee BFT. The Hashgraph algorithm is deterministic and not probabilistic, allowing ordering of transactions. The order of transactions combined with the Lightning Network and the Tagion matching and settlement protocol constitutes a Decentralised Exchange (DEX) protocol on the Tagion network. -To reduce the probability of the network being taken over by an evil group of actors, a new governance model is proposed, which does not rely on a central control or a group of master-nodes. It is built on the ideas of self-governance of common resources and democratic principles resulting in a Proof-of-People protocol and reputational scoring model that relies on the nodes engaging in dialogue with each other. +To reduce the probability of the network being taken over by an evil group of actors, a new governance model is proposed, which does not rely on a central control or a group of master-nodes. \end{abstract} diff --git a/bibtex.bib b/bibtex.bib index e86cbde..adb31ba 100644 --- a/bibtex.bib +++ b/bibtex.bib @@ -73,3 +73,25 @@ @article{friedman_counter Number = {33}, Year = {1970}, URL = {https://miltonfriedman.hoover.org/friedman_images/Collections/2016c21/IEA_1970.pdf}} + +@article{libp2p, +Author = {libp2p, githib team}, +Title = {Modular peer-to-peer networking stack}, +URL = {https://github.com/libp2p} +} + +@article{wavefront_patent, +Author = {Carsten, Bleser Rasmussen}, +Journal = {US20210227027A1}, +note = {Owner: i25s AG}, +Year = {2020}, +Title ={System and a method implementing a directed acyclic graph (dag) consensus algorithm via a gossip protocol} +} + +@article{dart_patent, +Author = {Carsten, Bleser Rasmussen}, +Journal = {US20210067330A1}, +note = {Owner: i25s AG}, +Year = {2020}, +Title = {Sparsed merkle tree method and system for processing sets of data for storing and keeping track of the same in a specific network} +} \ No newline at end of file diff --git a/consensus_order_function.tex b/consensus_order_function.tex new file mode 100644 index 0000000..32dfb70 --- /dev/null +++ b/consensus_order_function.tex @@ -0,0 +1,36 @@ +\section{Consensus order function}\label{sec:order_function} +The code sample below shows the implementation of the consensus order function. +\lstset{language=c++, numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt, tabsize=4}%, +\begin{lstlisting} +bool order_less(const Event a, const Event b) @safe { + order_compare_iteration_count++; + if (a.received_order is b.received_order) { + if (a._father && b._father) { + return order_less(a._father, b._father); + } + if (a._father && b._mother) { + return order_less(a._father, b._mother); + } + if (a._mother && b._father) { + return order_less(a._mother, b._father); + } + if (!a.isFatherLess && !b.isFatherLess) { + return order_less(a._mother, b._mother); + } + if (!a.isFatherLess) { + return false; + } + if (!b.isFatherLess) { + return true; + } + bool rare_less(Buffer a_print, Buffer b_print) { + rare_order_compare_count++; + pragma(msg, "review(cbr): Concensus order changed"); + return a_print < b_print; + } + assert(a.isFatherLess && b.isFatherLess); + return rare_less(a.fingerprint, b.fingerprint); + } + return a.received_order < b.received_order; +} +\end{lstlisting} diff --git a/consensus_ordering.tex b/consensus_ordering.tex index 3946e87..81ca835 100644 --- a/consensus_ordering.tex +++ b/consensus_ordering.tex @@ -1,30 +1,51 @@ -\subsection{Consensus Ordering} -In the Tagion implementation of the Hashgraph algorithm, an Event is only allowed to point to one or none ``other parent'' which is called a ``father-event'' as shown om \cref{fig:consensus_order}. This strategy aids in solving the graph forking problem and simplifies the consensus ordering.\\ +\subsection{Consensus Ordering}\label{sec:consensus_ordering} +In the Tagion implementation of the Hashgraph algorithm, an Event is only allowed to point to one or none ``other parent'' which is called a ``father-event'' as shown om \cref{fig:consensus_order}. This strategy aids in solving the graph forking problem and simplifies the consensus ordering. The ``self-parent'' is defined as a ``mother-event'' in the Tagion implementation. An event must have a mother-event but doesn't have to have a father-event. -Each event points to the previous event called the mother-event, and some also point to another father-event. The mother-event is defined as the previous event from the same node. The father is an event sent via the gossip network from another node. \\ +Each event points to the previous event called the mother-event, and some also point to another father-event. The mother-event is defined as the previous event from the same node. The father is an event sent via the gossip network from another node. The order $\Omega$ is calculated as: - -%\end{equation} \begin{equation} \Omega_{B,k+1} = max \big(\Omega_{A,k} , \Omega_{B,k} \big) +1 \end{equation} -The events in the epoch list are sorted by the order $\Omega$. If the order of two events is equal, the hash $h$ of the event is used to calculate the order. +The events in an epoch list are sorted by the order $\Omega$. According to \cref{equ:order} which define if an event A must be ordered before a B event. If the order of two events is equal, then the nested function $l'$ \cref{equ:nested_order} is use to decided the order.\\ +A event is defined to be fatherless if the lineage of an event don't have a father back to the Eva event, and an Eva-event is defined to be an event without a mother and/or a father. The following expression is used to order the events: -\begin{equation} - {l}_{A,B} = +\begin{align} + {l}(A,B) & = \begin{cases} + {l'}(A,B) & \text{if} ~ ({\Omega}_{A} = {\Omega}_{B} ) \\ {{\Omega}_{A} < {\Omega}_{B}} & - \text{if} ~ ({\Omega}_{A} \neq {\Omega}_{B} ) \\ - H ( {h}_{A} \parallel {h}_{B} ) < H ( {h}_{B} \parallel {h}_{A} ) & \text{otherwise} - \end{cases} -\end{equation} + \end{cases} + \label{equ:order} +\end{align} + +\begin{align} +{l'}(A,B) & = +\begin{cases} +{l}(A_{father},B_{father}) & +\text{if} ~ (\text{A has a father} ~ \& ~ \text{B has a father}) \\ +{l}(A_{father},B_{mother}) & +\text{if} ~ (\text{A has a father} ~ \& ~ \text{B has a mother}) \\ +{l}(A_{mother},B_{father}) & +\text{if} ~ (\text{A has a mother} ~ \& ~ \text{B has a father}) \\ +{l}(A_{mother},B_{mother}) & +\text{if} ~ (\text{A is not fatherless} ~ \& ~ \text{B is not fatherless}) \\ +0 & +\text{if} ~ (\text{A is not fatherless}) \\ +1 & +\text{if} ~ (\text{B is not fatherless}) \\ +{h}_{A} < {h}_{B} & +\text{otherwise (Only happens for none orderd event)} +\end{cases} +\label{equ:nested_order} +\end{align} +If parameter $l(A,B)$ is $'true'$ if event A is ordered before event B (see \cref{sec:order_function}). -The parameter ${l}_{A,B}$ is $'true'$ if event A is ordered before event B. +Note. An event which are fatherless is not allowed to contain a payload and an node must have participated in producing one epoch before the payload can be considered valid. \begin{figure}[H] \centering diff --git a/consensus_probability.tex b/consensus_probability.tex new file mode 100644 index 0000000..836f7ea --- /dev/null +++ b/consensus_probability.tex @@ -0,0 +1,74 @@ +\section{Gossip Model}\label{sec:gossip_model} + +\paragraph{Epoch consensus\\} + +In the following the probability for the Hashgraph-algorithm to reach an Epoch consensus within $H$ events consecutive is estimated in a simple model as follows.\\ + +To estimate the bandwidth and the propagation delay simple simulation model has been implemented. +The network participants are given by the flowing parameters. +\begin{itemize} + \item[$H$] is the number of event for a node to reach Epoch-consensus. + \item[$M$] is the total number of nodes which are available for the network (This includes active and passive nodes, not prospect nodes). + \item[$n$] is the number of nodes which has not yet been seen by the current node. +\end{itemize} + + +\begin{table}[H] + \begin{center} + \begin{tabular}{|l|p{4cm}|p{3cm}|} + \hline + Nodes $N$ & Round Factor $n_{round}$ & Bandwidth-Scale $B$ \\ + \hline + 11 & 5 & 171 \\ + \hline + 31 & 8 & 1396 \\ + \hline + 101 & 12 & 14918 \\ + \hline + 1001 & 16 & 1498538 \\ + \hline + 10001 & 20 & 149868334 \\ + \hline + 100001 & 24 & 14996214212 \\ + \hline + \end{tabular} + \end{center} + \caption{Gossip simulation model} + \label{tab:gossip_model} +\end{table} + +From the simulation the following expression can be driven. +The average events per round: +\begin{equation} +n_{round} = 2.2 \cdot ln(N) +\end{equation} +The average estimated time between epochs: + +\begin{equation} +t_{epoch} = K \cdot n_{round} \cdot t_{net} +\end{equation} +Whe the following is defined as: +\begin{itemize} + \item[$N$] is the number of active nodes running the networks. + \item[$K$] is the epoch scaling factor (Typical value of $K$ is typical a little larger than 3) + \item[$n_{round}$] is the average events for between round. + \item[$t_{net}$] is the network delay. + \item[$t_{epoch}$] is the average propagation delay per transaction. +\end{itemize} + + +Estimated bandwidth scale-factor: +\begin{equation} +B = E_{size} \cdot N^2 +\end{equation} + +Estimated bandwidth requirement: +\begin{equation} +BW = \frac{B}{n_{round\cdot t_{net}}} +\end{equation} + +\begin{itemize} + \item[$B$] is the average bandwidth scale factor used by a node. + \item[$E_{size}$] is the average memory size of an event including transaction data. + \item[$BW$] is the average bandwidth used by a node. +\end{itemize} diff --git a/crypto_bill.tex b/crypto_bill.tex index 939bcb4..9cfef2d 100644 --- a/crypto_bill.tex +++ b/crypto_bill.tex @@ -44,12 +44,12 @@ \section{Crypto “Bank” bill} Resulting in: -\begin{equation} +%\begin{equation} \begin{align*} Y_{bob} & = H(B_k \parallel y_{bob} ) \\ B_{k+1} & = H ( V \parallel B_k \parallel t_k \parallel k \parallel T \parallel Y_{bob} ) \end{align*} -\end{equation} +%\end{equation} The new bill is now written to the DART with key $B_{k+1}$: @@ -67,13 +67,13 @@ \section{Crypto “Bank” bill} \end{equation} Each new bill is generated as: -\begin{equation} +%\begin{equation} \begin{align*} Y_{k+1,i} & = H ( B_k \parallel y_{k+1,i} ) \\ B_{k+1,i} & = H ( V_{k+1} \parallel B_k \parallel t_k \parallel k \parallel T \parallel Y_{k+1} ), ~ y_{k+1,i} \ne y_{k+1,j} ~ \text{for} ~ (i \ne j) \\ \end{align*} -\end{equation} +%\end{equation} All new bills marked $B_{k+1}$ are stored in the DART as before, and the old bills are removed. \\ @@ -89,11 +89,11 @@ \section{Crypto “Bank” bill} \end{equation} The new bill number will be generated: -\begin{equation} +%\begin{equation} \begin{align*} Y'_{k+1} & = H ( B'_k \parallel y_{k+1} ) \\ B_{k+1} & = H ( V_a \parallel B'_k \parallel t_k \parallel k \parallel T \parallel Y'_{k+1} ) \\ \end{align*} -\end{equation} +%\end{equation} These new consolidated bills are stored in the DART. diff --git a/dart.tex b/dart.tex index d2b8d05..43cef74 100644 --- a/dart.tex +++ b/dart.tex @@ -1,6 +1,6 @@ \section{Distributed Database (DART)}\label{sec:DART} -\abbrev{DART}{Distributed Archive of Random Transactions} +\abbrev{DART}{Distributed Archive of Random Transactions} [Patent \cite{dart_patent}] is built to store and keep track of transactions in the Tagion network. The database efficiently handles the removal and addition of transactions in a secure and distributed manner. Each transaction is stored in a distributed hash-table using a cryptographic hash of the transaction T data. Each transaction is identified by a unique hash value h. The transaction is put into a table ordered by the numerical value of the hash. \begin{equation} @@ -42,12 +42,12 @@ \section{Distributed Database (DART)}\label{sec:DART} \includegraphics[width=1.0\textwidth]{fig/dart_tree_bw.eps} % dart_bw.eps: 17766x12625 px, 300dpi, 150.42x106.89 cm, bb=0 0 4264 3030 \caption{The data structural layout of DART database} - \label{fig:dart} + \label{fig:dartsector} \end{figure} -\subsection{Sparse Merkle Tree} +\subsection{Sparse Merkle Tree}\label{sec:SMT} The data in a section is mapped using a \abbrev{SMT}{Sparse Merkle Tree} which makes it efficient to add into and remove archives from the Merkle tree. \\ The hash point into the DART is divided by rims. Rim zero is the most significant byte (MSB) of the hash fingerprint of the archive. Rim one is the next byte in the hash etc. \\ In the current implementation of the DART, the first two rims are used as the section index. Thus the DART has a total number of indices $2^{16} = 65536$ which is equivalent to the two bytes unsigned number. \\ @@ -55,8 +55,13 @@ \subsection{Sparse Merkle Tree} As a comparison, a traditional Merkle tree with $2^{24} = 8^3 \approx 16 \cdot 10^{6}$ Archives. Calculating a full Merkle tree requires the calculation of around $32 \cdot 10^6$ hashes. By contrast, using an SMT with $16 \cdot 10^{6}$ archives mean just around 2000 hashes have to be calculated. \paragraph{Core protocol updates\\} -The DART will be used for protocol updates by the following consensus. One or more nodes will need to run the new protocol update in a parallel DART containing the same transaction information as the current accepted DART. The new DART will have a new Bull's eye, and this will result in a fork of the Bull's eye chain. When the majority of the nodes run the newly upgraded nodes, they can decide to drop support for the old DART and run the new DART. When enough nodes stop running the old DART, it will not be able to reach a consensus, and the upgrade has completed. +The DART will be used for protocol updates by the following consensus. One or more nodes will need to run the new protocol update in a parallel DART containing the same transaction information as the current accepted DART. The new DART will have a new Bull's eye \abbrev{Bullseye}{DART Merkle Root}, and this will result in a fork of the Bull's eye chain. When the majority of the nodes run the newly upgraded nodes, they can decide to drop support for the old DART and run the new DART. When enough nodes stop running the old DART, it will not be able to reach a consensus, and the upgrade has completed. \paragraph{DART garbage collection\\} A garbage collection script will run every (G) epoch and remove all the bills which are older than a specified date. Bills that have not been used for a long period will be burned, which ensures that the system does not contain dead bills/money. It is the owner's responsibility to recycle their bills before the expiry date. + + +\paragraph{Unpredictable Deterministic Random\\} +The merkle root \bfit{Bullseye} is used as seed for the \abbrev{UDR}{Unpredictable Deterministic Random}, which is used in the different algorithmic consensus for the network. + \ No newline at end of file diff --git a/dex/bid_sales_table.tex b/dex/bid_sales_table.tex index dae998d..cd677cc 100644 --- a/dex/bid_sales_table.tex +++ b/dex/bid_sales_table.tex @@ -7,10 +7,10 @@ \hline 26 & BTO & 87ACL & 134 & 10 & 0.0746 & 13.4000 & & & \\ \hline -7 & BTO & 205ACL & 145 & 11 & 0.0759 & 13.1818 & & & \\ -\hline 5 & BTO & 217ACL & 145 & 11 & 0.0759 & 13.1818 & & & \\ \hline +7 & BTO & 205ACL & 145 & 11 & 0.0759 & 13.1818 & & & \\ +\hline 21 & BTO & 716ACL & 134 & 11 & 0.0821 & 12.1818 & & & \\ \hline 33 & BTO & 226ACL & 144 & 12 & 0.0833 & 12.0000 & & & \\ diff --git a/dex/bid_sales_table_executed.tex b/dex/bid_sales_table_executed.tex index 8373f79..5f18ac9 100644 --- a/dex/bid_sales_table_executed.tex +++ b/dex/bid_sales_table_executed.tex @@ -7,10 +7,10 @@ \hline 26 & BTO & 87ACL & 134 & 10 & 0.0746 & 13.4000 & & 53.60ACL & 3 \\ \hline -7 & BTO & 205ACL & 145 & 11 & 0.0759 & 13.1818 & 205.00ACL & & 6 \\ -\hline 5 & BTO & 217ACL & 145 & 11 & 0.0759 & 13.1818 & 217.00ACL & & 4 \\ \hline +7 & BTO & 205ACL & 145 & 11 & 0.0759 & 13.1818 & 205.00ACL & & 6 \\ +\hline 21 & BTO & 716ACL & 134 & 11 & 0.0821 & 12.1818 & 323.08ACL & & 11 \\ \hline 33 & BTO & 226ACL & 144 & 12 & 0.0833 & 12.0000 & & 226.00ACL & 12 \\ diff --git a/dex/dex.js b/dex/dex.js new file mode 100644 index 0000000..055b040 --- /dev/null +++ b/dex/dex.js @@ -0,0 +1,441 @@ +const fs = require("fs"); +const ejs = require('ejs'); +//var filename = "./index.html"; +const latex_table = fs.readFileSync("latex_table.ejs", "utf8"); +const empty="-"; +const ex_decimal=4; +const size_decimal=2; + +/** + * Creates a pseudo-random value generator. The seed must be an integer. + * + * Uses an optimized version of the Park-Miller PRNG. + * http://www.firstpr.com.au/dsp/rand31/ + */ +function Random(seed) { + this._seed = seed % 2147483647; + if (this._seed <= 0) this._seed += 2147483646; +} + +/** + * Returns a pseudo-random value between 1 and 2^32 - 2. + */ +Random.prototype.next = function () { + return this._seed = this._seed * 16807 % 2147483647; +}; + + +/** + * Returns a pseudo-random floating point number in range [0, 1). + */ +Random.prototype.nextFloat = function (opt_minOrMax, opt_max) { + // We know that result of next() will be 1 to 2147483646 (inclusive). + return (this.next() - 1) / 2147483646; +}; + +// +// Trade-queue generate table +// +const get_toq=function(list, option) { + let toq_table=[]; + option=option || {}; +// option.match=option.match || false; + toq_table.format="|r|c|r|r|r|r|r|p{2cm}|p{2cm}|r|"; + let header=[]; + header.push("No"); + header.push("Type"); + header.push("Size"); + header.push("$P$"); + header.push("$Q$"); + header.push("$E_{ask}$"); + header.push("$E_{bid}$"); +// if ( option.match ) { + header.push("Bought"); + header.push("Sold"); + header.push("Id"); + +// } + + toq_table.push(header); + list.forEach(function(order) { + let row=[]; + if ( (typeof option.done === 'undefined') || ( option.done === order.done ) ) { + row.push(order.no); + const ask=(order.type === 'ATO'); + row.push(order.type); + if ( ask ) { + row.push(order.size.toString()+"TGS"); + } + else { + row.push(order.size.toString()+"ACL"); + } + row.push(order.P); + row.push(order.Q); + row.push(order.Eask.toFixed(ex_decimal)); + row.push(order.Ebid.toFixed(ex_decimal)); + if ( order.bought ) { + if ( ask ) { + row.push(order.bought.toFixed(size_decimal)+"TGS"); + } + else { + row.push(order.bought.toFixed(size_decimal)+"ACL"); + } + } + else { + row.push(" "); + } + if ( order.sold ) { +// if ( order.sold ) { + if ( ask ) { + row.push(order.sold.toFixed(size_decimal)+"TGS"); + } + else { + row.push(order.sold.toFixed(size_decimal)+"ACL"); + } + } + else { + row.push(" "); + } + if ( order.id ) { + row.push(order.id); + } + else { + row.push(" "); + } + toq_table.push(row); + } + }); + return toq_table; +} + +// +// ATO Sales list +// +const get_sales=function(list, done) { + let sales_tabel=[]; + sales_table.format="|r|c|r|r|r|r|p{2cm}|p{2cm}|r|"; + let header=[]; + header.push("No"); + header.push("Type"); + header.push("Size"); + header.push("$P$"); + header.push("$Q$"); + header.push("$E_{ask}$"); + header.push("$E_{bid}$"); + header.push("Sold"); + header.push("Bought"); + header.push("Id"); + sales_table.push(header); + list.forEach(function(order) { + let row=[]; + if ( (typeof done === 'undefined') || ( done === order.done ) ) { + row.push(order.no); + const ask=(order.type === 'ATO'); + row.push(order.type); + if ( ask ) { + row.push(order.size.toString()+"TGS"); + } + else { + row.push(order.size.toString()+"ACL"); + } + row.push(order.P); + row.push(order.Q); + row.push(order.Eask.toFixed(ex_decimal)); + row.push(order.Ebid.toFixed(ex_decimal)); + row.push(order.sold); + sales_table.push(row); + } + }); + return sales_table; +} + + +const ask=function(size, P, Q, no) { + return { + type : "ATO", + done : false, + sold : 0, + P : P, // price in TGS + Q : Q, // price in ACL + size : size, // size in ACL + no : no, + id : 0 + }; +} + +const bid=function(size, P, Q, no) { + return { + type : "BTO", + done : false, + sold : 0, + P : P, // price in TGS + Q : Q, // price in ACL + size : size, // size in TGS + no : no, + id : 0 + }; +} + +const random=new Random(12345); + +const rand=function(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(random.nextFloat(0,1) * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive +} + +// +// Trade-order-queue +// +let toq=[]; +const N=36; + +// +for(let i=0; i= 0 ) { + id++; + const seller_in_buyer_size=seller.Eask*seller.size; + const buyer_size_sold=Math.min(buyer.size, seller_in_buyer_size); + buyer.done=true; + buyer.id=id; + seller.done=true; + seller.id=id; + + buyer.bought=buyer_size_sold; + const seller_size_sold=seller.Ebid*buyer_size_sold; + if ( seller_size_sold < seller.size ) { + seller.sold=seller_size_sold; + } + else { + seller.sold=seller.size; + } +// console.log("ATO[%d] id=%d buyer.no=%d seller.no=%d", jdex, id, buyer.no, seller.no); + match.push({ buyer : buyer, seller : seller}); + return false; + } + } + return true; + }); + } + else { + ask_sales.every(function(seller, jdex) { + if ( !seller.done ) { + if ( bid_rate_compare(buyer, seller) >= 0 ) { + id++; + const seller_in_buyer_size=seller.Ebid*seller.size; + const buyer_size_sold=Math.min(buyer.size, seller_in_buyer_size); + buyer.done=true; + buyer.id=id; + seller.done=true; + seller.id=id; + + buyer.bought=buyer_size_sold; + const seller_size_sold=seller.Eask*buyer_size_sold; + if ( seller_size_sold < seller.size ) { + seller.sold=seller_size_sold; + } + else { + seller.sold=seller.size; + } +// console.log("BTO[%d] id=%d buyer.no=%d seller.no=%d", jdex, id, buyer.no, seller.no); + match.push({ buyer : buyer, seller : seller}); + return false; + } + } + return true; + }); + } + } +}); + +/* +console.log("ASK list"); +ask_sales.forEach(function(order) { + if ( !order.done ) { + console.log("%j", order); + } +}); +console.log("BID list"); +bid_sales.forEach(function(order) { + if ( !order.done ) { + console.log("%j", order); + } +}); +console.log("TOQ list"); +toq.forEach(function(order) { + if ( !order.done ) { + console.log("%j", order); + } +}); +console.log("Trade list"); +toq.forEach(function(order) { + if ( order.done ) { + console.log("%j", order); + } +}); +*/ + + + + +// +// Trading-queue not executed +// +text=ejs.render(latex_table, {table: get_toq(toq, { done : false})}); +fs.writeFileSync('toq_table_rest.tex', text); + +// +// Trading-queue executed +// +text=ejs.render(latex_table, {table: get_toq(toq, { done : true})}); +fs.writeFileSync('toq_table_executed.tex', text); + +// +// Ask-Sales not executed list table in latex +// +text=ejs.render(latex_table, {table: get_toq(ask_sales, { done : false})}); +fs.writeFileSync('ask_sales_table_rest.tex', text); + +// +// Bid-Sales not executed list table in latex +// +text=ejs.render(latex_table, {table: get_toq(bid_sales, { done : false})}); +fs.writeFileSync('bid_sales_table_rest.tex', text); + + + +// +// Ask-Sales executed list table in latex +// +text=ejs.render(latex_table, {table: get_toq(ask_sales, { done : true})}); +fs.writeFileSync('ask_sales_table_executed.tex', text); + +// +// Bid-Sales executed list table in latex +// +text=ejs.render(latex_table, {table: get_toq(bid_sales, { done : true})}); +fs.writeFileSync('bid_sales_table_executed.tex', text); + + +const get_match=function(match) { + let table=[]; +// option.match=option.match || false; + table.format="|c|c|c|c|c|c|c|c|c|c|"; + let header=[]; + + header.push("Buyer $\\rightarrow$ Seller"); + header.push("No $\\rightarrow$ No"); + header.push("$E_{buyer}$"); + header.push("$E_{seller}$"); + header.push("Bought"); + header.push("Sold"); + header.push("Id"); + table.push(header); + match.forEach(function(pair) { + let rows=[]; + rows.push(pair.buyer.type+"$\\rightarrow$"+pair.seller.type); + rows.push(pair.buyer.no+"$\\rightarrow$"+pair.seller.no); + const ask=(pair.buyer.type === 'ATO'); + if ( ask ) { + rows.push(pair.buyer.Eask.toFixed(ex_decimal)); + rows.push(pair.seller.Eask.toFixed(ex_decimal)); + rows.push(pair.buyer.bought.toFixed(size_decimal)+"TGS"); + rows.push(pair.seller.sold.toFixed(size_decimal)+"ACL"); + } + else { + rows.push(pair.buyer.Ebid.toFixed(ex_decimal)); + rows.push(pair.seller.Ebid.toFixed(ex_decimal)); + rows.push(pair.buyer.bought.toFixed(size_decimal)+"ACL"); + rows.push(pair.seller.sold.toFixed(size_decimal)+"TGS"); + } + rows.push(pair.buyer.id); + table.push(rows); + }); + return table; +} + +// +// Matching pair +// +text=ejs.render(latex_table, {table: get_match(match)}); +fs.writeFileSync('matching_pairs.tex', text); diff --git a/dex/latex_table.ejs b/dex/latex_table.ejs new file mode 100644 index 0000000..7a5603b --- /dev/null +++ b/dex/latex_table.ejs @@ -0,0 +1,6 @@ +\begin{tabular}{<%- table.format %>} +\hline +<% table.forEach(function(rows) { %> +<%- rows.join(' & ') %> \\ +\hline<% }); %> +\end{tabular} diff --git a/dex/package.json b/dex/package.json index 81b06eb..ec62dfa 100644 --- a/dex/package.json +++ b/dex/package.json @@ -3,6 +3,6 @@ "email": "cr@tagion.org", "url": "http://tagion.org/", "dependencies": { - "ejs": "^2.7.1" + "ejs": "^3.1.6" } } diff --git a/fig/consensus_order.eps b/fig/consensus_order.eps index 2427427..beb3e0e 100644 --- a/fig/consensus_order.eps +++ b/fig/consensus_order.eps @@ -1,9 +1,9 @@ %!PS-Adobe-3.0 EPSF-3.0 %%Title: consensus_order.fig -%%Creator: fig2dev Version 3.2.6a -%%CreationDate: 2019-09-14 16:38:09 +%%Creator: fig2dev Version 3.2.7a +%%CreationDate: 2022-01-20 12:22:18 %%BoundingBox: 0 0 372 458 -%Magnification: 1.0000 +%%Magnification: 1.0000 %%EndComments %%BeginProlog /$F2psDict 200 dict def @@ -22,6 +22,7 @@ end /sa {save} bind def /rs {restore} bind def /l {lineto} bind def +/rl {rlineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def @@ -63,10 +64,10 @@ end /$F2psEnd {$F2psEnteredState restore end} def /pageheader { -save -newpath 0 458 moveto 0 0 lineto 372 0 lineto 372 458 lineto closepath clip newpath -86.5 965.2 translate -1 -1 scale +sa +n 0 458 m 0 0 l 372 0 l 372 458 l cp clip +86.5 965.2 tr +1 -1 sc $F2psBegin 10 setmiterlimit 0 slj 0 slc @@ -86,13 +87,10 @@ pageheader % Ellipse 30.000 slw n 3375 9450 1125 1125 0 360 DrawEllipse gs col0 s gr - % Ellipse n 3375 14175 1125 1125 0 360 DrawEllipse gs col0 s gr - % Ellipse n -225 12150 1125 1125 0 360 DrawEllipse gs col0 s gr - % Arc 0 slc gs clippath @@ -101,7 +99,6 @@ eoclip n 1903.5 11812.5 1922.7 -40.0631 40.0631 arc gs col0 s gr gr - % arrowhead 0 slj 7.500 slw @@ -115,7 +112,6 @@ eoclip n 4923.2 11783.9 1999.9 140.7245 -142.8078 arc gs col0 s gr gr - % arrowhead 7.500 slw n 3256 10731 m 3319 10591 l 3207 10696 l 3249 10689 l 3256 10731 l @@ -128,7 +124,6 @@ eoclip n 2330.5 11713.7 1679.6 -88.1401 -170.2743 arcn gs col0 s gr gr - % arrowhead 7.500 slw n 681 11258 m 679 11411 l 740 11270 l 704 11293 l 681 11258 l @@ -141,7 +136,6 @@ eoclip n 510.9 9452.1 2033.7 84.0979 19.3217 arcn gs col0 s gr gr - % arrowhead 7.500 slw n 2396 10294 m 2423 10144 l 2340 10272 l 2379 10255 l 2396 10294 l @@ -149,11 +143,9 @@ n 2396 10294 m 2423 10144 l 2340 10272 l 2379 10255 l 2396 10294 l % Polyline 30.000 slw n -225 13275 m - -225 15075 l gs col0 s gr -% Polyline + -225 15075 l gs col0 s gr % Polyline n -225 11025 m - -225 8100 l gs col0 s gr -/Times-Roman ff 396.88 scf sf + -225 8100 l gs col0 s gr /Times-Roman ff 396.88 scf sf 3375 9900 m gs 1 -1 sc (k+1) col0 sh gr /Times-Roman ff 793.75 scf sf @@ -175,14 +167,14 @@ gs 1 -1 sc (A) col0 sh gr 4095 12825 m gs 1 -1 sc 90.0 rot (Points to mother) col0 sh gr /Times-Roman ff 285.75 scf sf -2835 12825 m -gs 1 -1 sc 90.0 rot (Points to daugther) col0 sh gr -/Times-Roman ff 285.75 scf sf 540 10845 m gs 1 -1 sc 38.0 rot (Points to father) col0 sh gr /Times-Roman ff 285.75 scf sf 1170 11835 m gs 1 -1 sc 38.0 rot (Points to son) col0 sh gr +/Times-Roman ff 285.75 scf sf +2835 12825 m +gs 1 -1 sc 90.0 rot (Points to daughter) col0 sh gr % here ends figure; pagefooter showpage diff --git a/fig/consensus_order.fig b/fig/consensus_order.fig index 0016a2a..ed07892 100644 --- a/fig/consensus_order.fig +++ b/fig/consensus_order.fig @@ -1,4 +1,4 @@ -#FIG 3.2 Produced by xfig version 3.2.6a +#FIG 3.2 Produced by xfig version 3.2.7b Landscape Center Metric @@ -28,13 +28,13 @@ Single 6 -1372 11003 922 13297 1 3 0 3 0 7 50 -1 -1 8.000 1 0.0000 -225 12150 1125 1125 -225 12150 450 13050 4 0 0 50 -1 -1 25 0.0000 4 300 210 -225 12600 k\001 -4 0 0 50 -1 -1 50 0.0000 4 585 615 -675 12375 A\001 +4 0 0 50 -1 -1 50 0.0000 4 570 615 -675 12375 A\001 -6 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 0 0 2 -225 13275 -225 15075 2 1 0 3 0 7 50 -1 -1 8.000 0 0 -1 0 0 2 -225 11025 -225 8100 -4 0 0 50 -1 -1 18 1.5708 4 210 2025 4095 12825 Points to mother\001 -4 0 0 50 -1 -1 18 1.5708 4 270 2220 2835 12825 Points to daugther\001 -4 0 0 50 -1 -1 18 0.6632 4 210 1875 540 10845 Points to father\001 -4 0 0 50 -1 -1 18 0.6632 4 195 1575 1170 11835 Points to son\001 +4 0 0 50 -1 -1 18 1.5708 4 195 1920 4095 12825 Points to mother\001 +4 0 0 50 -1 -1 18 0.6632 4 195 1785 540 10845 Points to father\001 +4 0 0 50 -1 -1 18 0.6632 4 195 1485 1170 11835 Points to son\001 +4 0 0 50 -1 -1 18 1.5708 4 255 2115 2835 12825 Points to daughter\001 diff --git a/fig/modules.eps b/fig/modules.eps new file mode 100644 index 0000000..3c21920 --- /dev/null +++ b/fig/modules.eps @@ -0,0 +1,531 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: modules.fig +%%Creator: fig2dev Version 3.2.7a +%%CreationDate: 2022-01-17 17:35:09 +%%BoundingBox: 0 0 1297 861 +%%Magnification: 1.0000 +%%EndComments +%%BeginProlog +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def + +end + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/rl {rlineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/reencdict 12 dict def /ReEncode { reencdict begin +/newcodesandnames exch def /newfontname exch def /basefontname exch def +/basefontdict basefontname findfont def /newfont basefontdict maxlength dict def +basefontdict { exch dup /FID ne { dup /Encoding eq +{ exch dup length array copy newfont 3 1 roll put } +{ exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall +newfont /FontName newfontname put newcodesandnames aload pop +128 1 255 { newfont /Encoding get exch /.notdef put } for +newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat +newfontname newfont definefont pop end } def +/isovec [ +8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde +8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis +8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron +8#220 /dotlessi 8#230 /oe 8#231 /OE +8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling +8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis +8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot +8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus +8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph +8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine +8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf +8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute +8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring +8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute +8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute +8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve +8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply +8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex +8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave +8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring +8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute +8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute +8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve +8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide +8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex +8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def +/Times-Roman /Times-Roman-iso isovec ReEncode +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +/pageheader { +sa +n 0 861 m 0 0 l 1297 0 l 1297 861 l cp clip +655.4 668.2 tr +1 -1 sc +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06299 0.06299 sc +} bind def +/pagefooter { +$F2psEnd +restore +} bind def +%%EndProlog +pageheader +% +% Fig objects follow +% +% +% here starts figure with depth 50 +% Polyline +0 slj +0 slc +30.000 slw +n -1800 9495 m -1980 9495 -1980 10350 180 arcto 4 {pop} repeat + -1980 10530 225 10530 180 arcto 4 {pop} repeat + 405 10530 405 9675 180 arcto 4 {pop} repeat + 405 9495 -1800 9495 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n 1350 9495 m 1170 9495 1170 10350 180 arcto 4 {pop} repeat + 1170 10530 3375 10530 180 arcto 4 {pop} repeat + 3555 10530 3555 9675 180 arcto 4 {pop} repeat + 3555 9495 1350 9495 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n 4500 9495 m 4320 9495 4320 10350 180 arcto 4 {pop} repeat + 4320 10530 6525 10530 180 arcto 4 {pop} repeat + 6705 10530 6705 9675 180 arcto 4 {pop} repeat + 6705 9495 4500 9495 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -1845 6975 m -2025 6975 -2025 7830 180 arcto 4 {pop} repeat + -2025 8010 180 8010 180 arcto 4 {pop} repeat + 360 8010 360 7155 180 arcto 4 {pop} repeat + 360 6975 -1845 6975 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -4905 7020 m -5085 7020 -5085 7875 180 arcto 4 {pop} repeat + -5085 8055 -2880 8055 180 arcto 4 {pop} repeat + -2700 8055 -2700 7200 180 arcto 4 {pop} repeat + -2700 7020 -4905 7020 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -8145 7020 m -8325 7020 -8325 7875 180 arcto 4 {pop} repeat + -8325 8055 -6120 8055 180 arcto 4 {pop} repeat + -5940 8055 -5940 7200 180 arcto 4 {pop} repeat + -5940 7020 -8145 7020 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -4905 5040 m -5085 5040 -5085 5895 180 arcto 4 {pop} repeat + -5085 6075 -2880 6075 180 arcto 4 {pop} repeat + -2700 6075 -2700 5220 180 arcto 4 {pop} repeat + -2700 5040 -4905 5040 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -4905 3195 m -5085 3195 -5085 4050 180 arcto 4 {pop} repeat + -5085 4230 -2880 4230 180 arcto 4 {pop} repeat + -2700 4230 -2700 3375 180 arcto 4 {pop} repeat + -2700 3195 -4905 3195 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -1890 1260 m -2070 1260 -2070 2115 180 arcto 4 {pop} repeat + -2070 2295 135 2295 180 arcto 4 {pop} repeat + 315 2295 315 1440 180 arcto 4 {pop} repeat + 315 1260 -1890 1260 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -8550 2610 m -8730 2610 -8730 3465 180 arcto 4 {pop} repeat + -8730 3645 -6525 3645 180 arcto 4 {pop} repeat + -6345 3645 -6345 2790 180 arcto 4 {pop} repeat + -6345 2610 -8550 2610 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n 1170 6975 m 990 6975 990 7830 180 arcto 4 {pop} repeat + 990 8010 3195 8010 180 arcto 4 {pop} repeat + 3375 8010 3375 7155 180 arcto 4 {pop} repeat + 3375 6975 1170 6975 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n 4950 2835 m 4770 2835 4770 3690 180 arcto 4 {pop} repeat + 4770 3870 6975 3870 180 arcto 4 {pop} repeat + 7155 3870 7155 3015 180 arcto 4 {pop} repeat + 7155 2835 4950 2835 180 arcto 4 {pop} repeat + cp gs col1 s gr % Polyline +n 4635 7020 m 4455 7020 4455 7875 180 arcto 4 {pop} repeat + 4455 8055 6660 8055 180 arcto 4 {pop} repeat + 6840 8055 6840 7200 180 arcto 4 {pop} repeat + 6840 7020 4635 7020 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n -5175 0 m -2700 0 l -2700 -1125 l -5175 -1125 l + cp gs col13 s gr % Polyline +n -2025 0 m 450 0 l 450 -1125 l -2025 -1125 l + cp gs col13 s gr % Polyline +n -8325 0 m -5850 0 l -5850 -1125 l -8325 -1125 l + cp gs col13 s gr % Polyline +n 1125 0 m 3600 0 l 3600 -1125 l 1125 -1125 l + cp gs col13 s gr % Polyline +n 7425 0 m 9900 0 l 9900 -1125 l 7425 -1125 l + cp gs col1 s gr % Polyline +n 1305 -1890 m 3780 -1890 l 3780 -3015 l 1305 -3015 l + cp gs col13 s gr % Polyline +n -4950 9540 m -5130 9540 -5130 10395 180 arcto 4 {pop} repeat + -5130 10575 -2925 10575 180 arcto 4 {pop} repeat + -2745 10575 -2745 9720 180 arcto 4 {pop} repeat + -2745 9540 -4950 9540 180 arcto 4 {pop} repeat + cp gs col13 s gr % Polyline +n 1800 2835 m 1620 2835 1620 3690 180 arcto 4 {pop} repeat + 1620 3870 3825 3870 180 arcto 4 {pop} repeat + 4005 3870 4005 3015 180 arcto 4 {pop} repeat + 4005 2835 1800 2835 180 arcto 4 {pop} repeat + cp gs col1 s gr % Arc +gs clippath +-7407 7038 m -7443 7038 l -7521 6645 l -7341 6642 l cp +eoclip +n -2461.3 6751.8 4970.9 -84.9646 176.9066 arcn +gs col0 s gr + gr +% arrowhead +7.500 slw +n -7521 6645 m -7425 7004 l -7341 6642 l -7521 6645 l cp gs 0.00 setgray ef gr col0 s +% Arc +30.000 slw +gs clippath +-7850 6975 m -7875 7000 l -8202 6768 l -8073 6643 l cp +eoclip +n -4829.9 3749.5 4435.8 -122.2972 133.3523 arcn +gs col23 s gr + gr +% arrowhead +7.500 slw +n -8202 6768 m -7886 6963 l -8073 6643 l -8202 6768 l cp gs col23 1.00 shd ef gr col23 s +% Arc +30.000 slw +gs clippath +266 9565 m 245 9536 l 517 9242 l 625 9386 l cp +eoclip +n -5306.7 1785.0 9551.9 -22.6276 54.2799 arc +gs col23 s gr + gr +% arrowhead +7.500 slw +n 517 9242 m 283 9530 l 625 9386 l 517 9242 l cp gs col23 1.00 shd ef gr col23 s +% Polyline +30.000 slw +gs clippath +1188 9972 m 1188 10008 l 794 10080 l 794 9900 l cp +eoclip +n 450 9990 m + 1170 9990 l gs col0 s gr gr +% arrowhead +7.500 slw +n 794 10080 m 1154 9990 l 794 9900 l 794 10080 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +4338 9972 m 4338 10008 l 3944 10080 l 3944 9900 l cp +eoclip +n 3600 9990 m + 4320 9990 l gs col0 s gr gr +% arrowhead +7.500 slw +n 3944 10080 m 4304 9990 l 3944 9900 l 3944 10080 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-792 9513 m -828 9513 l -900 9119 l -720 9119 l cp +eoclip +n -810 8010 m + -810 9495 l gs col0 s gr gr +% arrowhead +7.500 slw +n -900 9119 m -810 9479 l -720 9119 l -900 9119 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-3968 9564 m -3984 9532 l -3667 9288 l -3584 9448 l cp +eoclip +n -990 8010 m + -3960 9540 l gs col0 s gr gr +% arrowhead +7.500 slw +n -3667 9288 m -3946 9533 l -3584 9448 l -3667 9288 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-3942 9558 m -3978 9558 l -4050 9164 l -3870 9164 l cp +eoclip +n -3960 8055 m + -3960 9540 l gs col0 s gr gr +% arrowhead +7.500 slw +n -4050 9164 m -3960 9524 l -3870 9164 l -4050 9164 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-931 9507 m -949 9539 l -1328 9408 l -1240 9251 l cp +eoclip +n -3521 8074 m + -956 9514 l gs col0 s gr gr +% arrowhead +7.500 slw +n -1328 9408 m -970 9506 l -1240 9251 l -1328 9408 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-1508 9482 m -1517 9517 l -1917 9482 l -1869 9308 l cp +eoclip +n -6750 8055 m + -1530 9495 l gs col0 s gr gr +% arrowhead +7.500 slw +n -1917 9482 m -1546 9491 l -1869 9308 l -1917 9482 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-4700 9534 m -4719 9565 l -5094 9424 l -5001 9269 l cp +eoclip +n -7200 8055 m + -4725 9540 l gs col0 s gr gr +% arrowhead +7.500 slw +n -5094 9424 m -4739 9532 l -5001 9269 l -5094 9424 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-3942 7038 m -3978 7038 l -4050 6644 l -3870 6644 l cp +eoclip +n -3960 6120 m + -3960 7020 l gs col0 s gr gr +% arrowhead +7.500 slw +n -4050 6644 m -3960 7004 l -3870 6644 l -4050 6644 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-3987 5058 m -4023 5058 l -4095 4664 l -3915 4664 l cp +eoclip +n -4005 4230 m + -4005 5040 l gs col0 s gr gr +% arrowhead +7.500 slw +n -4095 4664 m -4005 5024 l -3915 4664 l -4095 4664 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-3925 3218 m -3938 3185 l -3596 2976 l -3532 3144 l cp +eoclip +n -1575 2295 m + -3915 3195 l gs col0 s gr gr +% arrowhead +7.500 slw +n -3596 2976 m -3900 3189 l -3532 3144 l -3596 2976 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-972 6993 m -1008 6993 l -1080 6599 l -900 6599 l cp +eoclip +n -990 2295 m + -990 6975 l gs col0 s gr gr +% arrowhead +7.500 slw +n -1080 6599 m -990 6959 l -900 6599 l -1080 6599 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +1869 6983 m 1837 6999 l 1600 6676 l 1762 6597 l cp +eoclip +n -450 2250 m + 1845 6975 l gs col0 s gr gr +% arrowhead +7.500 slw +n 1600 6676 m 1838 6960 l 1762 6597 l 1600 6676 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +-4656 5032 m -4672 5064 l -5058 4957 l -4979 4795 l cp +eoclip +n -7560 3645 m + -4680 5040 l gs col0 s gr gr +% arrowhead +7.500 slw +n -5058 4957 m -4695 5033 l -4979 4795 l -5058 4957 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +2139 2827 m 2123 2859 l 1738 2747 l 1819 2586 l cp +eoclip +n 315 1935 m + 2115 2835 l gs col0 s gr gr +% arrowhead +7.500 slw +n 1738 2747 m 2101 2828 l 1819 2586 l 1738 2747 l cp gs 0.00 setgray ef gr col0 s +% Polyline +30.000 slw +gs clippath +5916 2821 m 5909 2856 l 5508 2843 l 5547 2667 l cp +eoclip +n 315 1620 m + 5895 2835 l gs col0 s gr gr +% arrowhead +7.500 slw +n 5508 2843 m 5879 2832 l 5547 2667 l 5508 2843 l cp gs 0.00 setgray ef gr col0 s +% Polyline +60.000 slw + [210 105 15 105] 0 sd +n -10350 900 m + 10125 900 l gs col0 s gr [] 0 sd +% Polyline +30.000 slw +gs clippath +-7879 2725 m -7900 2696 l -7620 2410 l -7516 2557 l cp +eoclip +n -4050 0 m + -7875 2700 l gs col23 s gr gr +% arrowhead +7.500 slw +n -7620 2410 m -7862 2691 l -7516 2557 l -7620 2410 l cp gs col23 1.00 shd ef gr col23 s +% Polyline +30.000 slw +gs clippath +-882 1368 m -918 1368 l -990 974 l -810 974 l cp +eoclip +n -900 0 m + -900 1350 l gs col23 s gr gr +% arrowhead +7.500 slw +n -990 974 m -900 1334 l -810 974 l -990 974 l cp gs col23 1.00 shd ef gr col23 s +% Polyline +30.000 slw +gs clippath +13 9472 m -22 9463 l 0 9063 l 175 9105 l cp +eoclip +n 2250 0 m + 0 9450 l gs col23 s gr gr +% arrowhead +7.500 slw +n 0 9063 m 4 9434 l 175 9105 l 0 9063 l cp gs col23 1.00 shd ef gr col23 s +% Polyline +30.000 slw +gs clippath +3698 2814 m 3666 2798 l 3773 2412 l 3935 2491 l cp +eoclip +n 5040 0 m + 3690 2790 l gs col23 s gr gr +% arrowhead +7.500 slw +n 3773 2412 m 3697 2775 l 3935 2491 l 3773 2412 l cp gs col23 1.00 shd ef gr col23 s +% Polyline +30.000 slw +gs clippath +6580 2813 m 6547 2800 l 6622 2407 l 6790 2472 l cp +eoclip +n 7650 0 m + 6570 2790 l gs col23 s gr gr +% arrowhead +7.500 slw +n 6622 2407 m 6576 2775 l 6790 2472 l 6622 2407 l cp gs col23 1.00 shd ef gr col23 s +% Polyline +30.000 slw +n 4275 0 m 6750 0 l 6750 -1125 l 4275 -1125 l + cp gs col1 s gr /Times-Roman-iso ff 412.75 scf sf +-1350 10125 m +gs 1 -1 sc (HiBON) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +1800 10125 m +gs 1 -1 sc (Utils) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +4950 10125 m +gs 1 -1 sc (Basic) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-1845 7605 m +gs 1 -1 sc (Hashgraph) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-4455 7650 m +gs 1 -1 sc (HiRPC) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-8145 7650 m +gs 1 -1 sc (DART-DB) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-4680 5670 m +gs 1 -1 sc (Network) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-4680 3825 m +gs 1 -1 sc (Monitor) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-1665 1890 m +gs 1 -1 sc (Service) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-8325 3240 m +gs 1 -1 sc (Wallet) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +1620 7605 m +gs 1 -1 sc (libp2p) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +5175 3465 m +gs 1 -1 sc (WASM) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +4860 7650 m +gs 1 -1 sc (Logger) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-4950 -450 m +gs 1 -1 sc (tagionwallet) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-1800 -450 m +gs 1 -1 sc (tagionwave) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-7875 -450 m +gs 1 -1 sc (dartutil) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +1575 -450 m +gs 1 -1 sc (hibonutil) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +7650 -450 m +gs 1 -1 sc (wasmutil) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +1755 -2340 m +gs 1 -1 sc (tagioutil) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +-4500 10170 m +gs 1 -1 sc (Crypto) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +2025 3465 m +gs 1 -1 sc (TVM) col0 sh gr +/Times-Roman-iso ff 635.00 scf sf +-9675 7425 m +gs 1 -1 sc 90.0 rot (Modules) col0 sh gr +/Times-Roman-iso ff 635.00 scf sf +-9900 450 m +gs 1 -1 sc 90.0 rot (Tools) col0 sh gr +/Times-Roman-iso ff 412.75 scf sf +4725 -450 m +gs 1 -1 sc (tvm) col0 sh gr +% here ends figure; +pagefooter +showpage +%%Trailer +%EOF diff --git a/fig/modules.fig b/fig/modules.fig new file mode 100644 index 0000000..3434e49 --- /dev/null +++ b/fig/modules.fig @@ -0,0 +1,190 @@ +#FIG 3.2 Produced by xfig version 3.2.7b +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +5 1 0 3 0 7 50 -1 -1 0.000 0 1 1 0 -2461.306 6751.752 -2025 1800 -4995 2475 -7425 7020 + 1 1 1.00 180.00 360.00 +5 1 0 3 23 7 50 -1 -1 0.000 0 1 1 0 -4829.905 3749.525 -7200 0 -9225 3150 -7875 6975 + 1 1 1.00 180.00 360.00 +5 1 0 3 23 7 50 -1 -1 0.000 0 0 1 0 -5306.667 1785.000 3510 -1890 3915 4275 270 9540 + 1 1 1.00 180.00 360.00 +6 -2025 9450 450 10575 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 405 10530 -1980 10530 -1980 9495 405 9495 405 10530 +4 0 0 50 -1 1 26 0.0000 0 285 1350 -1350 10125 HiBON\001 +-6 +6 1125 9450 3600 10575 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 3555 10530 1170 10530 1170 9495 3555 9495 3555 10530 +4 0 0 50 -1 1 26 0.0000 0 300 840 1800 10125 Utils\001 +-6 +6 4275 9450 6750 10575 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 6705 10530 4320 10530 4320 9495 6705 9495 6705 10530 +4 0 0 50 -1 1 26 0.0000 0 285 960 4950 10125 Basic\001 +-6 +6 -2070 6930 405 8055 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 360 8010 -2025 8010 -2025 6975 360 6975 360 8010 +4 0 0 50 -1 1 26 0.0000 0 390 1920 -1845 7605 Hashgraph\001 +-6 +6 -5130 6975 -2655 8100 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + -2700 8055 -5085 8055 -5085 7020 -2700 7020 -2700 8055 +4 0 0 50 -1 1 26 0.0000 0 285 1245 -4455 7650 HiRPC\001 +-6 +6 -5100 5025 -2685 6090 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + -2700 6075 -5085 6075 -5085 5040 -2700 5040 -2700 6075 +4 0 0 50 -1 1 26 0.0000 0 300 1545 -4680 5670 Network\001 +-6 +6 -5130 3150 -2655 4275 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + -2700 4230 -5085 4230 -5085 3195 -2700 3195 -2700 4230 +4 0 0 50 -1 1 26 0.0000 0 285 1455 -4680 3825 Monitor\001 +-6 +6 -2115 1215 360 2340 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 315 2295 -2070 2295 -2070 1260 315 1260 315 2295 +4 0 0 50 -1 1 26 0.0000 0 285 1320 -1665 1890 Service\001 +-6 +6 -8775 2565 -6300 3690 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + -6345 3645 -8730 3645 -8730 2610 -6345 2610 -6345 3645 +4 0 0 50 -1 1 26 0.0000 0 300 1170 -8325 3240 Wallet\001 +-6 +6 945 6930 3420 8055 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 3375 8010 990 8010 990 6975 3375 6975 3375 8010 +4 0 0 50 -1 1 26 0.0000 0 390 1140 1620 7605 libp2p\001 +-6 +6 4725 2790 7200 3915 +2 4 0 3 1 7 50 -1 -1 0.000 0 0 12 0 0 5 + 7155 3870 4770 3870 4770 2835 7155 2835 7155 3870 +4 0 0 50 -1 1 26 0.0000 0 285 1365 5175 3465 WASM\001 +-6 +6 4410 6975 6885 8100 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + 6840 8055 4455 8055 4455 7020 6840 7020 6840 8055 +4 0 0 50 -1 1 26 0.0000 0 375 1290 4860 7650 Logger\001 +-6 +6 -5400 -1350 -2475 225 +2 2 0 3 13 7 50 -1 -1 0.000 0 0 -1 0 0 5 + -5175 0 -2700 0 -2700 -1125 -5175 -1125 -5175 0 +4 0 0 50 -1 1 26 0.0000 0 390 2175 -4950 -450 tagionwallet\001 +-6 +6 -2250 -1350 675 225 +2 2 0 3 13 7 50 -1 -1 0.000 0 0 -1 0 0 5 + -2025 0 450 0 450 -1125 -2025 -1125 -2025 0 +4 0 0 50 -1 1 26 0.0000 0 375 2040 -1800 -450 tagionwave\001 +-6 +6 -8550 -1350 -5625 225 +2 2 0 3 13 7 50 -1 -1 0.000 0 0 -1 0 0 5 + -8325 0 -5850 0 -5850 -1125 -8325 -1125 -8325 0 +4 0 0 50 -1 1 26 0.0000 0 300 1275 -7875 -450 dartutil\001 +-6 +6 900 -1350 3825 225 +2 2 0 3 13 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1125 0 3600 0 3600 -1125 1125 -1125 1125 0 +4 0 0 50 -1 1 26 0.0000 0 300 1605 1575 -450 hibonutil\001 +-6 +6 7200 -1350 10125 225 +2 2 0 3 1 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 7425 0 9900 0 9900 -1125 7425 -1125 7425 0 +4 0 0 50 -1 1 26 0.0000 0 300 1605 7650 -450 wasmutil\001 +-6 +6 1290 -3030 3795 -1875 +2 2 0 3 13 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1305 -1890 3780 -1890 3780 -3015 1305 -3015 1305 -1890 +4 0 0 50 -1 1 26 0.0000 0 390 1470 1755 -2340 tagioutil\001 +-6 +6 -5145 9525 -2730 10590 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + -2745 10575 -5130 10575 -5130 9540 -2745 9540 -2745 10575 +4 0 0 50 -1 1 26 0.0000 0 375 1230 -4500 10170 Crypto\001 +-6 +6 1605 2820 4020 3885 +2 4 0 3 1 7 50 -1 -1 0.000 0 0 12 0 0 5 + 4005 3870 1620 3870 1620 2835 4005 2835 4005 3870 +4 0 0 50 -1 1 26 0.0000 0 285 975 2025 3465 TVM\001 +-6 +6 -8340 7005 -5925 8070 +2 4 0 3 13 7 50 -1 -1 0.000 0 0 12 0 0 5 + -5940 8055 -8325 8055 -8325 7020 -5940 7020 -5940 8055 +4 0 0 50 -1 1 26 0.0000 0 285 1185 -8145 7650 DART\001 +-6 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 450 9990 1170 9990 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 3600 9990 4320 9990 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -810 8010 -810 9495 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -990 8010 -3960 9540 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -3960 8055 -3960 9540 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -3521 8074 -956 9514 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -6750 8055 -1530 9495 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -7200 8055 -4725 9540 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -3960 6120 -3960 7020 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -4005 4230 -4005 5040 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -1575 2295 -3915 3195 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -990 2295 -990 6975 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -450 2250 1845 6975 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -7560 3645 -4680 5040 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 315 1935 2115 2835 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 315 1620 5895 2835 +2 1 3 5 0 7 50 -1 -1 14.000 0 0 -1 0 0 2 + -10350 900 10125 900 +2 1 0 3 23 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -4050 0 -7875 2700 +2 1 0 3 23 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + -900 0 -900 1350 +2 1 0 3 23 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 2250 0 0 9450 +2 1 0 3 23 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 5040 0 3690 2790 +2 1 0 3 23 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 180.00 360.00 + 7650 0 6570 2790 +2 2 0 3 1 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4275 0 6750 0 6750 -1125 4275 -1125 4275 0 +4 0 0 50 -1 1 40 1.5708 0 480 2310 -9675 7425 Modules\001 +4 0 0 50 -1 1 40 1.5708 0 465 1500 -9900 450 Tools\001 +4 0 0 50 -1 1 26 0.0000 0 255 690 4725 -450 tvm\001 diff --git a/fig/network_architecture.eps b/fig/network_architecture.eps new file mode 100644 index 0000000..e592f55 --- /dev/null +++ b/fig/network_architecture.eps @@ -0,0 +1,543 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: network_architecture.fig +%%Creator: fig2dev Version 3.2.7a +%%CreationDate: 2022-01-19 08:58:37 +%%BoundingBox: 0 0 1187 842 +%%Magnification: 1.0000 +%%EndComments +%%BeginProlog +/MyAppDict 100 dict dup begin def +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def + +end + +% left45 +<< + /PatternType 1 + /PaintType 2 + /TilingType 1 + /BBox [0 0 24 24] + /XStep 24 + /YStep 24 + /PaintProc + { + pop + 1 slw n + 7 8 24 {dup dup -1 exch m -1 l -2 add dup 25 m 25 exch l} for + s + } bind +>> +matrix +makepattern +/P4 exch def + +% right45 +<< + /PatternType 1 + /PaintType 2 + /TilingType 1 + /BBox [0 0 24 24] + /XStep 24 + /YStep 24 + /PaintProc + { + pop + 1 slw n + 1 8 18 {dup dup -1 m 25 exch -1 mul 24 add l 4 add dup -1 exch m -1 mul 24 add 25 l} for + s + } bind +>> +matrix +makepattern +/P5 exch def + +% horizontal lines +<< + /PatternType 1 + /PaintType 2 + /TilingType 1 + /BBox [0 0 36 24] + /XStep 36 + /YStep 24 + /PaintProc + { + pop + 1 slw 0 slc n + -2 6 {4 add dup -1 exch m 38 0 rl} repeat pop s + } bind +>> +matrix +makepattern +/P9 exch def +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/rl {rlineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def + /DrawEllipse { + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y tr xrad yrad sc 0 0 1 startangle endangle arc + closepath + savematrix setmatrix + } def + +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +/pageheader { +sa +n 0 842 m 0 0 l 1187 0 l 1187 842 l cp clip +120.5 1118.2 tr +1 -1 sc +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06299 0.06299 sc +} bind def +/pagefooter { +$F2psEnd +restore +} bind def +%%EndProlog +pageheader +% +% Fig objects follow +% +% +% here starts figure with depth 51 +% Ellipse +30.000 slw +n 5400 10800 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse + [135 61 15 45 15 61] 0 sd +n 4950 11250 3150 3150 0 360 DrawEllipse gs col0 s gr + [] 0 sd +% Ellipse +60.000 slw +n 4860 11250 5810 5810 0 360 DrawEllipse gs col0 s gr +% Ellipse +30.000 slw +n 6210 9720 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 4320 9360 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 3510 10440 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 5400 12060 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 4230 11790 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 2880 11700 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 3690 12690 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 4950 13410 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 6210 12870 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 8460 9360 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 1.00 1.00 0.00 P9 setpattern fill gr + +gs col6 s gr +% Ellipse +n 9810 12150 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 7200 11340 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 5400 8820 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 2970 9630 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 8550 12690 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 9540 10710 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 9000 8280 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 7380 8010 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 270 8910 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 1170 9900 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 90 11880 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 1170 12780 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 1170 14220 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 2430 14490 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 4680 16200 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 6930 14850 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 3780 14940 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 2520 8190 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 2880 6840 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 5040 7290 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 6750 6660 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 8640 14220 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 12600 12150 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.56 0.00 P4 setpattern fill gr + +gs col12 s gr +% Ellipse +n 12600 13050 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 0.00 0.00 1.00 P5 setpattern fill gr + +gs col1 s gr +% Ellipse +n 12600 13950 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 1.00 1.00 0.00 P9 setpattern fill gr + +gs col6 s gr +% Ellipse +n 12600 14850 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 11250 8730 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 9720 6120 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 5040 4770 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 720 5940 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n -1530 9450 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n -1080 14400 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 2250 17370 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 8550 17280 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 10170 15120 360 360 0 360 DrawEllipse gs col4 s gr +% Ellipse +n 1215 11160 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 1.00 1.00 0.00 P9 setpattern fill gr + +gs col6 s gr +% Ellipse +n 5535 14850 360 360 0 360 DrawEllipse +% Fill with pattern background color +gs /DeviceRGB setcolorspace 1.00 1.00 1.00 setcolor fill gr + +% Fill with pattern pen color +gs /DeviceRGB setcolorspace 1.00 1.00 0.00 P9 setpattern fill gr + +gs col6 s gr +% Polyline +0 slj +0 slc +60.000 slw +n 11925 11250 m 16875 11250 l 16875 15525 l 11925 15525 l + cp gs col0 s gr /Times-Roman ff 508.00 scf sf +13320 12240 m +gs 1 -1 sc (Active Node) col0 sh gr +/Times-Roman ff 508.00 scf sf +13410 13140 m +gs 1 -1 sc (Standby Node) col0 sh gr +/Times-Roman ff 508.00 scf sf +13410 14040 m +gs 1 -1 sc (Swap Node) col0 sh gr +/Times-Roman ff 508.00 scf sf +13410 14940 m +gs 1 -1 sc (Prospect Node) col0 sh gr +% here ends figure; +pagefooter +showpage +%%Trailer +end +%EOF diff --git a/fig/network_architecture.fig b/fig/network_architecture.fig new file mode 100644 index 0000000..3b58497 --- /dev/null +++ b/fig/network_architecture.fig @@ -0,0 +1,65 @@ +#FIG 3.2 Produced by xfig version 3.2.7b +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 5400 10800 360 360 5400 10800 5760 10800 +1 3 4 3 0 7 51 -1 -1 9.000 1 0.0000 4950 11250 3150 3150 4950 11250 8100 11250 +1 3 0 5 0 7 51 -1 -1 0.000 1 0.0000 4860 11250 5810 5810 4860 11250 10440 12870 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 6210 9720 360 360 6210 9720 6570 9720 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 4320 9360 360 360 4320 9360 4680 9360 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 3510 10440 360 360 3510 10440 3870 10440 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 5400 12060 360 360 5400 12060 5760 12060 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 4230 11790 360 360 4230 11790 4590 11790 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 2880 11700 360 360 2880 11700 3240 11700 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 3690 12690 360 360 3690 12690 4050 12690 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 4950 13410 360 360 4950 13410 5310 13410 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 6210 12870 360 360 6210 12870 6570 12870 +1 3 0 3 6 7 51 -1 49 0.000 1 0.0000 8460 9360 360 360 8460 9360 8820 9360 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 9810 12150 360 360 9810 12150 10170 12150 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 7200 11340 360 360 7200 11340 7560 11340 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 5400 8820 360 360 5400 8820 5760 8820 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 2970 9630 360 360 2970 9630 3330 9630 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 8550 12690 360 360 8550 12690 8910 12690 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 9540 10710 360 360 9540 10710 9900 10710 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 9000 8280 360 360 9000 8280 9360 8280 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 7380 8010 360 360 7380 8010 7740 8010 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 270 8910 360 360 270 8910 630 8910 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 1170 9900 360 360 1170 9900 1530 9900 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 90 11880 360 360 90 11880 450 11880 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 1170 12780 360 360 1170 12780 1530 12780 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 1170 14220 360 360 1170 14220 1530 14220 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 2430 14490 360 360 2430 14490 2790 14490 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 4680 16200 360 360 4680 16200 5040 16200 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 6930 14850 360 360 6930 14850 7290 14850 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 3780 14940 360 360 3780 14940 4140 14940 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 2520 8190 360 360 2520 8190 2880 8190 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 2880 6840 360 360 2880 6840 3240 6840 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 5040 7290 360 360 5040 7290 5400 7290 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 6750 6660 360 360 6750 6660 7110 6660 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 8640 14220 360 360 8640 14220 9000 14220 +1 3 0 3 12 7 51 -1 44 0.000 1 0.0000 12600 12150 360 360 12600 12150 12960 12150 +1 3 0 3 1 7 51 -1 45 0.000 1 0.0000 12600 13050 360 360 12600 13050 12960 13050 +1 3 0 3 6 7 51 -1 49 0.000 1 0.0000 12600 13950 360 360 12600 13950 12960 13950 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 12600 14850 360 360 12600 14850 12960 14850 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 11250 8730 360 360 11250 8730 11610 8730 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 9720 6120 360 360 9720 6120 10080 6120 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 5040 4770 360 360 5040 4770 5400 4770 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 720 5940 360 360 720 5940 1080 5940 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 -1530 9450 360 360 -1530 9450 -1170 9450 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 -1080 14400 360 360 -1080 14400 -720 14400 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 2250 17370 360 360 2250 17370 2610 17370 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 8550 17280 360 360 8550 17280 8910 17280 +1 3 0 3 4 7 51 -1 -1 0.000 1 0.0000 10170 15120 360 360 10170 15120 10530 15120 +1 3 0 3 6 7 51 -1 49 0.000 1 0.0000 1215 11160 360 360 1215 11160 1575 11160 +1 3 0 3 6 7 51 -1 49 0.000 1 0.0000 5535 14850 360 360 5535 14850 5895 14850 +2 2 0 5 0 7 51 -1 -1 0.000 0 0 -1 0 0 5 + 11925 11250 16875 11250 16875 15525 11925 15525 11925 11250 +4 0 0 51 -1 0 32 0.0000 4 360 2745 13320 12240 Active Node\001 +4 0 0 51 -1 0 32 0.0000 4 495 3075 13410 13140 Standby Node\001 +4 0 0 51 -1 0 32 0.0000 4 495 2505 13410 14040 Swap Node\001 +4 0 0 51 -1 0 32 0.0000 4 480 3165 13410 14940 Prospect Node\001 diff --git a/fig/node_service.eps b/fig/node_service.eps index 5d0e24d..6da816c 100644 --- a/fig/node_service.eps +++ b/fig/node_service.eps @@ -1,9 +1,9 @@ %!PS-Adobe-3.0 EPSF-3.0 %%Title: node_service.fig -%%Creator: fig2dev Version 3.2.6a -%%CreationDate: 2019-09-07 17:13:29 -%%BoundingBox: 0 0 1046 563 -%Magnification: 1.0000 +%%Creator: fig2dev Version 3.2.7a +%%CreationDate: 2022-01-20 06:52:17 +%%BoundingBox: 0 0 1149 655 +%%Magnification: 1.0000 %%EndComments %%BeginProlog /$F2psDict 200 dict def @@ -12,6 +12,7 @@ $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def end @@ -22,6 +23,7 @@ end /sa {save} bind def /rs {restore} bind def /l {lineto} bind def +/rl {rlineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def @@ -84,14 +86,15 @@ newfontname newfont definefont pop end } def 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def /Helvetica /Helvetica-iso isovec ReEncode +/Times-Roman /Times-Roman-iso isovec ReEncode /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def /pageheader { -save -newpath 0 563 moveto 0 0 lineto 1046 0 lineto 1046 563 lineto closepath clip newpath --346.8 1154.3 translate -1 -1 scale +sa +n 0 655 m 0 0 l 1149 0 l 1149 655 l cp clip +-346.8 1220.4 tr +1 -1 sc $F2psBegin 10 setmiterlimit 0 slj 0 slc @@ -116,227 +119,183 @@ n 14175 12150 m 13950 12150 13950 13275 225 arcto 4 {pop} repeat 13950 13500 16875 13500 225 arcto 4 {pop} repeat 17100 13500 17100 12375 225 arcto 4 {pop} repeat 17100 12150 14175 12150 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline + cp gs col0 s gr % Polyline n 9225 12150 m 9000 12150 9000 13275 225 arcto 4 {pop} repeat 9000 13500 12375 13500 225 arcto 4 {pop} repeat 12600 13500 12600 12375 225 arcto 4 {pop} repeat 12600 12150 9225 12150 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline + cp gs col0 s gr % Polyline 90.000 slw n 6030 11970 m 5580 13320 l 6930 13320 l 7380 11970 l - cp gs col0 s gr -% Polyline + cp gs col0 s gr % Polyline 7.500 slw n 6255 12195 m - 6930 12195 l gs col0 s gr -% Polyline + 6930 12195 l gs col0 s gr % Polyline n 6165 12420 m - 6840 12420 l gs col0 s gr -% Polyline + 6840 12420 l gs col0 s gr % Polyline n 6075 12600 m - 6750 12600 l gs col0 s gr -% Polyline + 6750 12600 l gs col0 s gr % Polyline n 6075 12780 m - 6750 12780 l gs col0 s gr -% Polyline + 6750 12780 l gs col0 s gr % Polyline n 5985 12960 m - 6660 12960 l gs col0 s gr -% Polyline + 6660 12960 l gs col0 s gr % Polyline n 5895 13140 m - 6570 13140 l gs col0 s gr -% Polyline + 6570 13140 l gs col0 s gr % Polyline 60.000 slw n 18675 12150 m 18450 12150 18450 13275 225 arcto 4 {pop} repeat 18450 13500 21375 13500 225 arcto 4 {pop} repeat 21600 13500 21600 12375 225 arcto 4 {pop} repeat 21600 12150 18675 12150 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline -n 14595 14460 m 14370 14460 14370 15585 225 arcto 4 {pop} repeat - 14370 15810 16395 15810 225 arcto 4 {pop} repeat - 16620 15810 16620 14685 225 arcto 4 {pop} repeat - 16620 14460 14595 14460 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline -n 14625 16920 m 14400 16920 14400 18045 225 arcto 4 {pop} repeat - 14400 18270 16425 18270 225 arcto 4 {pop} repeat - 16650 18270 16650 17145 225 arcto 4 {pop} repeat - 16650 16920 14625 16920 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline - [180] 0 sd -n 7065 15570 m 6840 15570 6840 16695 225 arcto 4 {pop} repeat - 6840 16920 9765 16920 225 arcto 4 {pop} repeat - 9990 16920 9990 15795 225 arcto 4 {pop} repeat - 9990 15570 7065 15570 225 arcto 4 {pop} repeat - cp gs col0 s gr [] 0 sd -% Polyline + cp gs col0 s gr % Polyline n 19575 9450 m 19350 9450 19350 10575 225 arcto 4 {pop} repeat 19350 10800 21825 10800 225 arcto 4 {pop} repeat 22050 10800 22050 9675 225 arcto 4 {pop} repeat 22050 9450 19575 9450 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline -n 13275 9450 m 13050 9450 13050 10575 225 arcto 4 {pop} repeat - 13050 10800 17325 10800 225 arcto 4 {pop} repeat - 17550 10800 17550 9675 225 arcto 4 {pop} repeat - 17550 9450 13275 9450 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Polyline + cp gs col0 s gr % Polyline n 9225 9450 m 9000 9450 9000 10575 225 arcto 4 {pop} repeat 9000 10800 11025 10800 225 arcto 4 {pop} repeat 11250 10800 11250 9675 225 arcto 4 {pop} repeat 11250 9450 9225 9450 225 arcto 4 {pop} repeat - cp gs col0 s gr -% Arc + cp gs col0 s gr % Polyline +n 14625 17955 m 14400 17955 14400 19080 225 arcto 4 {pop} repeat + 14400 19305 16425 19305 225 arcto 4 {pop} repeat + 16650 19305 16650 18180 225 arcto 4 {pop} repeat + 16650 17955 14625 17955 225 arcto 4 {pop} repeat + cp gs col0 s gr % Polyline +n 14565 15045 m 14340 15045 14340 16170 225 arcto 4 {pop} repeat + 14340 16395 16365 16395 225 arcto 4 {pop} repeat + 16590 16395 16590 15270 225 arcto 4 {pop} repeat + 16590 15045 14565 15045 225 arcto 4 {pop} repeat + cp gs col0 s gr % Polyline +n 14535 9045 m 14310 9045 14310 10170 225 arcto 4 {pop} repeat + 14310 10395 16605 10395 225 arcto 4 {pop} repeat + 16830 10395 16830 9270 225 arcto 4 {pop} repeat + 16830 9045 14535 9045 225 arcto 4 {pop} repeat + cp gs col0 s gr % Polyline +n 18540 17970 m 18315 17970 18315 19095 225 arcto 4 {pop} repeat + 18315 19320 21240 19320 225 arcto 4 {pop} repeat + 21465 19320 21465 18195 225 arcto 4 {pop} repeat + 21465 17970 18540 17970 225 arcto 4 {pop} repeat + cp gs col0 s gr % Arc 90.000 slw gs clippath -16708 17970 m 16680 17878 l 17357 17601 l 17276 17751 l 17425 17831 l cp +19083 13356 m 19179 13368 l 19178 13965 l 18939 13936 l cp +16508 18157 m 16448 18083 l 16865 17655 l 17015 17843 l cp eoclip -n 15706.3 13485.4 4543.7 0.1836 76.8503 arc +n 12683.6 12885.4 6462.8 53.6406 4.6556 arcn gs col0 s gr gr - % arrowhead 30.000 slw -n 17357 17601 m 16816 17887 l 17425 17831 l 17276 17751 l 17357 17601 l - cp gs col7 1.00 shd ef gr col0 s -% Arc -90.000 slw -gs clippath -11384 13450 m 11480 13454 l 11525 14183 l 11409 14059 l 11285 14175 l cp -eoclip -n 14817.9 13894.9 3410.8 97.0370 -173.3514 arc -gs col0 s gr - gr - +n 16865 17655 m 16565 18049 l 17015 17843 l 16865 17655 l cp gs col7 1.00 shd ef gr col0 s % arrowhead -30.000 slw -n 11525 14183 m 11427 13579 l 11285 14175 l 11409 14059 l 11525 14183 l - cp gs col7 1.00 shd ef gr col0 s +n 19178 13965 m 19117 13474 l 18939 13936 l 19178 13965 l cp gs col7 1.00 shd ef gr col0 s % Arc 90.000 slw gs clippath -19586 13441 m 19679 13466 l 19562 14188 l 19477 14041 l 19330 14126 l cp +11333 13411 m 11429 13403 l 11549 13988 l 11310 14008 l cp eoclip -n 13580.3 12184.9 6181.2 60.2237 12.2840 arcn +n 16592.1 13298.6 5209.5 114.3406 178.2793 arc gs col0 s gr gr - % arrowhead 30.000 slw -n 19562 14188 m 19600 13577 l 19330 14126 l 19477 14041 l 19562 14188 l - cp gs col7 1.00 shd ef gr col0 s +n 11549 13988 m 11390 13520 l 11310 14008 l 11549 13988 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -13998 12777 m 13998 12873 l 13271 12945 l 13391 12825 l 13271 12705 l cp +15618 12243 m 15522 12243 l 15450 11650 l 15690 11650 l cp +15522 10257 m 15618 10257 l 15690 10850 l 15450 10850 l cp eoclip -n 12600 12825 m - 13950 12825 l gs col0 s gr gr - +n 15570 10305 m + 15570 12195 l gs col0 s gr gr % arrowhead 30.000 slw -n 13271 12945 m 13871 12825 l 13271 12705 l 13391 12825 l 13271 12945 l - cp gs col7 1.00 shd ef gr col0 s +n 15690 10850 m 15570 10370 l 15450 10850 l 15690 10850 l cp gs col7 1.00 shd ef gr col0 s +% arrowhead +n 15450 11650 m 15570 12130 l 15690 11650 l 15450 11650 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -9048 12777 m 9048 12873 l 8321 12945 l 8441 12825 l 8321 12705 l cp +14043 12777 m 14043 12873 l 13450 12945 l 13450 12705 l cp eoclip -n 7650 12825 m - 9000 12825 l gs col0 s gr gr - +n 12600 12825 m + 13995 12825 l gs col0 s gr gr % arrowhead 30.000 slw -n 8321 12945 m 8921 12825 l 8321 12705 l 8441 12825 l 8321 12945 l - cp gs col7 1.00 shd ef gr col0 s +n 13450 12945 m 13930 12825 l 13450 12705 l 13450 12945 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -18498 12732 m 18498 12828 l 17771 12900 l 17891 12780 l 17771 12660 l cp +18588 12732 m 18588 12828 l 17995 12900 l 17995 12660 l cp eoclip n 17100 12780 m - 18450 12780 l gs col0 s gr gr - + 18540 12780 l gs col0 s gr gr % arrowhead 30.000 slw -n 17771 12900 m 18371 12780 l 17771 12660 l 17891 12780 l 17771 12900 l - cp gs col7 1.00 shd ef gr col0 s +n 17995 12900 m 18475 12780 l 17995 12660 l 17995 12900 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -14982 15792 m 15078 15792 l 15150 16519 l 15030 16399 l 14910 16519 l cp +15588 18048 m 15492 18048 l 15415 17456 l 15655 17454 l cp +15477 16287 m 15573 16287 l 15650 16879 l 15410 16881 l cp eoclip -n 15030 16920 m - 15030 15840 l gs col0 s gr gr - +n 15525 16335 m + 15540 18000 l gs col0 s gr gr % arrowhead 30.000 slw -n 15150 16519 m 15030 15919 l 14910 16519 l 15030 16399 l 15150 16519 l - cp gs col7 1.00 shd ef gr col0 s -% Polyline -90.000 slw -gs clippath -15978 16968 m 15882 16968 l 15810 16241 l 15930 16361 l 16050 16241 l cp -eoclip -n 15930 15840 m - 15930 16920 l gs col0 s gr gr - +n 15650 16879 m 15526 16400 l 15410 16881 l 15650 16879 l cp gs col7 1.00 shd ef gr col0 s % arrowhead -30.000 slw -n 15810 16241 m 15930 16841 l 16050 16241 l 15930 16361 l 15810 16241 l - cp gs col7 1.00 shd ef gr col0 s +n 15415 17456 m 15539 17935 l 15655 17454 l 15415 17456 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -14898 14538 m 14802 14538 l 14730 13811 l 14850 13931 l 14970 13811 l cp +15588 15153 m 15492 15153 l 15415 14561 l 15655 14559 l cp +15477 13317 m 15573 13317 l 15650 13909 l 15410 13911 l cp eoclip -n 14850 13500 m - 14850 14490 l gs col0 s gr gr - +n 15525 13365 m + 15540 15105 l gs col0 s gr gr % arrowhead 30.000 slw -n 14730 13811 m 14850 14411 l 14970 13811 l 14850 13931 l 14730 13811 l - cp gs col7 1.00 shd ef gr col0 s +n 15650 13909 m 15526 13430 l 15410 13911 l 15650 13909 l cp gs col7 1.00 shd ef gr col0 s +% arrowhead +n 15415 14561 m 15539 15040 l 15655 14559 l 15415 14561 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -16152 13452 m 16248 13452 l 16320 14179 l 16200 14059 l 16080 14179 l cp +9048 12777 m 9048 12873 l 8455 12945 l 8455 12705 l cp eoclip -n 16200 14400 m - 16200 13500 l gs col0 s gr gr - +n 7380 12825 m + 9000 12825 l gs col0 s gr gr % arrowhead 30.000 slw -n 16320 14179 m 16200 13579 l 16080 14179 l 16200 14059 l 16320 14179 l - cp gs col7 1.00 shd ef gr col0 s +n 8455 12945 m 8935 12825 l 8455 12705 l 8455 12945 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -14802 10752 m 14898 10752 l 14970 11479 l 14850 11359 l 14730 11479 l cp +16512 18723 m 16512 18627 l 17105 18555 l 17105 18795 l cp +18453 18627 m 18453 18723 l 17860 18795 l 17860 18555 l cp eoclip -n 14850 12150 m - 14850 10800 l gs col0 s gr gr - +n 18405 18675 m + 16560 18675 l gs col0 s gr gr % arrowhead 30.000 slw -n 14970 11479 m 14850 10879 l 14730 11479 l 14850 11359 l 14970 11479 l - cp gs col7 1.00 shd ef gr col0 s +n 17860 18795 m 18340 18675 l 17860 18555 l 17860 18795 l cp gs col7 1.00 shd ef gr col0 s +% arrowhead +n 17105 18555 m 16625 18675 l 17105 18795 l 17105 18555 l cp gs col7 1.00 shd ef gr col0 s % Polyline 90.000 slw gs clippath -16248 12198 m 16152 12198 l 16080 11471 l 16200 11591 l 16320 11471 l cp +16512 15753 m 16512 15657 l 17105 15585 l 17105 15825 l cp +23088 15657 m 23088 15753 l 22495 15825 l 22495 15585 l cp eoclip -n 16200 10800 m - 16200 12150 l gs col0 s gr gr - +n 23040 15705 m + 16560 15705 l gs col11 s gr gr % arrowhead 30.000 slw -n 16080 11471 m 16200 12071 l 16320 11471 l 16200 11591 l 16080 11471 l - cp gs col7 1.00 shd ef gr col0 s +n 22495 15825 m 22975 15705 l 22495 15585 l 22495 15825 l cp gs col7 1.00 shd ef gr col11 s +% arrowhead +n 17105 15585 m 16625 15705 l 17105 15825 l 17105 15585 l cp gs col7 1.00 shd ef gr col11 s /Helvetica-iso ff 444.50 scf sf 14400 13050 m gs 1 -1 sc (Coordinator) col0 sh gr @@ -347,26 +306,29 @@ gs 1 -1 sc (Transaction) col0 sh gr 18900 13050 m gs 1 -1 sc (Transcript) col0 sh gr /Helvetica-iso ff 444.50 scf sf -14820 15360 m -gs 1 -1 sc (P2P) col0 sh gr -/Helvetica-iso ff 444.50 scf sf -14850 17820 m -gs 1 -1 sc (DART) col0 sh gr -/Helvetica-iso ff 444.50 scf sf -7290 16470 m -gs 1 -1 sc (HeartBeat) col0 sh gr -/Helvetica-iso ff 444.50 scf sf 19800 10350 m gs 1 -1 sc (Monitor) col0 sh gr /Helvetica-iso ff 444.50 scf sf -13500 10350 m -gs 1 -1 sc (ScriptingEngine) col0 sh gr -/Helvetica-iso ff 444.50 scf sf 9450 10350 m gs 1 -1 sc (Logger) col0 sh gr /Helvetica-iso ff 444.50 scf sf +14850 18855 m +gs 1 -1 sc (DART) col0 sh gr +/Helvetica-iso ff 444.50 scf sf +14790 15945 m +gs 1 -1 sc (P2P) col0 sh gr +/Helvetica-iso ff 444.50 scf sf +14850 9855 m +gs 1 -1 sc (TVM) col0 sh gr +/Helvetica-iso ff 444.50 scf sf +18765 18870 m +gs 1 -1 sc (Recorder) col0 sh gr +/Helvetica-iso ff 444.50 scf sf 5670 11610 m gs 1 -1 sc (Smart-contract) col0 sh gr +/Times-Roman-iso ff 508.00 scf sf +21780 15435 m +gs 1 -1 sc (Network) col0 sh gr % here ends figure; pagefooter showpage diff --git a/fig/node_service.fig b/fig/node_service.fig index 6fa2dc9..fe47683 100644 --- a/fig/node_service.fig +++ b/fig/node_service.fig @@ -1,4 +1,4 @@ -#FIG 3.2 Produced by xfig version 3.2.6a +#FIG 3.2 Produced by xfig version 3.2.7b Landscape Center Metric @@ -7,12 +7,11 @@ A4 Single -2 1200 2 -5 1 0 7 0 7 50 -1 -1 0.000 0 0 1 0 15706.323 13485.441 20250 13500 19350 16200 16740 17910 - 2 0 3.00 240.00 480.00 -5 1 0 7 0 7 50 -1 -1 0.000 0 0 1 0 14817.857 13894.898 14400 17280 12150 16020 11430 13500 - 2 0 3.00 240.00 480.00 -5 1 0 7 0 7 50 -1 -1 0.000 0 1 1 0 13580.327 12184.906 16650 17550 18810 15480 19620 13500 - 2 0 3.00 240.00 480.00 +5 1 0 7 0 7 50 -1 -1 0.000 0 1 1 1 12683.563 12885.448 16515 18090 18360 15975 19125 13410 + 1 0 3.00 240.00 480.00 + 1 0 3.00 240.00 480.00 +5 1 0 7 0 7 50 -1 -1 0.000 0 0 1 0 16592.143 13298.571 14445 18045 12150 16020 11385 13455 + 1 0 3.00 240.00 480.00 6 13500 11700 17550 13950 2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 17100 13500 13950 13500 13950 12150 17100 12150 17100 13500 @@ -24,8 +23,8 @@ Single 4 0 0 50 -1 4 28 0.0000 0 345 2430 9450 13050 Transaction\001 -6 6 5490 11880 7470 13410 -2 3 0 7 0 7 50 -1 -1 0.000 0 0 -1 0 0 6 - 6030 11970 5580 13320 6930 13320 7380 11970 6030 11970 6030 11970 +2 3 0 7 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6030 11970 5580 13320 6930 13320 7380 11970 6030 11970 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 6255 12195 6930 12195 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 @@ -44,61 +43,64 @@ Single 21600 13500 18450 13500 18450 12150 21600 12150 21600 13500 4 0 0 50 -1 4 28 0.0000 0 435 2070 18900 13050 Transcript\001 -6 -6 14340 14430 16650 15840 +6 18900 9000 22500 11250 2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 - 16620 15810 14370 15810 14370 14460 16620 14460 16620 15810 -4 0 0 50 -1 4 28 0.0000 0 345 885 14820 15360 P2P\001 + 22050 10800 19350 10800 19350 9450 22050 9450 22050 10800 +4 0 0 50 -1 4 28 0.0000 0 345 1545 19800 10350 Monitor\001 -6 -6 13950 16470 17100 18720 +6 8550 9000 11700 11250 2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 - 16650 18270 14400 18270 14400 16920 16650 16920 16650 18270 -4 0 0 50 -1 4 28 0.0000 0 345 1260 14850 17820 DART\001 + 11250 10800 9000 10800 9000 9450 11250 9450 11250 10800 +4 0 0 50 -1 4 28 0.0000 0 435 1425 9450 10350 Logger\001 -6 -6 6390 15120 10440 17370 -2 4 1 5 0 7 50 -1 -1 12.000 0 0 15 0 0 5 - 9990 16920 6840 16920 6840 15570 9990 15570 9990 16920 -4 0 0 50 -1 4 28 0.0000 0 345 2085 7290 16470 HeartBeat\001 +6 13950 17505 17100 19755 +2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 + 16650 19305 14400 19305 14400 17955 16650 17955 16650 19305 +4 0 0 50 -1 4 28 0.0000 0 345 1260 14850 18855 DART\001 -6 -6 18900 9000 22500 11250 +6 14310 15015 16620 16425 2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 - 22050 10800 19350 10800 19350 9450 22050 9450 22050 10800 -4 0 0 50 -1 4 28 0.0000 0 345 1545 19800 10350 Monitor\001 + 16590 16395 14340 16395 14340 15045 16590 15045 16590 16395 +4 0 0 50 -1 4 28 0.0000 0 345 885 14790 15945 P2P\001 -6 -6 12600 9000 18000 11250 +6 14220 8955 16920 10485 2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 - 17550 10800 13050 10800 13050 9450 17550 9450 17550 10800 -4 0 0 50 -1 4 28 0.0000 0 450 3255 13500 10350 ScriptingEngine\001 + 16830 10395 14310 10395 14310 9045 16830 9045 16830 10395 +4 0 0 50 -1 4 28 0.0000 0 345 990 14850 9855 TVM\001 -6 -6 8550 9000 11700 11250 +6 18285 17940 21495 19350 2 4 0 5 0 7 50 -1 -1 0.000 0 0 15 0 0 5 - 11250 10800 9000 10800 9000 9450 11250 9450 11250 10800 -4 0 0 50 -1 4 28 0.0000 0 450 1425 9450 10350 Logger\001 + 21465 19320 18315 19320 18315 17970 21465 17970 21465 19320 +4 0 0 50 -1 4 28 0.0000 0 345 1890 18765 18870 Recorder\001 -6 +2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 1 0 3.00 240.00 480.00 + 1 0 3.00 240.00 480.00 + 15570 10305 15570 12195 2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 12600 12825 13950 12825 -2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 7650 12825 9000 12825 -2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 17100 12780 18450 12780 -2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 15030 16920 15030 15840 -2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 15930 15840 15930 16920 -2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 14850 13500 14850 14490 -2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 16200 14400 16200 13500 + 1 0 3.00 240.00 480.00 + 12600 12825 13995 12825 2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 14850 12150 14850 10800 + 1 0 3.00 240.00 480.00 + 17100 12780 18540 12780 +2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 1 0 3.00 240.00 480.00 + 1 0 3.00 240.00 480.00 + 15525 16335 15540 18000 +2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 1 0 3.00 240.00 480.00 + 1 0 3.00 240.00 480.00 + 15525 13365 15540 15105 2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 2 0 3.00 240.00 480.00 - 16200 10800 16200 12150 + 1 0 3.00 240.00 480.00 + 7380 12825 9000 12825 +2 1 0 7 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 1 0 3.00 240.00 480.00 + 1 0 3.00 240.00 480.00 + 18405 18675 16560 18675 +2 1 0 7 11 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 1 0 3.00 240.00 480.00 + 1 0 3.00 240.00 480.00 + 23040 15705 16560 15705 4 0 0 50 -1 4 28 0.0000 0 345 3060 5670 11610 Smart-contract\001 +4 0 0 50 -1 0 32 0.0000 4 360 1890 21780 15435 Network\001 diff --git a/fig/wavefront_communication.eps b/fig/wavefront_communication.eps new file mode 100644 index 0000000..19978fe --- /dev/null +++ b/fig/wavefront_communication.eps @@ -0,0 +1,238 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: wavefront_communication.fig +%%Creator: fig2dev Version 3.2.7a +%%CreationDate: 2022-01-20 08:49:05 +%%BoundingBox: 0 0 660 667 +%%Magnification: 1.0000 +%%EndComments +%%BeginProlog +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def + +end + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/rl {rlineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/reencdict 12 dict def /ReEncode { reencdict begin +/newcodesandnames exch def /newfontname exch def /basefontname exch def +/basefontdict basefontname findfont def /newfont basefontdict maxlength dict def +basefontdict { exch dup /FID ne { dup /Encoding eq +{ exch dup length array copy newfont 3 1 roll put } +{ exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall +newfont /FontName newfontname put newcodesandnames aload pop +128 1 255 { newfont /Encoding get exch /.notdef put } for +newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat +newfontname newfont definefont pop end } def +/isovec [ +8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde +8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis +8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron +8#220 /dotlessi 8#230 /oe 8#231 /OE +8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling +8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis +8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot +8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus +8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph +8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine +8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf +8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute +8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring +8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute +8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute +8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve +8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply +8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex +8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave +8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring +8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute +8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute +8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve +8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide +8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex +8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def +/Times-Roman /Times-Roman-iso isovec ReEncode +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +/pageheader { +sa +n 0 667 m 0 0 l 660 0 l 660 667 l cp clip +-57.9 800.6 tr +1 -1 sc +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06299 0.06299 sc +} bind def +/pagefooter { +$F2psEnd +restore +} bind def +%%EndProlog +pageheader +% +% Fig objects follow +% +% +% here starts figure with depth 50 +% Polyline +0 slj +0 slc +30.000 slw +n 3600 3825 m 3795 3713 l 3795 3487 l 3600 3375 l 3405 3488 l 3405 3713 l + + cp gs col1 s gr % Polyline +n 8355 3825 m 8550 3713 l 8550 3487 l 8355 3375 l 8160 3488 l 8160 3713 l + + cp gs col1 s gr % Polyline +45.000 slw +gs clippath +8161 7307 m 8138 7352 l 7807 7253 l 7902 7201 l 7890 7094 l cp +eoclip +n 3825 5085 m + 8127 7318 l gs col0 s gr gr +% arrowhead +7.500 slw +n 7807 7253 m 8115 7312 l 7890 7094 l 7902 7201 l 7807 7253 l + cp gs col7 1.00 shd ef gr col0 s +n 7807 7253 m 8115 7312 l 7902 7201 l gs 0.00 setgray ef gr % Polyline +45.000 slw +gs clippath +3810 9833 m 3787 9788 l 4058 9575 l 4046 9682 l 4141 9734 l cp +eoclip +n 8103 7574 m + 3821 9799 l gs col0 s gr gr +% arrowhead +7.500 slw +n 4058 9575 m 3833 9793 l 4141 9734 l 4046 9682 l 4058 9575 l + cp gs col7 1.00 shd ef gr col0 s +n 4058 9575 m 3833 9793 l 4046 9682 l gs 0.00 setgray ef gr % Polyline +45.000 slw +gs clippath +3626 4751 m 3575 4751 l 3510 4411 l 3600 4471 l 3690 4411 l cp +eoclip +n 3600 3825 m + 3600 4725 l gs col4 s gr gr +% arrowhead +7.500 slw +n 3510 4411 m 3600 4711 l 3690 4411 l 3600 4471 l 3510 4411 l + cp gs col7 1.00 shd ef gr col4 s +n 3510 4411 m 3600 4711 l 3600 4471 l gs col4 1.00 shd ef gr % Polyline +45.000 slw +gs clippath +8169 12232 m 8146 12277 l 7816 12175 l 7911 12124 l 7901 12016 l cp +eoclip +n 3844 9956 m + 8135 12243 l gs col0 s gr gr +% arrowhead +7.500 slw +n 7816 12175 m 8123 12237 l 7901 12016 l 7911 12124 l 7816 12175 l + cp gs col7 1.00 shd ef gr col0 s +n 7816 12175 m 8123 12237 l 7911 12124 l gs 0.00 setgray ef gr % Polyline +30.000 slw +n 8325 7650 m 8520 7538 l 8520 7312 l 8325 7200 l 8130 7313 l 8130 7538 l + + cp gs col1 s gr % Polyline +n 8325 12600 m 8520 12488 l 8520 12262 l 8325 12150 l 8130 12263 l 8130 12488 l + + cp gs col1 s gr % Polyline +n 3600 10125 m 3795 10013 l 3795 9787 l 3600 9675 l 3405 9788 l 3405 10013 l + + cp gs col1 s gr % Polyline +n 3600 5175 m 3795 5063 l 3795 4837 l 3600 4725 l 3405 4838 l 3405 5063 l + + cp gs col1 s gr /Times-Roman-iso ff 317.50 scf sf +8325 3150 m +gs 1 -1 sc 90.0 rot (Node 4) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +3825 3150 m +gs 1 -1 sc 90.0 rot (Node 1) col0 sh gr +/Times-Roman-iso ff 238.13 scf sf +3735 4185 m +gs 1 -1 sc (Initiate a Gossip from Node 1 to 4) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +8775 3600 m +gs 1 -1 sc (Idle State) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +3150 3600 m +gs 1 -1 sc (Idle State) dup sw pop neg 0 rm col0 sh gr +/Times-Roman-iso ff 190.50 scf sf +4185 5670 m +gs 1 -1 sc 332.0 rot (1,b5) col0 sh gr +/Times-Roman-iso ff 190.50 scf sf +5220 9630 m +gs 1 -1 sc 28.0 rot (1,e5) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +6435 8325 m +gs 1 -1 sc 28.0 rot (Frist-wave) dup sw pop neg 0 rm col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +6750 11385 m +gs 1 -1 sc 332.0 rot (Second-wave) dup sw pop neg 0 rm col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +4005 5535 m +gs 1 -1 sc 332.0 rot (W =[-3, -2, 1, -2, 0, 2]) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +4905 10125 m +gs 1 -1 sc 28.0 rot (events : {e3, e4, e5, f3, f4}) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +3735 10305 m +gs 1 -1 sc 332.0 rot (events : {a1, b1, b2, b4, b5, c2, c3}) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +8775 12375 m +gs 1 -1 sc (Second-wave State) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +3150 9900 m +gs 1 -1 sc (First-wave State) dup sw pop neg 0 rm col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +3150 4950 m +gs 1 -1 sc (Initial State) dup sw pop neg 0 rm col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +8775 7425 m +gs 1 -1 sc (Tidal-wave State) col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +6300 6210 m +gs 1 -1 sc 334.0 rot (Tidal-wave) dup sw pop neg 0 rm col0 sh gr +/Times-Roman-iso ff 317.50 scf sf +4950 9630 m +gs 1 -1 sc 28.0 rot (W =[-4, -6, -1, 3, 4]) col0 sh gr +% here ends figure; +pagefooter +showpage +%%Trailer +%EOF diff --git a/fig/wavefront_communication.fig b/fig/wavefront_communication.fig index 31ec2f1..11ba046 100644 --- a/fig/wavefront_communication.fig +++ b/fig/wavefront_communication.fig @@ -1,4 +1,4 @@ -#FIG 3.2 Produced by xfig version 3.2.6a +#FIG 3.2 Produced by xfig version 3.2.7b Landscape Center Metric @@ -39,10 +39,9 @@ Single 3600 5175 4 0 0 50 -1 0 20 1.5708 4 225 975 8325 3150 Node 4\001 4 0 0 50 -1 0 20 1.5708 4 225 975 3825 3150 Node 1\001 -4 0 0 50 -1 0 15 0.0000 4 240 3600 3735 4185 Initiate a Gossip from Node 1 to 4\001 +4 0 0 50 -1 0 15 0.0000 4 225 3360 3735 4185 Initiate a Gossip from Node 1 to 4\001 4 0 0 50 -1 0 20 0.0000 4 225 1260 8775 3600 Idle State\001 4 2 0 50 -1 0 20 0.0000 4 225 1260 3150 3600 Idle State\001 -4 0 0 50 -1 0 20 0.4887 4 285 3180 4950 9630 W =[-4, -6, 1, -2, 3, 4]\001 4 0 0 50 -1 0 12 5.7945 4 165 360 4185 5670 1,b5\001 4 0 0 50 -1 0 12 0.4887 4 165 345 5220 9630 1,e5\001 4 2 0 50 -1 0 20 0.4887 4 225 1410 6435 8325 Frist-wave\001 @@ -55,3 +54,4 @@ Single 4 2 0 50 -1 0 20 0.0000 4 225 1530 3150 4950 Initial State\001 4 0 0 50 -1 0 20 0.0000 4 225 2265 8775 7425 Tidal-wave State\001 4 2 0 50 -1 0 20 5.8294 4 225 1515 6300 6210 Tidal-wave\001 +4 0 0 50 -1 0 20 0.4887 4 300 2835 4950 9630 W =[-4, -6, -1, 3, 4]\001 diff --git a/hashgraph.tex b/hashgraph.tex index 35de798..9b67613 100644 --- a/hashgraph.tex +++ b/hashgraph.tex @@ -1,28 +1,23 @@ -\section{Hashgraph Consensus Mechanism} \label{sec:hashgraph_cm} +\section{Hashgraph Consensus Mechanism} +\label{sec:hashgraph_cm} The Tagion network is based around a Hashgraph consensus algorithm and mathematical proof discovered by Leemon Baird \cite{SWIRLDS_HASHGRAPH}. This algorithm solves the Byzantine Generals’ Problem of generating a consensus order list of actions between distributed computer nodes connected in a network. If more than 2/3 of the nodes follows the same consensus rules, all the nodes will, in finite time, reach the same order of events. The network distributes the information via a gossip protocol, sending information about the data received from the other nodes in the network. All the nodes solving the Hashgraph algorithm will come to the same order of transactions. -Figure 1 below shows a Hashgraph of gossip information representing the information flow between network nodes. In finite time all nodes in the network will be able to build the same Hashgraph of gossip information. - - +In \cref{fig:wavefront} below shows a Hashgraph of gossip information representing the information flow between network nodes. In finite time all nodes in the network will be able to build the same Hashgraph of gossip information. \begin{figure}[ht] \centering % Replace this when we get the wavefront in \includegraphics[width=0.7\textwidth]{fig/wavefront_and_order_long.eps} % \includegraphics[width=0.45\textwidth]{fig/wavefront_and_order_small_no_alt.eps} % wavefront_and_order.eps: 3358x4625 px, 300dpi, 28.43x39.16 cm, bb=0 0 806 1110 - %\caption{Hashgraph with altitude(A) and parameter $\Omega$} - \caption{Hashgraph with parameter $\Omega$} + \caption{Hashgraph with altitude(A) and order parameter $\Omega$} \label{fig:wavefront} \end{figure} % Hashgraph with altitude (A) order parameter Ω is shown. Each vertical line represents a compute node and each circle an event. The line between the events represents the communication of the events between the nodes. The events coloured red define a witness that is used to divide the consensus into rounds. Each round decides a list of events to be collected. This list of events is called an epoch and must be sorted into the same order as all other nodes. The description of the Hashgraph algorithm can be found in \cite{SWIRLDS_HASHGRAPH}. - -% We take this out for now because of patent issues \pagebreak - \input{wavefront} \pagebreak diff --git a/hibon.tex b/hibon.tex index 902d91d..03137d5 100644 --- a/hibon.tex +++ b/hibon.tex @@ -5,65 +5,84 @@ \section{HiBON Data format} \lstset{language=c++, numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt, tabsize=4}%, \begin{lstlisting} -@safe -bool less_than(string a, string b) pure - in { - assert(a.length > 0); - assert(b.length > 0); - } -body { - static bool is_index(string a, out uint result) pure { - import std.conv : to; - enum MAX_UINT_SIZE=to!string(uint.max).length; - if ( a.length <= MAX_UINT_SIZE ) { - if ( a[0] == '0' ) { - return false; - } - foreach(c; a[1..$]) { - if ( (c < '0') || (c > '9') ) { - return false; - } - } - immutable number=a.to!ulong; - if ( number <= uint.max ) { - result = cast(uint)number; - return true; - } - } - return false; - } - uint a_index; - uint b_index; - if ( is_index(a, a_index) && is_index(b, b_index) ) { - return a_index < b_index; - } - return a < b; +/** +This function decides the order of the HiBON keys +Returns: +true if the value of key a is less than the value of key b +*/ +@safe @nogc bool less_than(string a, string b) pure nothrow + in { + assert(a.length > 0); + assert(b.length > 0); + } + do { + uint a_index; + uint b_index; + if (is_index(a, a_index) && is_index(b, b_index)) { + return a_index < b_index; + } + return a < b; + } + +/** +Converts from a text to a index +Params: +a = the string to be converted to an index +result = index value +Returns: +true if a is an index +*/ +@safe @nogc bool is_index(const(char[]) a, out uint result) pure nothrow { + import std.conv: to; + + enum MAX_UINT_SIZE = to!string(uint.max).length; + @nogc @safe static ulong to_ulong(const(char[]) a) pure nothrow { + ulong result; + foreach (c; a) { + result *= 10; + result += (c - '0'); + } + return result; + } + + if (a.length <= MAX_UINT_SIZE) { + if ((a[0] is '0') && (a.length > 1)) { + return false; + } + foreach (c; a) { + if ((c < '0') || (c > '9')) { + return false; + } + } + immutable number = to_ulong(a); + if (number <= uint.max) { + result = cast(uint) number; + return true; + } + } + return false; } \end{lstlisting} Only printable ASCII keys are allowed to be used as keys in the HiBON; this means no control characters or special characters allowed. The key is validated accordingly to the function described below. \begin{lstlisting} -@safe bool is_key_valid(string a) pure nothrow { - enum : char { - SPACE = 0x20, - DEL = 0x7F, - DOUBLE_QUOTE = 34, - QUOTE = 39, - BACK_QUOTE = 0x60 - } - if ( a.length > 0 ) { - foreach(c; a) { - // Chars between SPACE and DEL is valid - // except for " ' ` is not valid - if ( (c <= SPACE) || (c >= DEL) || - ( c == DOUBLE_QUOTE ) || ( c == QUOTE ) || - ( c == BACK_QUOTE ) ) { - return false; - } - } - return true; - } - return false; +/** +Checks if the keys in the range is ordred +Returns: +ture if all keys in the range is ordered +*/ +@safe bool is_key_ordered(R)(R range) if (isInputRange!R) { + string prev_key; + while (!range.empty) { + if ((prev_key.length == 0) || (less_than(prev_key, range.front))) { + prev_key = range.front; + range.popFront; + } + else { + return false; + } + } + return true; } \end{lstlisting} @@ -72,8 +91,8 @@ \section{HiBON Data format} Any data types which are not defined in \cref{tab:hibon} are illegal and must be rejected by the network. The types used in the table are primarily the types used in D except for a few as \texttt{\{\}} and \texttt{[]}. -\subsection{HRPC – HiBON Remote Procedure Call} -HRPC works like JSON-RPC just with signed binary data, the above-defined HiBON format. It means the data is hash-invariant enabling hash- and signature functions to be executed quickly and unambiguously. +\subsection{HiRPC – HiBON Remote Procedure Call} +\abbrev{HiRPC}{Hash invariant Remote Procedure Call} works like JSON-RPC just with signed binary data, the above-defined HiBON format. It means the data is hash-invariant enabling hash- and signature functions to be executed quickly and unambiguously. \begin{table}[H] \begin{center} @@ -81,18 +100,18 @@ \subsection{HRPC – HiBON Remote Procedure Call} \hline Parameter & Description & Type & Access \\ \hline - $\$type$ & Set contract type to 'HRPC' & \texttt{string} & \texttt{ro} \\ + $\$type$ & Set contract type to 'HiRPC' & \texttt{string} & \texttt{ro} \\ \hline $\$pkey$ & Public key & \texttt{bin} & \texttt{ro} \\ \hline $\$sign$ & Signature of $\$msg$ & \texttt{bin} & \texttt{ro} \\ \hline - $\$msg$ & Message object \cref{tab:HRPC_method_message}, \cref{tab:HRPC_success_message}, \cref{tab:HRPC_error_message} & \texttt{\{\}} & \texttt{ro} \\ + $\$msg$ & Message object \cref{tab:HiRPC_method_message}, \cref{tab:HiRPC_success_message}, \cref{tab:HiRPC_error_message} & \texttt{\{\}} & \texttt{ro} \\ \hline \end{tabular} \end{center} -\caption{HRPC format} -\label{tab:HRPC_format} +\caption{HiRPC format} +\label{tab:HiRPC_format} \end{table} \begin{table}[H] @@ -109,8 +128,8 @@ \subsection{HRPC – HiBON Remote Procedure Call} \hline \end{tabular} \end{center} -\caption{HRPC method message object} -\label{tab:HRPC_method_message} +\caption{HiRPC method message object} +\label{tab:HiRPC_method_message} \end{table} \begin{table}[H] @@ -125,8 +144,8 @@ \subsection{HRPC – HiBON Remote Procedure Call} \hline \end{tabular} \end{center} -\caption{HRPC success message object } -\label{tab:HRPC_success_message} +\caption{HiRPC success message object } +\label{tab:HiRPC_success_message} \end{table} \begin{table}[H] @@ -137,12 +156,12 @@ \subsection{HRPC – HiBON Remote Procedure Call} \hline $\$id$ & Message id & \texttt{string} & \texttt{ro} \\ \hline - $\$msg$ & Error object \cref{tab:HRPC_error} & \texttt{\{\}} & \texttt{ro} \\ + $\$msg$ & Error object \cref{tab:HiRPC_error} & \texttt{\{\}} & \texttt{ro} \\ \hline \end{tabular} \end{center} -\caption{HPPC error response object } -\label{tab:HRPC_error_message} +\caption{HiPPC error response object } +\label{tab:HiRPC_error_message} \end{table} @@ -152,7 +171,7 @@ \subsection{HRPC – HiBON Remote Procedure Call} \hline Parameter & Description & Type & Access \\ \hline - $\$code$ & Set contract type to 'HRPC' & \texttt{uint} & \texttt{ro} \\ + $\$code$ & Set contract type to 'HiRPC' & \texttt{uint} & \texttt{ro} \\ \hline $\$msg$ & Error message & \texttt{string} & \texttt{ro} \\ \hline @@ -160,6 +179,6 @@ \subsection{HRPC – HiBON Remote Procedure Call} \hline \end{tabular} \end{center} -\caption{HRPC error object } -\label{tab:HRPC_error} +\caption{HiRPC error object } +\label{tab:HiRPC_error} \end{table} diff --git a/introduction.tex b/introduction.tex new file mode 100644 index 0000000..ceb3842 --- /dev/null +++ b/introduction.tex @@ -0,0 +1,180 @@ +\section{Introduction} +This document describes the Tagion core network.\\ +The Tagion core network includes a byzantine consensus algorithm, a distributed database (DART) with consensus and description of node validators and the basic node selections. +\subsection{Network Architecture} \label{sec:network_architecture} +The Tagion network architecture consist of a collections of computer nodes which are able to send messages between each other (A \bfit{computer node} is named \bfit{node} in this document). Each node can send a message to any other node in the network. + +The nodes in the network has different roles and the nodes will change roles over the lifetime depended controlled by the Tagion consensus rules. + +The node roles are: +\begin{itemize} + \item[\bfit{Active Node}] A Node in this role category takes care of the validations and consensus. + \item[\bfit{Standby Node}] A node waiting to be selected as an active node. + \item[\bfit{Swap Node}] A node selected to become an active node waiting to be swapped with an \bfit{Active Node}. + \item[\bfit{Prospect Node}] A node in this category is waiting to become and 'real' node in the network. + \label{tab:node_roles} +\end{itemize} + +All the nodes communicates via protocol call libp2p \cite{libp2p}. The role of the node actors are selected randomly (\bfit{UDR} \cref{sec:SMT}) according to the node consensus selection rules \cref{sec:mutation}. + +\begin{figure}[H] + \centering + \includegraphics[width=0.8\textwidth]{fig/network_architecture.eps} + % dart_bw.eps: 17766x12625 px, 300dpi, 150.42x106.89 cm, bb=0 0 4264 3030 + \caption{The Network Architecture} + + \label{fig:network_architecture} +\end{figure} + +The \bfit{Active Node}'s validates a transaction and use the Hashgraph algorithm \cref{sec:hashgraph_cm} to reach consensus. The Hashgraph algorithm is capable of producing a consensus ordered list of transaction (Defined as \bfit{transaction list}). This means that all the \bfit{Active Node}'s will produces the same order of transactions.\\ +The transaction list is execution in the consensus order \cref{sec:network}. + +\subsection{Network security} + +The Hashgraph algorithm is asynchronous byzantine fault tolerant meaning that if more than 2/3 of the actors are not evil (following protocol) then the network will reach consensus. If more than 1/3 and less than 2/3 of the network actors are not evil, then the network cannot reach consensus. If more than 2/3 then the network has been taken over meaning new protocols has been enforced by the majority potentially destroying data integrity. + +The mechanical node swapping described in \cref{sec:network_architecture} describes this swapping of nodes, which is \bfit{UDR} random. Static calculation based on different number of Active and Available Nodes are available. +The probability of an coordinated attack to take over the network can be estimated from \cref{sec:network}.\\ + +Different censorious for an attack probability has been estimated in the calculation show in \cref{tab:network_attack}. +The probability numbers in column "Halt" represents the probability of the network to halt/slowdown and the column "Take-over" represents the probability for that the Evil nodes can coordinate an attack. +From numbers it can be seen that the network get more robust against attack when the ration between total nodes and evil and active nodes. + +\begin{table}[H] + \begin{center} + \begin{tabular}{|p{2.2cm}|p{2.2cm}|p{2.4cm}|p{2.4cm}|p{2.4cm}|} + \hline + Active Nodes $N$ & Evil Nodes $E$ & Total Nodes $M$ & Halt $p_{1/3}$ & Take-over $p_{2/3}$ \\ + \hline + 31 & 31 & 101 & $0.23$ & $1.7 \cdot 10^{-7}$ \\ + \hline + 31 & 31 & 301 & $4.5 \cdot 10^{-5}$ & $1.2 \cdot 10^{-17}$ \\ + \hline + 31 & 31 & 501 & $2.8 \cdot 10^{-7}$ & $2.5 \cdot 10^{-17}$ \\ + \hline + 37 & 31 & 101 & $0.2 $ & $1.4 \cdot 10^{-9}$ \\ + \hline + 43 & 31 & 101 & $0.21 $ & $1.4 \cdot 10^{-12}$ \\ + \hline + 43 & 31 & 301 & $1.1 \cdot 10^{-6} $ & $1.5 \cdot 10^{-27}$ \\ + \hline + 43 & 31 & 501 & $1.1 \cdot 10^{-10} $ & $3.5 \cdot 10^{-34}$ \\ + \hline + 31 & 43 & 501 & $1.2 \cdot 10^{-5} $ & $4.5 \cdot 10^{-18}$ \\ + \hline + 31 & 61 & 501 & $3.9 \cdot 10^{-4} $ & $3.8 \cdot 10^{-14}$ \\ + \hline + 31 & 61 & 1001 & $5.4 \cdot 10^{-7} $ & $2.1 \cdot 10^{-20}$ \\ + \hline + 31 & 61 & 10001 & $1.2 \cdot 10^{-17} $ & $2.6 \cdot 10^{-41}$ \\ + \hline + \end{tabular} + \end{center} + \caption{Probability of an attack versus nodes} + \label{tab:network_attack} +\end{table} + +\subsection{Node Architecture} +The node core program is implemented in the programming language D with some C and Go libraries for crypto, network and virtual engine functions. It is structured, as shown in the figure below. + +\begin{table}[H] + {% + \newcommand{\mc}[2]{\multicolumn{#1}{#2}} + \begin{center} + \begin{tabular}{|c|c|} + \hline + \mc{2}{|c|}{HiRPC (HiBON) Dataformat for communication}\\ + \hline + \mc{2}{|c|}{NODE}\\ + \hline + User API - TLS 1.2 & P2P Network\\ + \hline + \mc{2}{|c|}{Tagion Virtual Machine}\\ + \hline + \mc{2}{|c|}{Consensus mechanism : Hashgraph}\\ + \hline + \mc{2}{|c|}{Storage : Distributed Database DART }\\ + \hline + \mc{2}{|c|}{Blockchain : Epoch Records} \\ + \hline + \end{tabular} + \end{center} + }% + \caption{Tagion Node stack} + \label{tab:node_stack} +\end{table} + + +A Tagion Node is divided into units as shown in \cref{fig:node_service} and each unit handles a service function in the following manner: + +A smart-contract is sent to the Transaction-service-unit which are fetching the inputs date form the distributed Data-base DART unit (see \cref{sec:DART}) and verifying their signatures of the inputs. The DART-unit connects to other DARTs via the P2P-unit. The transaction-unit forwards the smart-contract to the Coordinator-unit and this information is gossiped to the network via the P2P-unit. +When the Coordinator receives an event with a smart-contract, the smart-contract contract is verified and executed via the \abbrev{TVM}{Tagion Virtual Machine} unit, and the results of the outputs are verified.\\ +The Coordinator adds it to an event in the Hashgraph and gossips the informations via the P2P-unit to other nodes in the network. +When the Coordinator finds an epoch, it make a list of ordered transactions and forwards this list to the Transcript-service-unit. The transcript-unit executes the smart-contracts in order and produces list called an Recorder. A Recorder contains list of DART instructs where the inputs will be removed and outputs added. The Coordinator sends the Recorder to the DART-uint which executes this list. The DART-unit forwards the Recorder to the Recorder-unit and the Recorder adds this to a block-chain.\\ +In the case where network does not reach consensus, the Coordinator will send an undo-instruction to the Recorder-unit.\\ +If the Recorder-unit receives an undo-instruction the recorder will send the undo-Recorder-list to the DART-unit and the DART-unit will perform this action and put the DART in the previous state before the last Epoch. +An undo-Recorder-list is defined a Recorder where the order is reversed and the (remove/add) instructions is inverted to (add/remove). + +The Logger-unit and the Monitor-unit used for debugging and monitoring the network. + +\begin{figure}[H] + \centering + \includegraphics[width=0.8\textwidth]{fig/node_service.eps} + % dart_bw.eps: 17766x12625 px, 300dpi, 150.42x106.89 cm, bb=0 0 4264 3030 + \caption{The Tagion Node Architure} + \label{fig:node_service} +\end{figure} + + +Each of the services is running as independent tasks and communication between each-other via commutation channels. The different services modules perform the service as described in the list below. + +\begin{itemize} + \item[\bfit{Coordinator}] This service manages the hashgraph-consensus and controls other related service for the node. + The Coordinator generates and receives events and relays to the network. This service also generates the epoch and sends the information to the TVM services. + \item[\bfit{Transaction}] This service receives the incoming transaction script, validates, verifies and fetches the data from the DART and sends the information to the Coordinator. + \item[\bfit{DART}] Services to the Distributed-database + \item[\bfit{P2P}] This service handles the peer-to-peer communication protocol used to communicate between the nodes + \item[\bfit{TVM}] Handles the executions of the smart contracts + \item[\bfit{Transcript}] Services the Epoch and orders the smart-contract execution + \item[\bfit{Recorder}] This services recorder this history of the DART. + \item[\bfit{Logger}] The service handles information logging for the different services + \item[\bfit{Monitor}] The Monitor service is used to graphical the activities. +\end{itemize} + + +Estimated bandwidth requirement and the average propagation for a transaction the formulas in \cref{sec:gossip_model}. + +From simple experimental model result. + +Example for a network with nodes $N=11$ an event size of $E_{size}=500bytes$ and network delay of $t_{net}=300ms$ the estimated epoch propagation delay +and the bandwidth of: +\begin{align*} +n_{round} &= 2.2 \cdot ln(11) &\approx 5.27\\ +t_{epoch} &= 3.5 \cdot n_{round} \cdot 300ms & \approx 5.5s \\ +B &= 500bytes \cdot 11^2 & \approx 60.5kbytes \\ +BW &= 8 \cdot B / (n_{round}\cdot 300ms) &\approx 28kbit/s \\ +\end{align*} +And with $N=31$: +\begin{align*} +n_{round} &= 2.2 \cdot ln(31) & \approx 8.6\\ +t_{epoch} &= 3.5 \cdot n_{round} \cdot 300ms & \approx 8s \\ +B &= 500bytes \cdot 31^2 & \approx 481kbytes \\ +BW &= 8 \cdot B / (n_{round}\cdot 300ms) &\approx 152kbit/s \\ +\end{align*} +And with $N=101$: +\begin{align*} +n_{round} &= 2.2 \cdot ln(101) & \approx 10.15\\ +t_{epoch} &= 3.5 \cdot n_{round} \cdot 300ms & \approx 10.6s \\ +B &= 500bytes \cdot 101^2 & \approx 5.1Mbytes \\ +BW &= 8 \cdot B / (n_{round}\cdot 300ms) & \approx 1.2Mbit/s \\ +\end{align*} +And with $N=1001$: +\begin{align*} +n_{round} &= 2.2 \cdot ln(1001) & \approx 15\\ +t_{epoch} &= 3.5 \cdot n_{round} \cdot 300ms & \approx 16s \\ +B &= 500bytes \cdot 1001^2 & \approx 501Mbytes \\ +BW &= 8 \cdot B / (n_{round}\cdot 300ms) &\approx 80Mbit/s \\ +\end{align*} + +In this example the epoch delay increases round 5s when $N$ is increased by a decade and the bandwidth requirement is increased around 50 times or more. + diff --git a/keypairgeneration.tex b/keypairgeneration.tex new file mode 100644 index 0000000..4c8090e --- /dev/null +++ b/keypairgeneration.tex @@ -0,0 +1,69 @@ +\section{No central key-pair re-generation} + +Idea to recover key-pair from lost password. +When key-pair is generated the first time the key owner will answer a number of questions. If we have $N$ number of questions $q_k$ and related to $a_k$ answers. +A seed hash $R$ of a random number is generated which will be used as the seed key for the private key. +A new seed $Y_a$ can be generated \footnote{The operator $\otimes$ represents bit exclusive or operator} from $R$ and a list of answers hashes of answers. + + + +%\begin{equation} +\begin{align} + A_i = H(H(a_i)||H(q_i)) \\ + Y_a = R \otimes H( A'_a ) + \end{align} +%\end{equation} +The seed hash $R$ can be regenerated if all the values of $A$ is available. +\begin{equation} +R = Y_a \otimes H( A'_a ) +\end{equation} +Accumulated exclusive or (excluding the a'th element) is define as: +\begin{align} +A'_a = \sum^{\otimes}_{i \neq a}{A_i} +\end{align} +Example: +\begin{align} +A'_2 = \sum^{\otimes}_{i \neq 2}{A_i} = A_0 \otimes A_1 \otimes A_3 ... +\end{align} + + + +If the password recovery values $Y$ and the questions $q_k$ is stored so that the owner can access those value, which is now named recovery service. +The owner creates a passphrase $p$ for this a new a seed phrase is generated. + +%\begin{equation} + \begin{align} + P_u = H(U \parallel H(p)) \\ + Y_u = R \otimes P_u \otimes D_u \\ + R = Y_u \otimes P_u \otimes D_u + \end{align} +%\end{equation} + +To obfuscate the passphrase a hash $U$ of a random number and a device seed $D_u$ stored on the local device. This will scramble a simple password and the value $Y_u$ is stored in the recovery service. + +If the key-pair owner forgets the password $p$ then the owner can request the questions $q_k$ from the recovery service and generated the value $A$ and drive the value $R$. This can be done without been connected to the server. + +To validate that the $R$ is correct a hash $S$ of $R$ are is stored on the recovery server. + +%\begin{equation} + \begin{align} + S = H(R) + \end{align} +%\end{equation} + +A set of questions can be generated to together with a set of answers and a list of corresponding seed Y can be generated. This way the owner only need to answer $M$ out of $N$ questions and by comparing the hash of $R$ the with the compilation of $A$ and $Y$ values the right combination can be found. + +The number of Y values need is: + +\begin{equation} + N_Y = (M-N) \cdot N + 1 +\end{equation} + +Ex. If $M=10$ and $N=5$ will result in a $N_Y$ of $26$.\\ + + +Of cause it's not recommend to have a high ration between $M$ and $N$ because this can lead to high probability of guessing $R$. + + + + diff --git a/mutation_rules.tex b/mutation_rules.tex index 777b940..6c31108 100644 --- a/mutation_rules.tex +++ b/mutation_rules.tex @@ -1,4 +1,4 @@ -\section{Mutation rules} +\section{Mutation rules}\label{sec:mutation} In this sections the algorithm of bill gene mutations is described. diff --git a/name_card.tex b/name_card.tex index b2e8cc1..69eb29a 100644 --- a/name_card.tex +++ b/name_card.tex @@ -18,7 +18,7 @@ \subsection{Name card contract} \label{sec:name_card_contract} \hline Parameter & Description & Type & Access \\ \hline - $\$type$ & Set contract type to 'NCL' & \texttt{string} & \texttt{ro} \\ + $\$@$ & Set contract type to 'NNC' & \texttt{string} & \texttt{ro} \\ \hline $\#name$ & Name of the name-card & \texttt{string} & \texttt{ro} \\ \hline @@ -38,13 +38,14 @@ \subsection{Name card contract} \label{sec:name_card_contract} \label{tab:ncl} \end{table} + \begin{table}[H] \begin{center} \begin{tabular}{|l|p{7cm}|p{1.5cm}|l|} \hline Parameter & Description & Type & Access \\ \hline - $\$type$ & Sets the contract type to 'NCR' & \texttt{string} & \texttt{ro} \\ + $\$@$ & Sets the contract type to 'NCR' & \texttt{string} & \texttt{ro} \\ \hline $\$name$ & Hash value of the $NCR.\$name$ & \texttt{ubyte[]} & \texttt{ro} \\ \hline diff --git a/network.tex b/network.tex index 1102550..95034ff 100644 --- a/network.tex +++ b/network.tex @@ -1,4 +1,4 @@ -\section{Network} +\section{Network}\label{sec:network} The following steps are executed in the network for a standard transaction: \begin{enumerate} \item diff --git a/network_security.tex b/network_security.tex index 2654962..f832445 100644 --- a/network_security.tex +++ b/network_security.tex @@ -24,7 +24,8 @@ \section{Network Security} The calculated scenario is based on all the $N$ nodes being changed at every epoch. In the real network, this is not the case; only one node is swapped out and in at every $100$ epoch. Thus the probability of an evil takeover is significantly lower than this calculation. The model is chosen because it is easy to express mathematically. -The active nodes are selected randomly from $M$, and the probability that the evil attacker controls the first selected node is: +The active nodes are selected randomly from $M$, and the probability that the evil attacker controls the first selected node is:\\ + Definition of permutation formula: \begin{equation} P(n,r) = \frac{n!}{(n-r)!} @@ -45,8 +46,9 @@ \section{Network Security} \begin{equation} p_{E_n} = \frac{E-n}{M-n} \end{equation} - - +\begin{equation} +p_{G_{n,e}} = 1-\frac{E-e}{M-n} +\end{equation} The probability of constructing an evil network\\ In this section, the probability of constructing an evil network is calculated.\\ The network is randomly constructed by selecting $N$ nodes out of $M$ nodes where $E$ nodes are evil.\\ @@ -54,74 +56,84 @@ \section{Network Security} The probability that $n_E$ nodes out of $N$ nodes are: \begin{equation} - p_{E_n} = \left. \prod_{i=0}^{n_E-1}{p_{E_i}} \cdot \prod_{i=n_E}^{N_E}{(1-p_{E_i}) \cdot C(N,n_E)} \right| _{N_E = min(E,N)} + p_{n_E} \leq \left. \prod_{i=0}^{n_E-1}{p_{E_i}} \cdot + \prod_{i=n_E}^{N_E} + {p_{G_{i,n_E}} \cdot C(N,n_E)} \right| _{N_E = min(E,N)} \end{equation} If $M \gg n_E$ and $E \gg n_E$ the probability can be approximated to: \begin{equation} - p_{n_E} \approx p_{E_0}^{n_E} \cdot (1-p_{E_0})^{N-n_E} \cdot C(N,n_E) ~ \text{for} ~ \frac{E}{M} \approx \frac{E-n_E}{M-n_E} + p_{n_E} \approx p_{E_0}^{n_E} \cdot (1-p_{E_0})^{N-n_E} \cdot C(N,n_E) ~ \text{for} ~ \frac{E-n_E}{M} \approx \frac{E-n_E}{M-n_E} \end{equation} The probability that $n_E$ nodes or more are: \begin{equation} - p_{n>n_E} = \left. \sum_{i=N_E}{n_E}{p_i \cdot C(N,i)} \right|_{N_E = min(E,N)} + p_{n>n_E} = \left. \sum_{i=n_E}^{N_E}{p_{iE} } \right|_{N_E = min(E,N)} \end{equation} Example if $N=100$ and $M=1000$ and the attacker has $E$ nodes, the probability that the attacker can prevent the network from reaching a consensus is: \begin{align*} - M &= 200 & M &= 1000 & M &= 10000 \\ - N &= 60 & N &= 100 & N &= 100 \\ - E &= 60 & E &= 100 & E &= 500 \\ - n_E &= 21 & n_E &= 34 & n_E &= 34 \\ - p_{n \ge 20 } &= 0.199261 & p_{n \ge 34} &= 1.62609 \cdot 10^{-12} & p_{n \ge 34} &= 5.24507 \cdot 10^{-20} -\end{align*} + M &= 31 & M &= 301 & M &= 1001 \\ + N &= 11 & N &= 31 & N &= 101 \\ + E &= 11 & E &= 31 & E &= 101 \\ + n_E &= 4 & n_E &= 11 & n_E &= 34 \\ + p_{n \ge 4} &\leq 0.42 & + p_{n \ge 11} &\leq 1.86 \cdot 10^{-5} & + p_{n \ge 34} &\leq 2.86 \cdot 10^{-12} + \end{align*} For an attacker to take over the network: \begin{align*} - M &= 200 & M &= 1000 & M &= 10000 \\ - N &= 60 & N &= 100 & N &= 100 \\ - E &= 60 & E &= 100 & E &= 500 \\ - n_E &= 41 & n_E &= 67 & n_E &= 67 \\ - p_{n \ge 41 } &= 4.2687 \cdot 10^{-14} & p_{n \ge 67} &= 9.34035 \cdot 10^{-54} & p_{n \ge 67} &= 5.68532 \cdot 10^{-64} + M &= 31 & M &= 301 & M &= 1001 \\ + N &= 11 & N &= 31 & N &= 101 \\ + E &= 11 & E &= 31 & E &= 101 \\ + n_E &= 4 & n_E &= 21 & n_E &= 68 \\ + p_{n \ge 4 } &\leq 2.0 \cdot 10^{-3} & + p_{n \ge 21} &\leq 1.2 \cdot 10^{-17} & + p_{n \ge 68} &\leq 1.33 \cdot 10^{-54} \end{align*} If we have an epoch time of $10$ seconds and the probability is $10^{-53}$ then the evil attacker can take over the network every $10^{46}$ years or around $10^{36}$ the current age of the universe. Note. -For a very large number of $M$ and $N$ the probability can be expressed as a logarithm formula to prevent numerical overflow. +For a very large number of $M$ and $N$ the probability can be expressed as a logarithm formula to prevent numerical overflow.\\ Combination expressed as a logarithm formula: -\begin{equation} +%\begin{equation} \begin{align*} \Phi (n,r) &= \sum_{k=r+1}^{n}{ln(k)} - \sum_{k=1}^{r}{ln(k)} \\ C(n,r) &= e^{{\Phi}(n,r)} \end{align*} -\end{equation} +%\end{equation} The probability expresses as a logarithm: - -\begin{equation} +%\begin{equation} \begin{align*} {\Pi}_{E_n} &= \left. \left( \sum_{i=0}^{n_E-1}{ln(p_{E_i})} - \sum_{i=n_E}^{N_E}{ln(1-p_{E_i})} \right) \right|_{N_E = min(E,N)} \\ p_{E_n} &= e^{({\Pi}_{E_n}+\Phi(N,n_E))} \end{align*} -\end{equation} +%\end{equation} If $M \gg n_E$ and $E \gg n_E$ the probability can be approximated to: -\begin{equation} +%\begin{equation} \begin{align*} p_{E_n} & \approx e^{(n_E \cdot ln(p_{E_0})-(N_E-n_E) \cdot (1-ln(P_{E_0})+\Phi(N,n_E)))} \\ &\approx e^{((2 \cdot n_E - N_E) \cdot ln(p_{E_0}) + n_E - N_E + \Phi(N,n_E))} ~ - \text{for} ~ \frac{E}{M} \approx \frac{E-n_E}{M-n_E} + \text{for} ~ \frac{E-n_E}{M} \approx \frac{E-n_E}{M-n_E} \ \end{align*} -\end{equation} +%\end{equation} \paragraph{Security conclusion\\} By having a volume of, e.g. $1000$ nodes and $100$ active nodes, which could be a possible amount for a network or shard, then the probability is so low that it will probably never occur in practice. Thus, the actual security is that the nodes are decentralised. Therefore, the node governance protocol is the actual security mechanism, because it regulates the uptake of nodes aiming for it to be democratic, meaning both decentralised and one physical person having only one node. + +\begin{align} +\frac{E-n}{M-n}\\ +\frac{M-(E-e)-n}{M-n} &= \frac{M-n}{M-n} - \frac{E-e}{M-n} +\end{align} \ No newline at end of file diff --git a/network_security/network_security.d b/network_security/network_security.d new file mode 100755 index 0000000..06430f6 --- /dev/null +++ b/network_security/network_security.d @@ -0,0 +1,99 @@ +#!/usr/bin/env rdmd + +import std.stdio; +import std.math; +import std.algorithm.comparison :min, max; + +struct Attack { + const uint M; + const uint N; + const uint E; + double pE(const uint n) const nothrow pure { + if (E>n) { + return double(E-n)/double(M-n); + } + return double(0); + } + + double pG(const uint n, const uint e) const nothrow pure { + if (e <- E) { +// assert(e<=E); +// return double(M-(E-e)-n)/double(M-n); + return 1-double(E-e)/double(M-n); + } + return 1; + } + + double pnE(const uint nE) const { + const NE=min(E, N); + double result=1; + // writefln("#### nE=%d", nE); + // return pE(nE); + // //const n=N; + // //uint k=1; + // //result = pow(1-pE(nE), (N-nE)); + // //writefln("nE=%d result=%e", nE, result); + foreach(i;0..nE) { + result*= pE(i); + // writefln(" %d result=%e", i, result); + } + foreach(i;nE..N+1) { + result*= pG(i, nE); + // writefln("->%d result=%e", i, result); + } + + // writefln("pE0=%e nE=%d pE0=%e", pE(0), nE, double(E)/double(M)); +// result=pow(pE(nE),nE); +// result=pow(1-pE(0),NE-1-nE); + // return result; + // assert(0); + // double P=1; + // double Q=1; + //writefln(" r=%e", result); + + foreach(k;1..(N-nE)+1) { + // P*=(nE+k); + // Q*=k; + // writefln("k=%d %s", k, [P,Q]); + result *= double(nE+k)/double(k); + } + // writefln("P=%s Q=%s %s", P,Q, P/Q); +// result *= (P/Q); +// writefln("P=%s Q=%s", P,Q); + //writefln("result=%e", result); + return result; + } + double pn_nE(const uint nE) const { + double result=0; + foreach(i;nE..N) { + //writef(">>i=%d ",i); + result += pnE(i); + } + return result; + } + + void estimate(const uint nE) { + writefln("nE =%d", nE); + writefln("(E-nE/M) =%e", double(E-nE)/double(M)); + writefln("(E-nE)/(M-nE)=%e", double(E-nE)/double(M-nE)); + } + +} + +int main(string[] args) { + const M=101; + const N=31; + const E=31; + auto attack=Attack(M, N, E); + const nE_1_3=N/3+1; + const nE_2_3=N*2/3+1; + attack.estimate(nE_1_3); + attack.estimate(nE_2_3); + writefln("Total nodes M=%d", M); + writefln("Active nodes N=%d", N); + writefln("Evil nodes E=%d", E); + writefln("Attack 1/3 %e nE=%d", attack.pn_nE(nE_1_3), nE_1_3); + writefln("Attack 2/3 %e nE=%d", attack.pn_nE(nE_2_3), nE_2_3); + // writefln("Attack 1/3 pE=%e nE=%d", attack.pnE(4), nE_1_3); + return 0; +} diff --git a/network_security/network_security.m b/network_security/network_security.m new file mode 100755 index 0000000..52c216b --- /dev/null +++ b/network_security/network_security.m @@ -0,0 +1,30 @@ +#!/usr/bin/env octave +M=200 +N=60 +E=60 +nE=21 + + +function retval = pE (E,M,n) + retval = (E-n)/(M-n); +endfunction + +function retval = pnE (E,M,N,nE) + prod=1; + NE=min(E,N) + for i = 0:nE-1 + prod *= pE(E,M,i); + end + prod + for i = nE:NE-1 + prod *= (1-pE(E,M,i)); + end + prod + nchoosek (N, nE) + prod *=nchoosek (N, nE) +endfunction + +#pE(E, M, nE) +pnE(E, M, N,nE) + +#nchoosek (n, k) diff --git a/node_contract.tex b/node_contract.tex index 1c69c3e..acc49ab 100644 --- a/node_contract.tex +++ b/node_contract.tex @@ -8,7 +8,7 @@ \subsection{Node contract} \hline Parameter & Description & Type & Access \\ \hline - $\$type$ & Set contract type to 'NNR' & \texttt{string} & \texttt{ro} \\ + $\$@$ & Set contract type to 'NNR' & \texttt{string} & \texttt{ro} \\ \hline $\#node$ & Public key for the node & \texttt{ubyte[]} & \texttt{ro} \\ \hline @@ -27,3 +27,22 @@ \subsection{Node contract} \caption{NNR Network Node Record} \label{tab:node_record} \end{table} + +\subsection{Hash Lock Record} +This record is used to store the has of an full-hash-value of the record with a $\#'param'$ to secure that the Merkle root of the DART. + +\begin{table}[H] + \begin{center} + \begin{tabular}{|l|p{7cm}|p{1.5cm}|l|} + \hline + Parameter & Description & Type & Access \\ + \hline + $\$@$ & Sets the contract type to 'HL' & \texttt{string} & \texttt{ro} \\ + \hline + $\$lock$ & Raw hash value of full $\#$ record & \texttt{ubyte[]} & \texttt{ro} \\ + \hline + \end{tabular} + \end{center} + \caption{HL Hash Lock} + \label{tab:hl} +\end{table} diff --git a/simple_gossip_model/gossip.d b/simple_gossip_model/gossip.d new file mode 100755 index 0000000..e50a7e0 --- /dev/null +++ b/simple_gossip_model/gossip.d @@ -0,0 +1,59 @@ +#!/usr/bin/env rdmd + +import std.algorithm.iteration: each; +import std.bitmanip : BitArray; +import std.random; +import std.stdio; +import std.typecons; + +struct Gossip { + BitArray[] networks; + const uint N; + this(const uint N) { + this.N = N; + networks=new BitArray[N]; + networks + .each!((ref n) => n.length=N); + foreach(i, ref n; networks) { + n[i]=true; + } + } + + auto epoch() { + auto rnd = Random(unpredictableSeed); + uint count; + double bw=0.0; + while (networks[0].count != N) { + count++; + foreach(i, ref n; networks) { + uint to_i; + do { + to_i = uniform(0, N, rnd); + } while (i == to_i); + bw+=(n - networks[to_i]).count; + bw+=(networks[to_i]-n).count; + n |= networks[to_i]; + } + } + return tuple!("strong","bw")(count,bw); + } +} + +int main(string[] args) { + const nodes=[11,31,101,1001,10_001,100_001]; + uint[] epochs; + double[] bws; + + foreach(N;nodes) { + auto gossip=Gossip(N); + const result=gossip.epoch; + writefln("gossip [N=%6d strong=%3d bw=%11.0f]", N, result.strong, result.bw); + epochs~=result.strong; + bws~=result.bw; + } + writefln(" nodes=%s", nodes); + writefln("epochs=%s", epochs); + writefln(" bws=%s", bws); + + return 0; +} diff --git a/tagion_tech_paper.tex b/tagion_tech_paper.tex index 8032a54..bdce777 100644 --- a/tagion_tech_paper.tex +++ b/tagion_tech_paper.tex @@ -1,4 +1,4 @@ -\documentclass[a4paper,10pt]{article} + \documentclass[a4paper,10pt]{article} % Set margin @@ -79,7 +79,7 @@ \input{gitversion} \title{Tagion Technical Paper} -\author{B. Rasmussen, Carsten and Simonsen, Theis} +\author{Carsten B. Rasmussen and Theis Simonsen} \begin{document} @@ -87,7 +87,7 @@ \begin{titlepage} \maketitle \begin{center} -\includegraphics[width = 40mm]{fig/logomark-black.eps} + \includegraphics[width = 40mm]{fig/logomark-black.eps} \end{center} \thispagestyle{empty} \input{abstract} @@ -102,7 +102,8 @@ \pagebreak \pagenumbering{arabic} -\input{governance} +%\input{governance} +\input{introduction} \pagebreak \input{hashgraph} @@ -114,12 +115,11 @@ \input{special_records} \pagebreak -\input{scripting_engine} +\input{tvm_engine} \pagebreak \input{transaction} - \pagebreak \input{business_model} @@ -130,8 +130,8 @@ \pagebreak \input{parallelism} -\pagebreak -\input{node_stack} +%\pagebreak +%\input{node_stack} \pagebreak \input{privacy} @@ -161,14 +161,24 @@ \pagebreak \input{network_security} +\pagebreak +\input{consensus_probability} + \pagebreak \input{dex_example} +\pagebreak +\input{consensus_order_function} + \pagebreak \input{gene_distance} + \pagebreak \input{mutation_rules} +\pagebreak +\input{keypairgeneration} + %%% Content lists \pagebreak \listoftables diff --git a/transaction.tex b/transaction.tex index 8a40cb9..cbc34c4 100644 --- a/transaction.tex +++ b/transaction.tex @@ -8,7 +8,7 @@ \section{Transaction Scripts} \hline Parameter & Description & Type & Access \\ \hline -$\$type$ & Set contract type to 'B0' & \texttt{string} & \texttt{ro} \\ +$\$@$ & Set contract type to 'B0' & \texttt{string} & \texttt{ro} \\ \hline $\$V$ & Value & \texttt{ulong} & \texttt{ro} \\ \hline @@ -16,7 +16,7 @@ \section{Transaction Scripts} \hline $\$T$ & Bill type & \texttt{string} & \texttt{ro} \\ \hline -$\$Y$ & Doubled hashed Owner key & \texttt{ubyte[]} & \texttt{ro} \\ +$\$Y$ & Owner pubkey & \texttt{ubyte[]} & \texttt{ro} \\ \hline {...} & {...} & {...} & {...} \\ \hline diff --git a/tvm_engine.tex b/tvm_engine.tex new file mode 100644 index 0000000..32e4ce8 --- /dev/null +++ b/tvm_engine.tex @@ -0,0 +1,111 @@ +\section{Tagion Virtual Engine}\label{sec:TVM} + +The scripting engine's language is called Funnel. It is based on a stack machine, which is a simple, functional language inspired by the programming language FORTH. +The scripting engine executes at different run levels. The lowest level is full Turing equivalent and is only able to make conditional forward jumps; it cannot run loops or functions. The scripting engine is limited by the number of instructions executed, call stack depth, data stack depth and memory. \\ + +The limitation is done to prevent a script running into infinite loops. The transaction script can use a library of standard functions which is stored in the DART, and the fingerprint of the script which is stored in the Bull’s eye blockchain that is the current state of the script. + +\begin{table}[H] + \begin{center} +\begin{tabular}{|p{2cm}|p{3.5cm}|l|} +\hline +Run level & Description & Limitation\\ +\hline +0 & Consensus script & No limits, full Turing equivalent \\ +\hline +1 & Debug script function (read-only) & Limit resources, read-only call function to level 0 \\ +\hline +2 & Transaction function & Limit resources and call function to levels 0 and 1 \\ +\hline +3 & Transaction script & Limit instruction and call function to level 2 \\ +\hline +\end{tabular} +\end{center} +\caption{Runlevels for the Scripting engine} +\label{tab:script_runlevl} +\end{table} + +In contrast to standard FORTH, Funnel is a strictly typed language which supports the types shown in \cref{tab:script_types}.\\ +Converting from one type to another must be explicitly instructed via a type casting function. If the casting fails, the scripting engine generates an error and the script stops. The scripting engine stops on overflow/underflow/divide-by-zero errors and if an operator is operating on invalid types. + +\begin{table}[H] +\begin{center} +\begin{tabular}{|l|l|l|} +\hline +name & Description & D-Type \\ +\hline +TEXT & UTF-8 text & \texttt{string} \\ +\hline +INTEGER & signend 64-bits number & \texttt{long} \\ +\hline +CARDINAL & Unsignend 64-bits number & \texttt{ulong} \\ +\hline +BIG & Unsigend big integer number & \texttt{BigUint} \\ +\hline +HiBON & HiBON Read/Write-only & \texttt{HiBON} \\ +\hline +DOCUMENT & HiBON Read only & \texttt{Document} \\ +\hline +BIN & Byte arrays, used to hold keys and hash value & \texttt{ubyte[]} \\ +\hline +\end{tabular} +\end{center} +\caption{Scripting types supported} +\label{tab:script_types} +\end{table} + + +\bfit{Funnel Sample code for a test contract} +\lstset{language=bash, numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt, tabsize=4} + +\begin{lstlisting} + +bool run(Document ) +variable trans_obj +variable trans_scrip_obj +variable signatures +variable hash_trans_scrp_obj +variable payees +variable payers +variable no_payers +variable no_signatures +variable scrip_eng_obj +variable bills +variable no_bills + +: loadtransactionobject + trans_obj ! + trans_obj @ 'transaction_scripting_object' doc@ + trans_scrip_obj ! + trans_obj @ 'signatures' doc@ + signatures ! + trans_scrip_obj @ hash256 + hash_trans_scrp_obj ! + trans_scrip_obj @ 'payees' doc@ + payees ! + trans_scrip_obj @ 'payers' doc@ + payers ! + payers @ length@ no_payers ! + signatures @ length@ no_signatures ! +; + +: loadscriptingengineobject + scrip_eng_obj ! + scrip_eng_obj @ 'bills' doc@ + bills ! + bills @ length@ no_bills ! + scrip_eng_obj @ 'transaction_object' doc@ + loadtransactionobject +; + +: get_payee_ownerkey + local _payee + local _payees + local _index + _index ! + _payees ! + _payees @ _index @ doc@ _payee ! + _payee @ 'ownerkey' doc@ +; + +\end{lstlisting} diff --git a/wavefront.tex b/wavefront.tex index ab62cac..ed68cbb 100644 --- a/wavefront.tex +++ b/wavefront.tex @@ -1,11 +1,11 @@ -\subsection{Gossip protocol and Wavefront propagation} -The Hashgraph algorithm uses a gossip protocol called “gossip about gossip” to propagate information between the nodes. It means node A sends all the information of the communication that it knows to a randomly selected node B. This enables node B to construct the same Hashgraph as node A. +\subsection{Gossip protocol and Wavefront propagation}\label{sec:wavefront} +The Hashgraph algorithm uses a gossip protocol called “gossip about gossip” to propagate information between the nodes. It means node A sends all the information of the communication that it knows to a randomly selected node B. This enables node B to construct the same Hashgraph as node A. (Patent \cite{wavefront_patent}) In the Tagion network, a protocol called Wavefront is used to exchange information between two nodes, ensuring that node A and B only need to communicate three times to share the state of the graph. Each node keeps track of an integer value called Altitude. Altitude is increased by one for each event created by the node. Each node stores its current view of Altitude for each node in the network. -By exchanging information about the Altitude between two nodes, both can figure out if their Wavefront is higher and send a list of events which are in front. -The Wavefront information exchange has four states: +By exchanging information about the Altitude between two nodes, both can figure out if their altitude is higher and send a list of events which are in front. The information of altitudes is called an wavefront. +The Wavefront information exchange has four states: \begin{enumerate} \item Node A selects random Node B and sends a list of all Altitudes. This state is called a tidal-wave. @@ -18,3 +18,16 @@ \subsection{Gossip protocol and Wavefront propagation} In the network, a node will often have many simultaneous wavefront connections so it will sometimes receive the same event package from other nodes. Then it will drop any duplicated events it receives. \end{enumerate} +In \cref{fig:wavefront_communication} the state diagram are shown and which show an communication example of the graph shown in \cref{fig:wavefront} where node number 1 initial the communication. + +\begin{figure}[ht] + \centering + % Replace this when we get the wavefront in + \includegraphics[width=0.7\textwidth]{fig/wavefront_communication.eps} + % \includegraphics[width=0.45\textwidth]{fig/wavefront_and_order_small_no_alt.eps} + % wavefront_and_order.eps: 3358x4625 px, 300dpi, 28.43x39.16 cm, bb=0 0 806 1110 + %\caption{Hashgraph with altitude(A) and parameter $\Omega$} + \caption{Wavefront communication state} + \label{fig:wavefront_communication} +\end{figure} +