\section{Introduction}\label{sec:introduction}}

\IEEEPARstart{S}{ince} the inception of Bitcoin \cite{bitcoin}, interest in blockchain technology, from Industry and Academia, has been booming. Moreover, Blockchain has been used extensively in almost all industry segments, including  internet of things \cite{IoT1, IoTsecurity, IoT3}, cryptocurrencies \cite{bitcoin, ethereum}, education \cite{education}, the healthcare sector \cite{HC1}, the industrial sector \cite{industrial}, and the financial Sector \cite{kirti}. The inherent characteristics of blockchain provide properties like transparency, decentralization, auditability, and security. A blockchain is a distributed database that is organised as a list of ordered blocks, where the committed blocks are immutable. With all these attractive characteristics, one of the key limitation of blockchain is \textit{scalability} \cite{hafid2020scaling}; indeed, the number of transactions that can be processed per second is small (e.g., up to 7 for Bitcoin \cite{bitcoin} and 15 for Ethereum \cite{ethereum}). This is unacceptable for most traditional centralized payment systems that require 1000s of transactions per second (tx/s) (e.g., Visa handles an average of 1700 tx/s \cite{visa}). A number of solutions to scale blockchain have been proposed; we can classify them into two categories: $(1)$ On-chain solutions: they propose modifications to the blockchain protocols, such as sharding (e.g., \cite{rapidchain}, \cite{ethereum}) and block size increase (e.g., \cite{garzik2015block}); and $(2)$ off-chain solutions (aka layer $2$ solutions): these are built on the blockchain protocols; they process certain transactions (e.g., micro-payment transactions) outside the blockchain and only record important transactions (e.g., final balances) on the blockchain. Examples of layer $2$ solutions include Lightning Network \cite{poon2016bitcoin}, Raiden Network \cite{network2018cheap}, and Plasma \cite{poon2017plasma}.

In this paper, we focus on the sharding solution. The key idea behind sharding is to divide or split the network into subsets, called shards/committees; throughout the paper, we will use the terms shard and committee interchangeably. Each shard will be working on different set of transactions rather than the entire network processing the same transactions. This idea allows the network to scale with the number of shards. It achieves high efficiency for both throughput and storage but may compromise security. Indeed, for the blockchain to be secure, all shards need to satisfy the byzantine validator limit (aka, committee resiliency, i.e., maximum percentage of malicious nodes that a committee can support). For RapidChain \cite{rapidchain}, this limit is $\frac{1}{2}$ (50\%).

The key challenge is that even if the network satisfies the limit, a shard could be compromised. For example, for RapidChain \cite{rapidchain}, let us assume that the network consists of $6$ shards; each shard contains $5$ nodes with 33\% of nodes are malicious (i.e., $10$ nodes are malicious) where $1$ shard has $4$ of the malicious nodes and the rest evenly distributed in the other $5$ shards. In this case, one shard will be $80\%$ byzantine/malicious and thus the entire network will be insecure (because the maximum number of malicious nodes that a shard can support is $50\%$). This is known as a \textbf{\textit{single shard takeover attack}}, see Figure \ref{fig:1}.

\begin{figure}[ht]
\centering
\tikzset{every picture/.style={line width=0.55pt}}

\begin{tikzpicture}[x=0.55pt,y=0.55pt,yscale=-1,xscale=1]

\draw  [color={rgb, 255:red, 144; green, 19; blue, 254 }  ,draw opacity=1 ] (119.15,41.69) -- (382.39,41.69) -- (382.39,213) -- (119.15,213) -- cycle ;
\draw   (269.79,216.64) -- (269.44,258.64) -- (251.71,286.5) -- (234.44,258.36) -- (234.79,216.36) -- (252.06,244.5) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (239.5,66.25) -- (233.11,75.05) -- (222.77,71.69) -- (222.77,60.81) -- (233.11,57.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (209.5,87.25) -- (203.11,96.05) -- (192.77,92.69) -- (192.77,81.81) -- (203.11,78.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 178 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (160.5,60.25) -- (154.11,69.05) -- (143.77,65.69) -- (143.77,54.81) -- (154.11,51.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (194.5,120.25) -- (188.11,129.05) -- (177.77,125.69) -- (177.77,114.81) -- (188.11,111.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (285.5,89.25) -- (279.11,98.05) -- (268.77,94.69) -- (268.77,83.81) -- (279.11,80.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (267.5,131.25) -- (261.11,140.05) -- (250.77,136.69) -- (250.77,125.81) -- (261.11,122.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (356.5,104.25) -- (350.11,113.05) -- (339.77,109.69) -- (339.77,98.81) -- (350.11,95.45) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (158.5,144.75) -- (151.76,154.02) -- (140.86,150.48) -- (140.86,139.02) -- (151.76,135.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (211.5,54.75) -- (204.76,64.02) -- (193.86,60.48) -- (193.86,49.02) -- (204.76,45.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (199.5,146.75) -- (192.76,156.02) -- (181.86,152.48) -- (181.86,141.02) -- (192.76,137.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (325.5,91.75) -- (318.76,101.02) -- (307.86,97.48) -- (307.86,86.02) -- (318.76,82.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (147.5,180.75) -- (140.76,190.02) -- (129.86,186.48) -- (129.86,175.02) -- (140.76,171.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (231.5,139.75) -- (224.76,149.02) -- (213.86,145.48) -- (213.86,134.02) -- (224.76,130.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (356.39,136.23) -- (349.65,145.5) -- (338.75,141.96) -- (338.75,130.5) -- (349.65,126.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (248.39,93.23) -- (241.65,102.5) -- (230.75,98.96) -- (230.75,87.5) -- (241.65,83.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (180.39,194.23) -- (173.65,203.5) -- (162.75,199.96) -- (162.75,188.5) -- (173.65,184.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (351.39,64.23) -- (344.65,73.5) -- (333.75,69.96) -- (333.75,58.5) -- (344.65,54.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (291.39,165.23) -- (284.65,174.5) -- (273.75,170.96) -- (273.75,159.5) -- (284.65,155.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (172.39,92.23) -- (165.65,101.5) -- (154.75,97.96) -- (154.75,86.5) -- (165.65,82.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (304.39,125.23) -- (297.65,134.5) -- (286.75,130.96) -- (286.75,119.5) -- (297.65,115.96) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (297.5,64.25) -- (291.11,73.05) -- (280.77,69.69) -- (280.77,58.81) -- (291.11,55.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (353.5,190.25) -- (347.11,199.05) -- (336.77,195.69) -- (336.77,184.81) -- (347.11,181.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (141.5,121.25) -- (135.11,130.05) -- (124.77,126.69) -- (124.77,115.81) -- (135.11,112.45) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (219.39,172.23) -- (212.65,181.5) -- (201.75,177.96) -- (201.75,166.5) -- (212.65,162.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (311.39,185.23) -- (304.65,194.5) -- (293.75,190.96) -- (293.75,179.5) -- (304.65,175.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (254.39,169.23) -- (247.65,178.5) -- (236.75,174.96) -- (236.75,163.5) -- (247.65,159.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (236.39,193.23) -- (229.65,202.5) -- (218.75,198.96) -- (218.75,187.5) -- (229.65,183.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (325.39,156.23) -- (318.65,165.5) -- (307.75,161.96) -- (307.75,150.5) -- (318.65,146.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (276.39,191.23) -- (269.65,200.5) -- (258.75,196.96) -- (258.75,185.5) -- (269.65,181.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (364.39,167.23) -- (357.65,176.5) -- (346.75,172.96) -- (346.75,161.5) -- (357.65,157.96) -- cycle ;
\draw   (122,291) -- (192,291) -- (192,379) -- (122,379) -- cycle ;
\draw   (215,292) -- (285,292) -- (285,379) -- (215,379) -- cycle ;
\draw   (309,292) -- (379,292) -- (379,379) -- (309,379) -- cycle ;
\draw   (308,394) -- (378,394) -- (378,481) -- (308,481) -- cycle ;
\draw   (216,394) -- (286,394) -- (286,481) -- (216,481) -- cycle ;
\draw   (123,394) -- (193,394) -- (193,481) -- (123,481) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (151.5,360.25) -- (145.11,369.05) -- (134.77,365.69) -- (134.77,354.81) -- (145.11,351.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (278.5,305.25) -- (272.11,314.05) -- (261.77,310.69) -- (261.77,299.81) -- (272.11,296.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (250,335.5) -- (243.61,344.3) -- (233.27,340.94) -- (233.27,330.06) -- (243.61,326.7) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (167.25,437.5) -- (160.86,446.3) -- (150.52,442.94) -- (150.52,432.06) -- (160.86,428.7) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (276.5,412.25) -- (270.11,421.05) -- (259.77,417.69) -- (259.77,406.81) -- (270.11,403.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (245.5,419.25) -- (239.11,428.05) -- (228.77,424.69) -- (228.77,413.81) -- (239.11,410.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (281.5,462.25) -- (275.11,471.05) -- (264.77,467.69) -- (264.77,456.81) -- (275.11,453.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (241.5,466.25) -- (235.11,475.05) -- (224.77,471.69) -- (224.77,460.81) -- (235.11,457.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (337.5,410.25) -- (331.11,419.05) -- (320.77,415.69) -- (320.77,404.81) -- (331.11,401.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (368.5,464.25) -- (362.11,473.05) -- (351.77,469.69) -- (351.77,458.81) -- (362.11,455.45) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (268.64,443.23) -- (261.9,452.5) -- (251,448.96) -- (251,437.5) -- (261.9,433.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (334.39,464.23) -- (327.65,473.5) -- (316.75,469.96) -- (316.75,458.5) -- (327.65,454.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (352.75,437.5) -- (346.01,446.77) -- (335.11,443.23) -- (335.11,431.77) -- (346.01,428.23) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (370.39,410.23) -- (363.65,419.5) -- (352.75,415.96) -- (352.75,404.5) -- (363.65,400.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (147.39,460.23) -- (140.65,469.5) -- (129.75,465.96) -- (129.75,454.5) -- (140.65,450.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (183.39,466.23) -- (176.65,475.5) -- (165.75,471.96) -- (165.75,460.5) -- (176.65,456.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (152.39,414.23) -- (145.65,423.5) -- (134.75,419.96) -- (134.75,408.5) -- (145.65,404.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (183.39,412.23) -- (176.65,421.5) -- (165.75,417.96) -- (165.75,406.5) -- (176.65,402.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (334.39,360.23) -- (327.65,369.5) -- (316.75,365.96) -- (316.75,354.5) -- (327.65,350.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (367.39,364.23) -- (360.65,373.5) -- (349.75,369.96) -- (349.75,358.5) -- (360.65,354.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (334.39,334.23) -- (327.65,343.5) -- (316.75,339.96) -- (316.75,328.5) -- (327.65,324.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (367.39,332.23) -- (360.65,341.5) -- (349.75,337.96) -- (349.75,326.5) -- (360.65,322.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (349.39,308.23) -- (342.65,317.5) -- (331.75,313.96) -- (331.75,302.5) -- (342.65,298.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (244.39,309.23) -- (237.65,318.5) -- (226.75,314.96) -- (226.75,303.5) -- (237.65,299.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (254.39,363.23) -- (247.65,372.5) -- (236.75,368.96) -- (236.75,357.5) -- (247.65,353.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (279.39,342.23) -- (272.65,351.5) -- (261.75,347.96) -- (261.75,336.5) -- (272.65,332.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (184.39,364.23) -- (177.65,373.5) -- (166.75,369.96) -- (166.75,358.5) -- (177.65,354.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (148.39,333.23) -- (141.65,342.5) -- (130.75,338.96) -- (130.75,327.5) -- (141.65,323.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (182.39,336.23) -- (175.65,345.5) -- (164.75,341.96) -- (164.75,330.5) -- (175.65,326.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (168.39,310.23) -- (161.65,319.5) -- (150.75,315.96) -- (150.75,304.5) -- (161.65,300.96) -- cycle ;

\draw (68.61,165.57) node [anchor=north west][inner sep=0.75pt]  [rotate=-269.5] [align=left] { \ Network \ \\ \ \ $\mathcal{N}$ = 30 \ \ };
\draw (148,270) node [anchor=north west][inner sep=0.75pt]   [align=left] { 1 };
\draw (223,274) node [anchor=north west][inner sep=0.75pt]   [align=left] { 2 };
\draw (332,273) node [anchor=north west][inner sep=0.75pt]   [align=left] { 3 };
\draw (146,485) node [anchor=north west][inner sep=0.75pt]   [align=left] { 4 };
\draw (243,485) node [anchor=north west][inner sep=0.75pt]   [align=left] { 5 };
\draw (334,483) node [anchor=north west][inner sep=0.75pt]   [align=left] { 6};
\draw (83.39,462.43) node [anchor=north west][inner sep=0.75pt]  [rotate=-270.49] [align=left] {6 = $\frac{30}{5}$ Shards, n = 5};

\end{tikzpicture}
\caption{Sharding divides the network into subsets (shards), which means only a shard can handles a set of transactions rather than the entire network. A scenario where there is a single shard takeover attack (shard 5 in this case).}
\label{fig:1}
\end{figure}

\begin{figure*}[ht]
\centering
\tikzset{every picture/.style={line width=0.75pt}}

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.65,xscale=0.65]

\draw  [color={rgb, 255:red, 144; green, 19; blue, 254 }  ,draw opacity=1 ] (299,25) -- (486.5,25) -- (486.5,280) -- (299,280) -- cycle ;
\draw  [color={rgb, 255:red, 144; green, 19; blue, 254 }  ,draw opacity=1 ] (70.89,47.9) -- (220.88,49.11) -- (219.11,257.1) -- (69.12,255.89) -- cycle ;
\draw   (224,140) -- (254.9,140) -- (275.5,153.5) -- (254.9,167) -- (224,167) -- (244.6,153.5) -- cycle ;
\draw   (492,137) -- (520.5,137) -- (539.5,151.5) -- (520.5,166) -- (492,166) -- (511,151.5) -- cycle ;
\draw  [color={rgb, 255:red, 144; green, 19; blue, 254 }  ,draw opacity=1 ] (570.5,50) -- (715.5,50) -- (715.5,250) -- (570.5,250) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ] (113,100.75) .. controls (113,94.81) and (117.92,90) .. (124,90) .. controls (130.08,90) and (135,94.81) .. (135,100.75) .. controls (135,106.69) and (130.08,111.5) .. (124,111.5) .. controls (117.92,111.5) and (113,106.69) .. (113,100.75) -- cycle ; \draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ] (113,100.75) -- (135,100.75) ; \draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ] (124,90) -- (124,111.5) ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ] (199,352.75) .. controls (199,346.81) and (203.92,342) .. (210,342) .. controls (216.08,342) and (221,346.81) .. (221,352.75) .. controls (221,358.69) and (216.08,363.5) .. (210,363.5) .. controls (203.92,363.5) and (199,358.69) .. (199,352.75) -- cycle ; \draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ] (199,352.75) -- (221,352.75) ; \draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ] (210,342) -- (210,363.5) ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (100,130.5) .. controls (100,124.7) and (105.26,120) .. (111.75,120) .. controls (118.24,120) and (123.5,124.7) .. (123.5,130.5) .. controls (123.5,136.3) and (118.24,141) .. (111.75,141) .. controls (105.26,141) and (100,136.3) .. (100,130.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (121.5,152.5) .. controls (121.5,146.7) and (126.76,142) .. (133.25,142) .. controls (139.74,142) and (145,146.7) .. (145,152.5) .. controls (145,158.3) and (139.74,163) .. (133.25,163) .. controls (126.76,163) and (121.5,158.3) .. (121.5,152.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (92,174.5) .. controls (92,168.7) and (97.26,164) .. (103.75,164) .. controls (110.24,164) and (115.5,168.7) .. (115.5,174.5) .. controls (115.5,180.3) and (110.24,185) .. (103.75,185) .. controls (97.26,185) and (92,180.3) .. (92,174.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (123,185.5) .. controls (123,179.7) and (128.26,175) .. (134.75,175) .. controls (141.24,175) and (146.5,179.7) .. (146.5,185.5) .. controls (146.5,191.3) and (141.24,196) .. (134.75,196) .. controls (128.26,196) and (123,191.3) .. (123,185.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (82,73.5) .. controls (82,67.7) and (87.26,63) .. (93.75,63) .. controls (100.24,63) and (105.5,67.7) .. (105.5,73.5) .. controls (105.5,79.3) and (100.24,84) .. (93.75,84) .. controls (87.26,84) and (82,79.3) .. (82,73.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (127,68.5) .. controls (127,62.7) and (132.26,58) .. (138.75,58) .. controls (145.24,58) and (150.5,62.7) .. (150.5,68.5) .. controls (150.5,74.3) and (145.24,79) .. (138.75,79) .. controls (132.26,79) and (127,74.3) .. (127,68.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (168,69.5) .. controls (168,63.7) and (173.26,59) .. (179.75,59) .. controls (186.24,59) and (191.5,63.7) .. (191.5,69.5) .. controls (191.5,75.3) and (186.24,80) .. (179.75,80) .. controls (173.26,80) and (168,75.3) .. (168,69.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (147,103.5) .. controls (147,97.7) and (152.26,93) .. (158.75,93) .. controls (165.24,93) and (170.5,97.7) .. (170.5,103.5) .. controls (170.5,109.3) and (165.24,114) .. (158.75,114) .. controls (152.26,114) and (147,109.3) .. (147,103.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (180,108.5) .. controls (180,102.7) and (185.26,98) .. (191.75,98) .. controls (198.24,98) and (203.5,102.7) .. (203.5,108.5) .. controls (203.5,114.3) and (198.24,119) .. (191.75,119) .. controls (185.26,119) and (180,114.3) .. (180,108.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (141,129.5) .. controls (141,123.7) and (146.26,119) .. (152.75,119) .. controls (159.24,119) and (164.5,123.7) .. (164.5,129.5) .. controls (164.5,135.3) and (159.24,140) .. (152.75,140) .. controls (146.26,140) and (141,135.3) .. (141,129.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (79,105.5) .. controls (79,99.7) and (84.26,95) .. (90.75,95) .. controls (97.24,95) and (102.5,99.7) .. (102.5,105.5) .. controls (102.5,111.3) and (97.24,116) .. (90.75,116) .. controls (84.26,116) and (79,111.3) .. (79,105.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (155,167) .. controls (155,161.2) and (160.26,156.5) .. (166.75,156.5) .. controls (173.24,156.5) and (178.5,161.2) .. (178.5,167) .. controls (178.5,172.8) and (173.24,177.5) .. (166.75,177.5) .. controls (160.26,177.5) and (155,172.8) .. (155,167) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (185,138.5) .. controls (185,132.7) and (190.26,128) .. (196.75,128) .. controls (203.24,128) and (208.5,132.7) .. (208.5,138.5) .. controls (208.5,144.3) and (203.24,149) .. (196.75,149) .. controls (190.26,149) and (185,144.3) .. (185,138.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (186,194.5) .. controls (186,188.7) and (191.26,184) .. (197.75,184) .. controls (204.24,184) and (209.5,188.7) .. (209.5,194.5) .. controls (209.5,200.3) and (204.24,205) .. (197.75,205) .. controls (191.26,205) and (186,200.3) .. (186,194.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (154,201.5) .. controls (154,195.7) and (159.26,191) .. (165.75,191) .. controls (172.24,191) and (177.5,195.7) .. (177.5,201.5) .. controls (177.5,207.3) and (172.24,212) .. (165.75,212) .. controls (159.26,212) and (154,207.3) .. (154,201.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (76,204.5) .. controls (76,198.7) and (81.26,194) .. (87.75,194) .. controls (94.24,194) and (99.5,198.7) .. (99.5,204.5) .. controls (99.5,210.3) and (94.24,215) .. (87.75,215) .. controls (81.26,215) and (76,210.3) .. (76,204.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (89,236.5) .. controls (89,230.7) and (94.26,226) .. (100.75,226) .. controls (107.24,226) and (112.5,230.7) .. (112.5,236.5) .. controls (112.5,242.3) and (107.24,247) .. (100.75,247) .. controls (94.26,247) and (89,242.3) .. (89,236.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (110,212.5) .. controls (110,206.7) and (115.26,202) .. (121.75,202) .. controls (128.24,202) and (133.5,206.7) .. (133.5,212.5) .. controls (133.5,218.3) and (128.24,223) .. (121.75,223) .. controls (115.26,223) and (110,218.3) .. (110,212.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (77,148.5) .. controls (77,142.7) and (82.26,138) .. (88.75,138) .. controls (95.24,138) and (100.5,142.7) .. (100.5,148.5) .. controls (100.5,154.3) and (95.24,159) .. (88.75,159) .. controls (82.26,159) and (77,154.3) .. (77,148.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (168,235.5) .. controls (168,229.7) and (173.26,225) .. (179.75,225) .. controls (186.24,225) and (191.5,229.7) .. (191.5,235.5) .. controls (191.5,241.3) and (186.24,246) .. (179.75,246) .. controls (173.26,246) and (168,241.3) .. (168,235.5) -- cycle ;
\draw  [color={rgb, 255:red, 65; green, 117; blue, 5 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 255; blue, 255 }  ,fill opacity=1 ] (61,350.5) .. controls (61,344.7) and (66.26,340) .. (72.75,340) .. controls (79.24,340) and (84.5,344.7) .. (84.5,350.5) .. controls (84.5,356.3) and (79.24,361) .. (72.75,361) .. controls (66.26,361) and (61,356.3) .. (61,350.5) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (353.5,58.25) -- (347.11,67.05) -- (336.77,63.69) -- (336.77,52.81) -- (347.11,49.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (373.5,78.25) -- (367.11,87.05) -- (356.77,83.69) -- (356.77,72.81) -- (367.11,69.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (420.5,56.25) -- (414.11,65.05) -- (403.77,61.69) -- (403.77,50.81) -- (414.11,47.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (425.5,82.25) -- (419.11,91.05) -- (408.77,87.69) -- (408.77,76.81) -- (419.11,73.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (344.5,95.25) -- (338.11,104.05) -- (327.77,100.69) -- (327.77,89.81) -- (338.11,86.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (399.5,97.25) -- (393.11,106.05) -- (382.77,102.69) -- (382.77,91.81) -- (393.11,88.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (391.5,49.25) -- (385.11,58.05) -- (374.77,54.69) -- (374.77,43.81) -- (385.11,40.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (369.5,107.25) -- (363.11,116.05) -- (352.77,112.69) -- (352.77,101.81) -- (363.11,98.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (449.5,44.25) -- (443.11,53.05) -- (432.77,49.69) -- (432.77,38.81) -- (443.11,35.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (471.5,62.25) -- (465.11,71.05) -- (454.77,67.69) -- (454.77,56.81) -- (465.11,53.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (456.5,84.25) -- (450.11,93.05) -- (439.77,89.69) -- (439.77,78.81) -- (450.11,75.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (329.5,45.25) -- (323.11,54.05) -- (312.77,50.69) -- (312.77,39.81) -- (323.11,36.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (441.5,108.25) -- (435.11,117.05) -- (424.77,113.69) -- (424.77,102.81) -- (435.11,99.45) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (339.5,134.75) -- (332.76,144.02) -- (321.86,140.48) -- (321.86,129.02) -- (332.76,125.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (351.5,153.75) -- (344.76,163.02) -- (333.86,159.48) -- (333.86,148.02) -- (344.76,144.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (351.5,153.75) -- (344.76,163.02) -- (333.86,159.48) -- (333.86,148.02) -- (344.76,144.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (380.5,136.75) -- (373.76,146.02) -- (362.86,142.48) -- (362.86,131.02) -- (373.76,127.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (380.5,161.75) -- (373.76,171.02) -- (362.86,167.48) -- (362.86,156.02) -- (373.76,152.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (328.5,170.75) -- (321.76,180.02) -- (310.86,176.48) -- (310.86,165.02) -- (321.76,161.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (412.5,129.75) -- (405.76,139.02) -- (394.86,135.48) -- (394.86,124.02) -- (405.76,120.48) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (410.39,158.23) -- (403.65,167.5) -- (392.75,163.96) -- (392.75,152.5) -- (403.65,148.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (430.39,178.23) -- (423.65,187.5) -- (412.75,183.96) -- (412.75,172.5) -- (423.65,168.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (430.39,178.23) -- (423.65,187.5) -- (412.75,183.96) -- (412.75,172.5) -- (423.65,168.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (360.39,185.23) -- (353.65,194.5) -- (342.75,190.96) -- (342.75,179.5) -- (353.65,175.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (336.39,197.23) -- (329.65,206.5) -- (318.75,202.96) -- (318.75,191.5) -- (329.65,187.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (363.39,214.23) -- (356.65,223.5) -- (345.75,219.96) -- (345.75,208.5) -- (356.65,204.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (470.39,351.23) -- (463.65,360.5) -- (452.75,356.96) -- (452.75,345.5) -- (463.65,341.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (394.39,209.23) -- (387.65,218.5) -- (376.75,214.96) -- (376.75,203.5) -- (387.65,199.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (442.39,153.23) -- (435.65,162.5) -- (424.75,158.96) -- (424.75,147.5) -- (435.65,143.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (472.39,155.23) -- (465.65,164.5) -- (454.75,160.96) -- (454.75,149.5) -- (465.65,145.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (463.39,181.23) -- (456.65,190.5) -- (445.75,186.96) -- (445.75,175.5) -- (456.65,171.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (427.39,205.23) -- (420.65,214.5) -- (409.75,210.96) -- (409.75,199.5) -- (420.65,195.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (638.39,126.23) -- (631.65,135.5) -- (620.75,131.96) -- (620.75,120.5) -- (631.65,116.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (455.39,210.23) -- (448.65,219.5) -- (437.75,215.96) -- (437.75,204.5) -- (448.65,200.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (335.39,222.23) -- (328.65,231.5) -- (317.75,227.96) -- (317.75,216.5) -- (328.65,212.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (334.39,258.23) -- (327.65,267.5) -- (316.75,263.96) -- (316.75,252.5) -- (327.65,248.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (466.39,236.23) -- (459.65,245.5) -- (448.75,241.96) -- (448.75,230.5) -- (459.65,226.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (381.39,230.23) -- (374.65,239.5) -- (363.75,235.96) -- (363.75,224.5) -- (374.65,220.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (414.39,230.23) -- (407.65,239.5) -- (396.75,235.96) -- (396.75,224.5) -- (407.65,220.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (443.39,231.23) -- (436.65,240.5) -- (425.75,236.96) -- (425.75,225.5) -- (436.65,221.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (355.39,241.23) -- (348.65,250.5) -- (337.75,246.96) -- (337.75,235.5) -- (348.65,231.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (370.39,260.23) -- (363.65,269.5) -- (352.75,265.96) -- (352.75,254.5) -- (363.65,250.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (443.39,259.23) -- (436.65,268.5) -- (425.75,264.96) -- (425.75,253.5) -- (436.65,249.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (452.39,132.23) -- (445.65,141.5) -- (434.75,137.96) -- (434.75,126.5) -- (445.65,122.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (481.39,132.23) -- (474.65,141.5) -- (463.75,137.96) -- (463.75,126.5) -- (474.65,122.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (471.39,259.23) -- (464.65,268.5) -- (453.75,264.96) -- (453.75,253.5) -- (464.65,249.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (480.39,220.78) -- (473.65,230.05) -- (462.75,226.51) -- (462.75,215.05) -- (473.65,211.5) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (600.5,69.25) -- (594.11,78.05) -- (583.77,74.69) -- (583.77,63.81) -- (594.11,60.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (618.5,88.25) -- (612.11,97.05) -- (601.77,93.69) -- (601.77,82.81) -- (612.11,79.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (641.5,68.25) -- (635.11,77.05) -- (624.77,73.69) -- (624.77,62.81) -- (635.11,59.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (667.5,70.25) -- (661.11,79.05) -- (650.77,75.69) -- (650.77,64.81) -- (661.11,61.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (842.5,57.75) -- (838.53,63.22) -- (832.1,61.13) -- (832.1,54.37) -- (838.53,52.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (650.5,95.25) -- (644.11,104.05) -- (633.77,100.69) -- (633.77,89.81) -- (644.11,86.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (686.5,94.25) -- (680.11,103.05) -- (669.77,99.69) -- (669.77,88.81) -- (680.11,85.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (598.5,102.25) -- (592.11,111.05) -- (581.77,107.69) -- (581.77,96.81) -- (592.11,93.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (671.5,111.25) -- (665.11,120.05) -- (654.77,116.69) -- (654.77,105.81) -- (665.11,102.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (708.5,105.25) -- (702.11,114.05) -- (691.77,110.69) -- (691.77,99.81) -- (702.11,96.45) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (601.39,126.23) -- (594.65,135.5) -- (583.75,131.96) -- (583.75,120.5) -- (594.65,116.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (483.39,201.23) -- (476.65,210.5) -- (465.75,206.96) -- (465.75,195.5) -- (476.65,191.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (621.39,146.23) -- (614.65,155.5) -- (603.75,151.96) -- (603.75,140.5) -- (614.65,136.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (626.49,237.23) -- (619.75,246.51) -- (608.85,242.97) -- (608.85,231.5) -- (619.75,227.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (692.39,129.23) -- (685.65,138.5) -- (674.75,134.96) -- (674.75,123.5) -- (685.65,119.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (705.39,150.23) -- (698.65,159.5) -- (687.75,155.96) -- (687.75,144.5) -- (698.65,140.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (621.39,146.23) -- (614.65,155.5) -- (603.75,151.96) -- (603.75,140.5) -- (614.65,136.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (644.39,155.23) -- (637.65,164.5) -- (626.75,160.96) -- (626.75,149.5) -- (637.65,145.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (593.39,153.23) -- (586.65,162.5) -- (575.75,158.96) -- (575.75,147.5) -- (586.65,143.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (679.39,162.23) -- (672.65,171.5) -- (661.75,167.96) -- (661.75,156.5) -- (672.65,152.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (596.39,179.23) -- (589.65,188.5) -- (578.75,184.96) -- (578.75,173.5) -- (589.65,169.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (624.39,172.23) -- (617.65,181.5) -- (606.75,177.96) -- (606.75,166.5) -- (617.65,162.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (662.39,175.23) -- (655.65,184.5) -- (644.75,180.96) -- (644.75,169.5) -- (655.65,165.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (711.39,175.23) -- (704.65,184.5) -- (693.75,180.96) -- (693.75,169.5) -- (704.65,165.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (688.39,187.23) -- (681.65,196.5) -- (670.75,192.96) -- (670.75,181.5) -- (681.65,177.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (597.39,205.23) -- (590.65,214.5) -- (579.75,210.96) -- (579.75,199.5) -- (590.65,195.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (624.39,196.23) -- (617.65,205.5) -- (606.75,201.96) -- (606.75,190.5) -- (617.65,186.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (650.39,195.23) -- (643.65,204.5) -- (632.75,200.96) -- (632.75,189.5) -- (643.65,185.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (709.39,207.23) -- (702.65,216.5) -- (691.75,212.96) -- (691.75,201.5) -- (702.65,197.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (678.39,213.23) -- (671.65,222.5) -- (660.75,218.96) -- (660.75,207.5) -- (671.65,203.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (598.39,236.23) -- (591.65,245.5) -- (580.75,241.96) -- (580.75,230.5) -- (591.65,226.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (698.39,236.23) -- (691.65,245.5) -- (680.75,241.96) -- (680.75,230.5) -- (691.65,226.96) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (638.39,217.23) -- (631.65,226.5) -- (620.75,222.96) -- (620.75,211.5) -- (631.65,207.96) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (374.5,351.25) -- (368.11,360.05) -- (357.77,356.69) -- (357.77,345.81) -- (368.11,342.45) -- cycle ;
\draw   (823,133) -- (1000.5,133) -- (1000.5,173) -- (823,173) -- cycle ;
\draw   (824,48) -- (1001.5,48) -- (1001.5,88) -- (824,88) -- cycle ;
\draw   (822,218) -- (999.5,218) -- (999.5,258) -- (822,258) -- cycle ;
\draw    (716.5,150) -- (821.9,71.2) ;
\draw [shift={(823.5,70)}, rotate = 503.22] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw    (716.5,150) -- (819.5,150.98) ;
\draw [shift={(821.5,151)}, rotate = 180.55] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw    (716.5,150) -- (819.99,239.69) ;
\draw [shift={(821.5,241)}, rotate = 220.91] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (862.5,77.75) -- (858.53,83.22) -- (852.1,81.13) -- (852.1,74.37) -- (858.53,72.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (863.5,56.75) -- (859.53,62.22) -- (853.1,60.13) -- (853.1,53.37) -- (859.53,51.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (880.5,59.75) -- (876.53,65.22) -- (870.1,63.13) -- (870.1,56.37) -- (876.53,54.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (881.5,77.75) -- (877.53,83.22) -- (871.1,81.13) -- (871.1,74.37) -- (877.53,72.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (845.5,144.75) -- (841.53,150.22) -- (835.1,148.13) -- (835.1,141.37) -- (841.53,139.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (868.5,144.75) -- (864.53,150.22) -- (858.1,148.13) -- (858.1,141.37) -- (864.53,139.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (842.5,161.75) -- (838.53,167.22) -- (832.1,165.13) -- (832.1,158.37) -- (838.53,156.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (858.5,159.75) -- (854.53,165.22) -- (848.1,163.13) -- (848.1,156.37) -- (854.53,154.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (887.5,141.75) -- (883.53,147.22) -- (877.1,145.13) -- (877.1,138.37) -- (883.53,136.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (881.5,158.75) -- (877.53,164.22) -- (871.1,162.13) -- (871.1,155.37) -- (877.53,153.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (840.5,227.75) -- (836.53,233.22) -- (830.1,231.13) -- (830.1,224.37) -- (836.53,222.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (841.5,248.75) -- (837.53,254.22) -- (831.1,252.13) -- (831.1,245.37) -- (837.53,243.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (857.5,237.75) -- (853.53,243.22) -- (847.1,241.13) -- (847.1,234.37) -- (853.53,232.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (872.5,226.75) -- (868.53,232.22) -- (862.1,230.13) -- (862.1,223.37) -- (868.53,221.28) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (872.9,248.13) -- (868.93,253.6) -- (862.5,251.51) -- (862.5,244.75) -- (868.93,242.66) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (939.39,65.24) -- (935.41,70.72) -- (928.97,68.63) -- (928.97,61.86) -- (935.41,59.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (962.39,79.24) -- (958.41,84.72) -- (951.97,82.63) -- (951.97,75.86) -- (958.41,73.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (966.39,61.24) -- (962.41,66.72) -- (955.97,64.63) -- (955.97,57.86) -- (962.41,55.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (934.39,79.24) -- (930.41,84.72) -- (923.97,82.63) -- (923.97,75.86) -- (930.41,73.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (995.39,59.24) -- (991.41,64.72) -- (984.97,62.63) -- (984.97,55.86) -- (991.41,53.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (995.39,79.24) -- (991.41,84.72) -- (984.97,82.63) -- (984.97,75.86) -- (991.41,73.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (978.39,73.24) -- (974.41,78.72) -- (967.97,76.63) -- (967.97,69.86) -- (974.41,67.76) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (691.5,61.25) -- (685.11,70.05) -- (674.77,66.69) -- (674.77,55.81) -- (685.11,52.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (707.5,79.25) -- (701.11,88.05) -- (690.77,84.69) -- (690.77,73.81) -- (701.11,70.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (466.5,112.25) -- (460.11,121.05) -- (449.77,117.69) -- (449.77,106.81) -- (460.11,103.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (326.5,73.25) -- (320.11,82.05) -- (309.77,78.69) -- (309.77,67.81) -- (320.11,64.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (479.5,38.25) -- (473.11,47.05) -- (462.77,43.69) -- (462.77,32.81) -- (473.11,29.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (363.5,37.25) -- (357.11,46.05) -- (346.77,42.69) -- (346.77,31.81) -- (357.11,28.45) -- cycle ;
\draw  [color={rgb, 255:red, 208; green, 2; blue, 27 }  ,draw opacity=1 ][fill={rgb, 255:red, 208; green, 2; blue, 27 }  ,fill opacity=1 ] (322.5,111.25) -- (316.11,120.05) -- (305.77,116.69) -- (305.77,105.81) -- (316.11,102.45) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (930.39,143.24) -- (926.41,148.72) -- (919.97,146.63) -- (919.97,139.86) -- (926.41,137.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (936.39,164.24) -- (932.41,169.72) -- (925.97,167.63) -- (925.97,160.86) -- (932.41,158.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (949.39,143.24) -- (945.41,148.72) -- (938.97,146.63) -- (938.97,139.86) -- (945.41,137.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (952.39,158.24) -- (948.41,163.72) -- (941.97,161.63) -- (941.97,154.86) -- (948.41,152.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (965.39,145.24) -- (961.41,150.72) -- (954.97,148.63) -- (954.97,141.86) -- (961.41,139.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (968.39,162.24) -- (964.41,167.72) -- (957.97,165.63) -- (957.97,158.86) -- (964.41,156.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (995.39,142.24) -- (991.41,147.72) -- (984.97,145.63) -- (984.97,138.86) -- (991.41,136.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (983.39,152.24) -- (979.41,157.72) -- (972.97,155.63) -- (972.97,148.86) -- (979.41,146.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (994.39,165.24) -- (990.41,170.72) -- (983.97,168.63) -- (983.97,161.86) -- (990.41,159.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (925.39,229.24) -- (921.41,234.72) -- (914.97,232.63) -- (914.97,225.86) -- (921.41,223.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (917.39,249.24) -- (913.41,254.72) -- (906.97,252.63) -- (906.97,245.86) -- (913.41,243.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (944.39,232.24) -- (940.41,237.72) -- (933.97,235.63) -- (933.97,228.86) -- (940.41,226.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (938.39,246.24) -- (934.41,251.72) -- (927.97,249.63) -- (927.97,242.86) -- (934.41,240.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (961.39,228.24) -- (957.41,233.72) -- (950.97,231.63) -- (950.97,224.86) -- (957.41,222.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (957.39,251.24) -- (953.41,256.72) -- (946.97,254.63) -- (946.97,247.86) -- (953.41,245.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (979.39,226.24) -- (975.41,231.72) -- (968.97,229.63) -- (968.97,222.86) -- (975.41,220.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (970.39,243.24) -- (966.41,248.72) -- (959.97,246.63) -- (959.97,239.86) -- (966.41,237.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (986.39,251.24) -- (982.41,256.72) -- (975.97,254.63) -- (975.97,247.86) -- (982.41,245.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (924.39,57.24) -- (920.41,62.72) -- (913.97,60.63) -- (913.97,53.86) -- (920.41,51.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (995.39,226.24) -- (991.41,231.72) -- (984.97,229.63) -- (984.97,222.86) -- (991.41,220.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (998.39,241.24) -- (994.41,246.72) -- (987.97,244.63) -- (987.97,237.86) -- (994.41,235.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (951.39,55.24) -- (947.41,60.72) -- (940.97,58.63) -- (940.97,51.86) -- (947.41,49.76) -- cycle ;
\draw  [color={rgb, 255:red, 126; green, 211; blue, 33 }  ,draw opacity=1 ] (658.39,146.23) -- (651.65,155.5) -- (640.75,151.96) -- (640.75,140.5) -- (651.65,136.96) -- cycle ;
\draw   (65,49) .. controls (60.33,48.95) and (57.98,51.26) .. (57.93,55.93) -- (57.1,140.93) .. controls (57.03,147.6) and (54.67,150.91) .. (50,150.86) .. controls (54.67,150.91) and (56.97,154.26) .. (56.91,160.93)(56.93,157.93) -- (56.07,245.93) .. controls (56.03,250.6) and (58.34,252.95) .. (63.01,253) ;
\draw   (1004,170) .. controls (1008.67,170.13) and (1011.06,167.86) .. (1011.19,163.19) -- (1011.21,162.39) .. controls (1011.39,155.72) and (1013.81,152.45) .. (1018.48,152.58) .. controls (1013.81,152.45) and (1011.57,149.06) .. (1011.75,142.4)(1011.67,145.4) -- (1011.81,140.19) .. controls (1011.94,135.52) and (1009.67,133.13) .. (1005,133) ;
\draw   (1005,86) .. controls (1009.67,86.13) and (1012.06,83.86) .. (1012.19,79.19) -- (1012.21,78.39) .. controls (1012.39,71.72) and (1014.81,68.45) .. (1019.48,68.58) .. controls (1014.81,68.45) and (1012.57,65.06) .. (1012.75,58.4)(1012.67,61.4) -- (1012.81,56.19) .. controls (1012.94,51.52) and (1010.67,49.13) .. (1006,49) ;
\draw   (1004,256) .. controls (1008.67,256.13) and (1011.06,253.86) .. (1011.19,249.19) -- (1011.21,248.39) .. controls (1011.39,241.72) and (1013.81,238.45) .. (1018.48,238.58) .. controls (1013.81,238.45) and (1011.57,235.06) .. (1011.75,228.4)(1011.67,231.4) -- (1011.81,226.19) .. controls (1011.94,221.52) and (1009.67,219.13) .. (1005,219) ;
\draw   (292.5,28) .. controls (287.83,28) and (285.5,30.33) .. (285.5,35) -- (285.5,143.5) .. controls (285.5,150.17) and (283.17,153.5) .. (278.5,153.5) .. controls (283.17,153.5) and (285.5,156.83) .. (285.5,163.5)(285.5,160.5) -- (285.5,272) .. controls (285.5,276.67) and (287.83,279) .. (292.5,279) ;
\draw   (492.5,119) .. controls (497.17,119) and (499.5,116.67) .. (499.5,112) -- (499.5,83.5) .. controls (499.5,76.83) and (501.83,73.5) .. (506.5,73.5) .. controls (501.83,73.5) and (499.5,70.17) .. (499.5,63.5)(499.5,66.5) -- (499.5,35) .. controls (499.5,30.33) and (497.17,28) .. (492.5,28) ;
\draw   (721.5,118) .. controls (726.17,118) and (728.5,115.67) .. (728.5,111) -- (728.5,94.5) .. controls (728.5,87.83) and (730.83,84.5) .. (735.5,84.5) .. controls (730.83,84.5) and (728.5,81.17) .. (728.5,74.5)(728.5,77.5) -- (728.5,58) .. controls (728.5,53.33) and (726.17,51) .. (721.5,51) ;
\draw   (565.5,51) .. controls (560.83,51) and (558.5,53.33) .. (558.5,58) -- (558.5,140) .. controls (558.5,146.67) and (556.17,150) .. (551.5,150) .. controls (556.17,150) and (558.5,153.33) .. (558.5,160)(558.5,157) -- (558.5,242) .. controls (558.5,246.67) and (560.83,249) .. (565.5,249) ;
\draw   (72.5,293) .. controls (72.49,297.67) and (74.81,300.01) .. (79.48,300.02) -- (222.98,300.47) .. controls (229.65,300.49) and (232.97,302.83) .. (232.96,307.5) .. controls (232.97,302.83) and (236.31,300.51) .. (242.98,300.54)(239.98,300.53) -- (386.48,300.99) .. controls (391.15,301) and (393.49,298.68) .. (393.5,294.01) ;
\draw   (397.5,294) .. controls (397.5,298.67) and (399.83,301) .. (404.5,301) -- (515,301) .. controls (521.67,301) and (525,303.33) .. (525,308) .. controls (525,303.33) and (528.33,301) .. (535,301)(532,301) -- (645.5,301) .. controls (650.17,301) and (652.5,298.67) .. (652.5,294) ;
\draw   (656.5,295) .. controls (656.53,299.67) and (658.87,301.99) .. (663.54,301.96) -- (818.04,301.07) .. controls (824.71,301.03) and (828.05,303.34) .. (828.08,308.01) .. controls (828.05,303.34) and (831.37,300.99) .. (838.04,300.95)(835.04,300.97) -- (992.54,300.06) .. controls (997.21,300.03) and (999.53,297.69) .. (999.5,293.02) ;

\draw (118,20) node [anchor=north west][inner sep=0.75pt]   [align=left] {Network};
\draw (222,344) node [anchor=north west][inner sep=0.75pt]   [align=left] {Malicious node};
\draw (123.75,215.5) node [anchor=north west][inner sep=0.75pt]   [align=left] {{\LARGE . .} {\LARGE .}};
\draw (372,3) node [anchor=north west][inner sep=0.75pt]   [align=left] {ID Pool};
\draw (584,24) node [anchor=north west][inner sep=0.75pt]   [align=left] {ID Selection Pool};
\draw (84,344) node [anchor=north west][inner sep=0.75pt]   [align=left] {Honest node};
\draw (378.75,236.5) node [anchor=north west][inner sep=0.75pt]   [align=left] {{\LARGE . .} {\LARGE .}};
\draw (374,343) node [anchor=north west][inner sep = 0.75pt]   [align=left] {Sybil ID};
\draw (472,344) node [anchor=north west][inner sep=0.75pt]   [align=left] {Honest ID};
\draw (911,93) node [anchor=north west][inner sep=0.75pt]   [align=left] {\textbf{.}\\\textbf{.}};
\draw (909,170) node [anchor=north west][inner sep=0.75pt]   [align=left] {\textbf{.}\\\textbf{.}};
\draw (826,22) node [anchor=north west][inner sep=0.75pt]   [align=left] {Shard 1};
\draw (826,107) node [anchor=north west][inner sep=0.75pt]   [align=left] {Shard k};
\draw (824,195) node [anchor=north west][inner sep=0.75pt]   [align=left] {Shard p};
\draw (888,59) node [anchor=north west][inner sep=0.75pt]   [align=left] {\textbf{.} \textbf{.} \textbf{.}};
\draw (896,142) node [anchor=north west][inner sep=0.75pt]   [align=left] {\textbf{.} \textbf{.} \textbf{.}};
\draw (888,226) node [anchor=north west][inner sep=0.75pt]   [align=left] {\textbf{.} \textbf{.} \textbf{.}};
\draw (633.65,210.96) node [anchor=north west][inner sep=0.75pt]   [align=left] {{\LARGE . .} {\LARGE .}};
\draw (27,140) node [anchor=north west][inner sep=0.75pt]   [align=left] {$\mathcal{N}$};
\draw (1023,57) node [anchor=north west][inner sep=0.75pt]   [align=left] {n};
\draw (1025,143) node [anchor=north west][inner sep=0.75pt]   [align=left] {n};
\draw (1023,229) node [anchor=north west][inner sep=0.75pt]   [align=left] {n};
\draw (262.5,118.9) node [anchor=north west][inner sep=0.75pt]  [rotate=-270.67] [align=left] {$\Lambda$};
\draw (511,66) node [anchor=north west][inner sep=0.75pt]   [align=left] {$\mathcal{M}$};
\draw (741,75) node [anchor=north west][inner sep=0.75pt]   [align=left] {$\mathcal{M'}$};
\draw (109,314) node [anchor=north west][inner sep=0.75pt]   [align=left] {Step 1: Participating ID};
\draw (424,315) node [anchor=north west][inner sep=0.75pt]   [align=left] {Step 2: ID Selection};
\draw (738,316) node [anchor=north west][inner sep=0.75pt]   [align=left] {Step 3: ID Assignment};
\draw (534,109) node [anchor=north west][inner sep=0.75pt]   [align=left] {$\mathcal{K}$};
\end{tikzpicture}
\caption{Sharding-based blockchain protocol model. Step 1: Each node participates by its ID, save a malicious one, which can participate with more than one. Step 2: Using a consensus mechanism (e.g. PoW), each node competes to add its corresponding ID/IDs to the ID Selection Pool. Step 3: Random distribution of IDs from the ID Selection Pool to shards uniformly.}
\label{fig:2}
\end{figure*}

In particular, we analyze the security of sharding-based blockchain protocols by computing the failure probability using generating function. Based on this approach, we investigate Sybil attacks and identify the parameters that can deter such attacks. More specifically, we measure the security of sharding protocols by counting the number of years to fail taking into account the failure probability of each shard (i.e., the probability that a shard exceeds the committee resiliency). To do this, we make use of generating functions. These functions are widely used in computer sciences. Rajan et al. \cite{rajan} described many applications of generating functions in engineering and applied sciences. Kohei et al. \cite{akutsu2019analysis} used joint generating function to analyze the retrial queues for cognitive wireless networks with sensing time. In blockchain systems, Wenjuan et al. \cite{zhao2019analysis} used generating function to analyze the average confirmation time of transactions. Jelena et al. \cite{misic2019modeling} used probability generating function to characterize the distribution of the number of connections per node in Bitcoin network; the objective was to model the Bitcoin delivery network.

The key contribution of this paper is to propose a tractable approach to calculate the probability that at least one committee fails using generating function and investigate Sybil attacks based on these probabilities. Note that in sharding-based blockchain protocols, the network is compromised if only one shard is compromised (i.e., 1\% attack); this is why we compute the probability that at least one committee fails. The proposed approach outperforms, in terms of the computation accuracy, the mathematical models proposed in existing contributions \cite{hafid2019methodology}, \cite{hafid2019model}, \cite{rajab2020feasibility}; it also achieves similar computation accuracy as JHDA  \cite{hafid2020joint} in estimating the failure probability, but with much less computational complexity.

The limitations in \cite{hafid2019methodology}, \cite{hafid2019model}, \cite{rapidchain}, \cite{rajab2020feasibility} come from the fact that they assume that the failure probability in the first committee is indicative of the failure probability in any other committee; more specifically, they assume that the failure probability of one epoch is the failure probability of the first committee times the number of committees \cite{hafid2019methodology}, \cite{hafid2019model}, \cite{rapidchain}. However, when the sampling is done without replacement, the samples are not independent; this means that when we sample the first committee, it is clear that the parametrizations of the model change (i.e., the number of nodes in the network which is the number of IDs, as well as the number of malicious nodes which is the number of Sybil IDs. Thus, the failure probability of the second committee will be different from the first, and the third will be different from the first and the second, until the last committee. In addition, there are significant changes in the various parameters from the first to the second to the last sampled committee; this means that the inaccuracy of the estimate proposed in \cite{hafid2019methodology}, \cite{hafid2019model}, \cite{rajab2020feasibility}, grows with the number of committees. In a more recent work, Hafid et al. \cite{hafid2020joint} filled this gap by proposing an approach, called JHDA, that takes into consideration the failure probability of each shard. However, the key limitation of this approach (i.e., JHDA) is its complexity; indeed, it is not practical to accurately compute the failure probability using JHDA; we can only estimate it by executing a large number of trials \cite{hafid2020joint}. In this paper, we address this gap by proposing a new approach called Probabilistic Generating Function Approach (PGFA). Furthermore, we investigate the threat of Sybil attacks based on the probabilities of failure computed by PGFA. Specifically, the contributions of this paper can be summarized as follows:
\begin{itemize}
    \item We propose a tractable probabilistic methodology to analyze the security of sharding-based blockchain protocols using generating function;
    \item We investigate the threat of Sybil attacks based on these probabilities;
    \item We compare, in terms of the computational complexity, PGFA with the the most accurate existing approach (i.e., JHDA);
    \item We identify the parameters that can reduce the impact (in terms of threat severity) of Sybil attacks.
\end{itemize}

The paper is organized as follows. Section \ref{sec: Analytical Model} presents the proposed Probabilistic Generating Function Approach (PGFA) and compares it (in terms of complexity) with JHDA. Section \ref{sec: Results and Evaluation} evaluates PGFA and compares it with Break Consensus Protocol (BCP) \cite{rajab2020feasibility}. Finally, Section \ref{sec: Conclusion} concludes the paper.

\section{Analytical Model} \label{sec: Analytical Model}
In this section, we describe our approach, PGFA, to calculate/compute the probability that at least one committee fails using generating function.
\subsection{Abbreviations and Definitions}\label{AA}
Table $\ref{table:1}$ shows the list of symbols and variables that are used to describe the proposed PGFA as well as JHDA.
\begin{table}[ht]
\caption{Notations}
\label{table:1}
\setlength{\tabcolsep}{3pt}
\begin{tabular}{|p{50pt}|p{180pt}|}
\hline
Notation&
Description \\
\hline
$\mathcal{N}$  &
Total number of nodes \\
$\Lambda$  &
Total number of IDs in the ID Pool ($\Lambda = \mathcal{N} - 1 + \mathcal{M}$) \\
$\mathcal{M}$  &
Total number of Sybil IDs in the ID Pool \\
$\mathcal{M'}$  &
Total number of Sybil IDs in the ID Selection Pool ($ \mathcal{M'} \leq \mathcal{M} $) \\
$m_{i}$ &
Number of Sybil IDs in shard i \\
$\mathcal{K}$  &
Total number of IDs in the ID selection Pool ($ \mathcal{K} \leq \Lambda $)\\
$n$             &
Size of the committee\\
$r$             &
Committee resiliency\\
$\mathcal{R}$    &
Resiliency of the ID Selection Pool\\
$\lambda$         &
Number of committees\\
$p_{e}$ &
Epoch failure probability\\
$\mathcal{A}$&
Average number of years to failure\\
$E_{s}$ &
Expected number of sharding rounds until failure \\
$N_{s}$&
Number of sharding rounds per year\\
$t$&
Number of trials\\
$\left[ x^{\kappa} \right] \Psi(x)$ &
Coefficient of $x^{\kappa}$ in $\Psi(x)$ \\
$\mathcal{P}$&
Probability of selecting at least $m$ Sybil IDs from the ID Pool \\
$\mathcal{P^{'}}$&
Probability that at least one committee fails\\
$\mathcal{P^{''}}$ &
Probability of a successful attack\\
\hline
\end{tabular}
\end{table}

\textbf{Definition 1}. Ordinary Generating Function. The ordinary generating function for the sequence $(u_{z})_{z \geq 0}$ is the power series, which can be expressed as follows:
 \begin{equation}
u_{0} + u_{1}x^{1} + u_{2}x^{2} + u_{3}x^{3} +  \cdots   \label{eq:1}
\end{equation}

\textbf{Definition 2}. Committee Resiliency. The maximum percentage of Sybil IDs that the committee can contain/support whereas still being secure.

\textbf{Definition 3}. Total Resiliency. The maximum percentage of malicious nodes that the whole network can contain whereas still being secure. It is the maximum percentage of malicious nodes that the entire network can tolerate/support without compromising its security.

\textbf{Definition 4}. ID Pool. ID Pool contains IDs (Sybil and honest IDs) generated by the nodes (honest or malicious nodes); each node generates its own ID, save the ones, which can generate many Sybil IDs.

\textbf{Definition 5}. Adversary's hash-rate. The percentage of adversary's hash-power in participating in the ID Selection Pool (e.g., if an adversary controls $30$ Sybil IDs in an ID Selection Pool that contains 100 IDs, thus the adversary's hash-rate will be $30\%$).

\textbf{Definition 6}. ID Selection Pool. ID Selection Pool is constructed in each epoch using a consensus mechanism (e.g. \textit{PoW}) and contains the total number of required and valid/qualified IDs; it contains the number of IDs that is necessary in participating in this epoch; this number depends of the security of the network.

\textbf{Remark}. It is worth noting that a honest node can participate with many honest IDs.

\subsection{Probability of Selecting Sybil IDs from the ID Pool}
In this section, we compute the probability of selecting Sybil IDs from the ID Pool during the construction of the ID Selection Pool.

Figure \ref{fig:2} shows a worst-case scenario of a sharding-based blockchain protocol. In this scenario, we assume that each honest node is able to generate its own ID and one strong (in terms of hash rate) malicious node (aka one adversary) generates numerous Sybil IDs. The sharding process consists of $3$ steps. In the first step, each node participates by its own ID, save a malicious node, it participates with $\mathcal{M}$ IDs. In the second, we construct the ID Selection Pool from the ID Pool. More specifically, using a consensus mechanism (e.g. PoW and PoS), each node competes to generate a valid/qualified ID to join the ID Selection Pool, save the malicious, it adds $\mathcal{M^{'}}$ Sybil IDs ($\mathcal{M^{'}} \leq \mathcal{M}$) thanks to its high hash power.
In the third step, we randomly distribute (i.e., random assignment) IDs from from the ID Selection Pool to shards.

A few sharding-based Blockchain protocols (e.g. Ethereum sharding \cite{ethereumsharding}) adopt the PoS-based node/ID selection method to select shard members to defend against Sybil attacks. However, in most sharding-based blockchain protocols (e.g., Elastico \cite{elastico}, OmniLedger \cite{omniledger} and RapidChain \cite{rapidchain}), \textit{Proof-of-Work} (\textit{PoW}) consensus is typically used to establish the committee/shard members (committee formation) and generate the corresponding IDs; Byzantine Fault Tolerant (BFT) is used for the intra-committee consensus, which is used within a committee to create and append the blocks \cite{rapidchain}, \cite{hafid2020scaling}. More specifically, nodes who want to join/stay in the protocol use \textit{PoW} consensus to generate valid IDs (i.e., public keys). Only the nodes that can solve the ID generation \textit{PoW} puzzle (e.g. RapidChain uses a fresh fixed \textit{PoW} puzzle \cite{rapidchain}) can generate valid IDs. It turns out that the nodes that have a higher hash-rate have a higher probability to solve the ID generation \textit{PoW} puzzle compared to those of lower hash-rate.
The security of the network will not be compromised as long as the malicious node's computational power is limited.

Now, let $\mathcal{X}$ be a random variable that counts the number of Sybil IDs selected from the ID Pool. In the following, we compute the probability of selecting \textit{exactly} $m$ Sybil IDs from the ID pool (\textbf{Lemma 1}) and then the probability of selecting \textit{at least} $m$ Sybil IDs from the ID pool (\textbf{Lemma 2}).

\textbf{Lemma 1:} In a sharding-based blockchain protocol, the probability of selecting \textit{exactly} $m$ Sybil IDs from the ID pool is given by:
\begin{equation}
    P(\mathcal{X} = m) = \frac{ \binom{\mathcal{M}}{m}  \binom{\mathcal{N} -1}{\mathcal{K} -m} }{ \binom{\Lambda}{\mathcal{K}} }
\end{equation}

\textbf{Proof:} In a sharding-based blockchain protocol, the process of assigning IDs to shards can be modeled as a random sampling without replacement, because the shards can not overlap. In this case, the hypergeometric distribution yields a better probability approximation compared to any other probability distribution, including that of Binomial's \cite{distinguishing}. Thus, the proof of \textbf{Lemma 1} is a direct result from the fact that $X$ follows a hypergeometric distribution \cite{distinguishing}, \cite{hafid2020joint}.

\textbf{Lemma 2:} In a sharding-based blockchain protocol, the probability of selecting \textit{at least} $m$ Sybil IDs from the ID pool can be computed as follows:
\begin{equation}
    P(\mathcal{X} \geq m ) = \sum_{s = m}^{\mathcal{K}} \frac{ \binom{\mathcal{M}}{s}  \binom{\mathcal{N} -1}{\mathcal{K} -s} }{ \binom{\Lambda}{\mathcal{K}} }
\end{equation}

\textbf{Proof:} Given the fact that $\mathcal{X}$ follows a hypergeometric distribution, the proof of \textbf{Lemma 2} can be extracted directly from the cumulative hypergeometric distribution \cite{distinguishing}.

The following subsection will be devoted to compute and calculate the probability that at least one shard fails.
\subsection{Probability that at least one Shard Fails}
In this section, we compute the probability that at least one shard fails in a sharding-based blockchain protocol using the proposed approach (i.e., PGFA). First, we briefly describe how JHDA \cite{hafid2020joint} computes such a probability. Then, we present the details of the proposed PGFA.
\subsubsection{Joint Hypergeometric Distribution Approach (JHDA)}
In a more recent work, Hafid et al. \cite{hafid2020joint} proposed a novel methodology-based joint hypergeometric distribution to analyze the security of sharded protocols, which can be summarized in \textbf{Theorem 1} (see proof in \cite{hafid2020joint}).

Now, let $\mathcal{Y}_i$ be a random variable that computes the number of Sybil IDs in shard $i$. \textbf{Theorem 1} computes the probability that at least one shard fails using JHDA.

\textbf{Theorem 1:} In a sharding-based blockchain protocol, the probability that at least one shard fails using JHDA can be expressed as follows:
\begin{equation} \label{eq:11}
 \mathcal{P^{'}} = 1 - P(\mathcal{Y}_i \leq nr, i \in \{1, 2, \dots, \lambda \} \end{equation}
where
\begin{eqnarray}
 P(\mathcal{Y}_i \leq nr, i \in \{1, 2, \dots, \lambda \}) \\
= \sum_{m_1=0}^{nr} \sum_{m_2=0}^{nr} \dots \sum_{m_\lambda =0}^{nr} \prod_{i=1}^{\lambda} \binom{n}{m_i} \bigg / \binom{\mathcal{K}}{\mathcal{M'}}
\end{eqnarray}
The limitation of JHDA comes from the fact that this approach requires a high computation power due to its high complexity. We address this limitation in the following subsection, where we introduce a Probabilistic Generating Function Approach (PGFA) as an alternative solution to analyze the security of sharding-based blockchain protocols.
\subsubsection{Generating Function Approach}
Generating function transforms problems about sequences into problems about functions. With generating function, we can then apply many and several machinery problems to problems about sequences. They can also be used to find closed-form expressions for sums, to solve counting problems, and to solve recurrence relations \cite{lehman2010mathematics}. There are few classes of generating function in common use (e.g., exponential generating function \cite{petersen2019inquiry} and Ordinary Generating Function (OGF) \cite{lehman2010mathematics}). In this paper, we use the ordinary class, because it is useful for solving counting problems; in particular, problems involving choosing items (i.e., sampling with/without replacement) from a set (entire network in our case). Ordinary generating function does often lead to a polynomial function by letting the coefficient of $x^{k}$ be the number of ways to choose $k$ items (nodes in our case).

\subsection{Modeling}
In sharding-based blockchain protocols, the process of assigning IDs to committees (or partition of the network into committees/shards) can be defined as a sampling without replacement, because the committees do not overlap \cite{hafid2019model}. When the sample is done without replacement, we make use of the hypergeometric distribution instead of binomial's \cite{hafid2019model}, \cite{distinguishing}. Note that to model this sampling using the hypergeometric distribution, we need to make use of joint hypergeometric distribution to cover the failure probabilities of all committees, which is a complex/difficult to compute; it is a closed-form expression. This is the reason why we choose generating function. Generating function is fundamentally devoted to such complicated problems.

The generating function corresponding to select \textbf{\textit{distinct}} items from a finite set (as sampling \textbf{\textit{without replacement}}) can be expressed as follows:
\begin{equation}
\binom{n}{0} + \binom{n}{1}x^{1} + \binom{n}{2}x^{2} + \binom{n}{3}x^{3}+ \dots + \binom{n}{k} x^{k }  \label{eq:sampling_without_replacement}
\end{equation}
where \(\binom{n}{k}\) is the number of ways/possibilities to choose/select $k$ distinct items from a set of size $n$; it can be expressed as follows:
\begin{equation}
\binom{n}{k} = \frac{n!}{k! (n - k)!} \label{eq:binom}
\end{equation}
The main aim of our analysis is how to divide $m$ malicious nodes between $\lambda$ committees without exceeding the resiliency of each committee. Let $ m = m_{1} + m_{2} + \dots + m_{\lambda} $ where $m_{1}$ is the number of Sybil IDs in the first committee, $m_{2}$ is the number of Sybil IDs in the second committee, and so on. We need to divide $m$ Sybil IDs, whereas for all $i \in \{ 1, 2, \cdots, \lambda \}$,  $m_{i}$ is smaller than the resiliency of the committee (e.g., $r = \frac{1}{2}$ for RapidChain \cite{rapidchain}).

Now, based on \eqref{eq:sampling_without_replacement}, the generating function that represents one committee can be expressed as follows:
\begin{equation}
\psi(x) = \binom{n}{0} + \binom{n}{1}x^{1} + \binom{n}{2}x^{2} + \dots + \binom{n}{\lfloor nr \rfloor} x^{\lfloor nr \rfloor }  \label{eq:shard}
\end{equation}
Precisely, if we assume \eqref{eq:shard} refers to shard 1, thus $m_{1}$ can take 0 , 1 , 2 , \dots, or  $\lfloor nr \rfloor$ Sybil IDs. And if \eqref{eq:shard} refers to shard 2, $m_{2}$ also can take 0 , 1 , 2 , \dots, or  $\lfloor nr \rfloor$ malicious nodes, and so on for the other shards. Based on \eqref{eq:shard}, the number of possibilities for shard 1 to receive $m_{1}$ = 0 malicious nodes (i.e., shard 1 does not contain any malicious node) is $\binom{n}{0}$, the number of possibilities for shard 1 to receive $m_{1}$ = 1 malicious nodes (i.e., shard 1 contains one malicious node) is $\binom{n}{1}$; thus, the number of possibilities for shard 1 to get $m_{1}$ = $\lfloor nr \rfloor$ Sybil IDs is $\binom{n}{\lfloor nr \rfloor}$. Our first objective is to calculate the number of possibilities we can split $m$ malicious nodes between $\lambda$ committees without exceeding the committee resiliency (i.e., without exceeding the maximum number of Sybil IDs that the committee can tolerate; this number is $\lfloor nr \rfloor$ in \eqref{eq:shard}). Then, we can compute the failure probability, which represents the probability that at least one committee exceeds the committee resiliency.

Generally, the generating function for choosing elements from a union of disjoint sets is the product of the generating functions from choosing from each set \cite{lehman2010mathematics}. In our case, we have $\lambda$ committees which do not overlap (the sampling is done without replacement). Indeed, the entire network is the union of disjoint committees; it can be modeled as follows:
\begin{equation}
C = \bigcup_{i=1}^{\lambda} C_{i} \label{eq:union}
\end{equation}
where $C$ is a set which contains all nodes in the entire network with  $card(C) = N$, $C_{i}$ contains the number of nodes in committee $i$  with $card(C_{i}) = n $ for all $i \in \{ 1, 2, \cdots, \lambda \}$, and for all $i, j \in \{ 1, 2, \cdots, \lambda \}$, $C_{i} \cap C_{j} = \emptyset $ for $i \neq j$.
To compute the total number of ways we can distribute the $m$ Sybil IDs across all committees, we multiply this generating function with itself $\lambda$ times:

\begin{equation}
\Psi(x)= \left( \binom{n}{0} + \binom{n}{1}x^{1} + \binom{n}{2}x^{2}+ \dots + \binom{n}{\lfloor nr \rfloor} x^{\lfloor nr \rfloor}\right)^{\lambda}  \label{eq:Psi_1}
\end{equation}
where
\begin{equation}
\Psi(x)= \left( \psi(x)\right)^{\lambda} \label{eq:Psi_2}
\end{equation}
Now, we need to extract the coefficient of $x^{m}$ in \eqref{eq:Psi_1}, which corresponds to the number of possibilities we can split $m$ Sybil IDs across $\lambda$ committees without exceeding the resiliency of each committee (note that all the committees have the same resiliency). To compute the sequence of coefficients from this generating function, we need to compute the \textit{Taylor series} for this generating function \cite{lehman2010mathematics}. Therefore, the required coefficient can be expressed as follows:
\begin{equation}
\left[ x^{m} \right] \Psi(x) = \frac{\Psi^{m}(0)}{m!}  \label{eq:coefficient}
\end{equation}
where $ \Psi^{m}(0)$ is the $m$th derivative of $\Psi(x)$ evaluated at $x = 0$.

The required coefficient can be determined explicitly (analytically) by using \eqref{eq:coefficient}; however, this process involves tedious and complex calculations. Instead, we can determine the coefficient computationally by using \textit{SymPy} package \cite{meurer2017sympy}; it uses the symbolic math system making the process easier to execute.

The probability that at least one committee fails is the probability that at least one committee contains more than $nr$ Sybil IDs. This means that the number of Sybil IDs in the committee exceeds the committee resiliency. Therefore, the probability that at least one committee fails using PGFA is expressed in \textbf{Theorem 2}.

\textbf{Theorem 2:} In a sharding-based blockchain protocol, the failure probability that at least one committee fails using PGFA can be expressed as follows:
\begin{equation}
\mathcal{P^{'}} = 1 - \frac{\left[ x^{m} \right] \Psi (x)}{\binom{\mathcal{N}}{m}}   \label{eq:9}
\end{equation}
where  \(\binom{ \mathcal{N}}{m}\) is the total number of possibilities to select $m$ Sybil IDs from $\mathcal{N}$ IDs.

\subsection{Probability of a Successful Attack}
In this section, we compute the probability of a successful attack (the failure probability of the entire network); this means that we take into consideration the probability of selecting Sybil IDs from the ID Pool as well as the probability of at least one shard takeover attack.

\textbf{Theorem 3:} Given a sharding-based blockchain protocol, the probability of a successful attack (assumed by an adversary) can be computed as follows:

\begin{equation}
   \mathcal{P^{''}} = \sum_{s = m}^{\mathcal{K}} \frac{ \binom{\mathcal{M}}{s}  \binom{\mathcal{N} -1}{\mathcal{K} -s} }{ \binom{\mathcal{N} -1 + \mathcal{M}}{\mathcal{K}} } \left(  1 - \frac{\left[ x^{m} \right] \Psi (x)}{\binom{ \mathcal{N}}{m}} \right).
\end{equation}

\textbf{Proof:} By taking into consideration both probabilities (i.e., the probability of selecting Sybil IDs from the ID pool as well as the probability that at least one shard fails), and based on \textbf{Lemma 2} and \textbf{Theorem 2}, the probability of a successful attack ($\mathcal{P^{''}}$) can be expressed as follows.

\begin{equation} \label{eq:successful_attack}
\begin{split}
\mathcal{P^{''}} & = P( \mathcal{X} = nr) \mathcal{P^{'}} + \dots + P(\mathcal{X} = \mathcal{K}) \mathcal{P^{'}} \\
 & = \big ( P(\mathcal{X}= nr) + \dots + P(\mathcal{X} = \mathcal{K}) \big ) \mathcal{P^{'}} \\
 & = \sum_{k=nr}^{\mathcal{K}} P(\mathcal{X} \geq k) \mathcal{P^{'}}
\end{split}
\end{equation}

\subsection{Years to Fail}
To measure the security of a given protocol, we propose to compute the average number of years to failure. To perform this computation, we need to determine the failure probability of epoch per sharding round, which refers to the failure probability that at least one committee fails. The average number of years to fail corresponding to PGFA is given by:
\begin{equation}
\mathcal{A} = \frac{E_{s}}{N_{s}}, \hspace{0.5cm} where \hspace{0.5cm} E_{s} = \frac{1}{\mathcal{P^{''}}}
\label{eq:12}
\end{equation}

The average number of years to fail corresponding to JHDA ($\mathcal{P'}$ must be calculated by \textbf{Theorem 1}) is given by:
\begin{equation}
\mathcal{A} = \frac{E_{s}}{N_{s}}, \hspace{0.5cm} where \hspace{0.5cm} E_{s} = \frac{1}{p_{e}}
\label{eq:13}
\end{equation}
where $$ p_{e} = \mathcal{P} \times \mathcal{P'} $$

\subsection{Complexity Comparison}
Table \ref{table:complexity} shows a comparison (in terms of complexity) between PGFA and JHDA.
\begin{table}[ht]
\renewcommand{\arraystretch}{1.3}
\caption{Complexity Comparison between PGFA and JHDA.}
\label{table:complexity}
\centering
\begin{tabular}{c||c}
\hline
\bfseries Approach & \bfseries Complexity\\
\hline\hline
JHDA \cite{hafid2020joint} & $O((nr -1)^{\lambda})$\\
PGFA  & O(nr - 1)\\
\hline
\end{tabular}
\end{table}
Specifically, Table \ref{table:complexity} shows that JHDA is very difficult and impractical to compute whereas PGFA shows a linear complexity. Thus, the feasibility of PGFA to analyze the security of sharding-based blockchain protocols.
\section{Results and Evaluation} \label{sec: Results and Evaluation}
In this section, we compare (in terms of accuracy) PGFA and JHDA \cite{hafid2020joint} via simulations. In particular, we compute the probability of selecting Sybil IDs from the ID Pool to construct the ID Selection Pool as well as the failure probability that at least one committee fails using PGFA and JHDA. These probabilities represent the failure probability of the whole network in one sharding round (i.e., one epoch). We also investigate the threat of Sybil attacks and identify the parameters that impact (in terms of threat severity) these attacks.
\subsection{Simulation Setup}
To implement our approach, we use \textit{SymPy Python library}, which makes the use of symbolic mathematics easier \cite{meurer2017sympy}, (e.g., polynomial functions). Particularly, we use \textit{sympy.Symbol()} and \textit{sympy.Poly()} to declare the variable ``x" explicitly and  to explicitly express the polynomial in \eqref{eq:shard}. To implement JHDA, we refer the readers to \cite{hafid2020joint}.

\begin{algorithm}
\caption{Algorithm for Computing $\mathcal{P^{'}}$ (PGFA)}
\newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{blue}{#1}}
\SetCommentSty{mycommfont}
\SetKwInput{KwInput}{Input}
\SetKwInput{KwOutput}{Output}

\SetKwFunction{FPGFA}{PGFA}
\SetAlgoLined
\DontPrintSemicolon
\KwInput{$\mathcal{K}$ (IDs in the ID Selection Pool), $n$ (Committee size), $\mathcal{M'}$ (Sybil IDs), $r$ (Committee resiliency) }
\KwOutput{$\mathcal{P^{'}}$ \tcp*{Probability that at least one shard fails using PGFA} }
\SetKwProg{Fn}{Function}{:}{}
\Fn{\FPGFA{$\mathcal{K}$, $n$, $\mathcal{M'}$, $r$}}{
    $ \lambda \gets \lfloor \frac{\mathcal{K}}{n} \rfloor$  \tcp*{ Number of shards}
    $a \gets [\hspace{0.2 cm}]$ \tcp*{Empty list}
    \For{$ \forall i \in \mathcal{D} = \langle \lfloor r \times n \rfloor, \lfloor r \times n \rfloor - 1, \dots, 0 \rangle $}
    {
   $a \gets \langle \binom{n}{ \lfloor r \times n \rfloor}, \binom{n}{\lfloor r   \times n \rfloor- 1}, \dots, 0 \rangle $ \tcc{Vector with $\lfloor r   \times n \rfloor + 1$  components} \;
   $ X \gets \langle x, x, \dots, x \rangle $ \tcc{Vector with $\lfloor r \times n \rfloor + 1$ components} \;
   $ \psi(x) \gets a \cdot X =  \sum_{i= \lfloor r \times n \rfloor}^{0} \binom{n}{i} x $  \tcc{$a \cdot X$ means the dot product of vectors $a$ and $X$. $\psi(x)$ is a polynomial with variable $x$ and coefficients  $\{ \binom{n}{i}, \forall i \in \mathcal{D} \} $ }
   }
   $ \Psi(x) \gets \big ( \psi(x) \big)^{\lambda} = \big( \sum_{i= }^{0} \binom{n}{i} x \big )^{\lambda} $ \tcc{$\psi(x)$ power the number of shards ($\lambda$)}

   $ \zeta \gets [x^{\mathcal{M'}}] \Psi(x) $ \tcc{Coefficient of $x^{\mathcal{M'}}$ in $\Psi(x)$, which corresponds to the number of possibilities to distribute $\mathcal{M'}$ Sybil IDs across $\lambda$ shards (see Equation \ref{eq:coefficient})}

   $\mathcal{P'} \gets 1 - \frac{\zeta}{\binom{\mathcal{K}}{\mathcal{M'}}}$ \;

     \KwRet $\mathcal{P'}$ \;
}
\end{algorithm}

Table \ref{table:2} shows the values of the parameters used in the simulations.
\begin{table}[ht]
\renewcommand{\arraystretch}{1.3}
\caption{Parameter Settings}
\label{table:2}
\centering
\begin{tabular}{c||c}
\hline
\bfseries Parameter & \bfseries Value\\
\hline\hline
$\mathcal{N}$ & 1000, 1200, 1400\\
$\mathcal{K}$ & 400, 600, 800\\
$\mathcal{M}$ & 200, 250\\
$\mathcal{M'}$ & 125, 200, 250\\
$r$ & 0.25, 0.27, 0.333\\
$\mathcal{R}$ & 0.20, 0.25, 0.333\\
$N_s$ & 365, 185\\
$n$ & 80, 100, 200\\
\hline
\end{tabular}
\end{table}
\subsection{Results and Analysis}
\begin{figure*}[ht]
\centering
\includegraphics[width = 1 \textwidth]{Figures/comparison-JHDA-PGFA.pdf}
\caption{Comparison between JHDA and PGFA for different network sizes, values of resiliency, and number of trials.}
\label{fig:comparison_JHDA_PGFA}
\end{figure*}
Figure \ref{fig:comparison_JHDA_PGFA} shows a comparison between JHDA and PGFA for different ID Selection Pool sizes ($\mathcal{K}$), values of resiliency ($r$ and $\mathcal{R}$), and numbers of trials ($t$) when varying the size of the committee from 25 to 250 by a step of 25.

More specifically, Figures \ref{fig:comparison_JHDA_PGFA}(a), \ref{fig:comparison_JHDA_PGFA}(b), and \ref{fig:comparison_JHDA_PGFA}(c) show that the performance of FPGA is close to JHDA. Figure \ref{fig:comparison_JHDA_PGFA}(d) shows a much closer match between the results achieved by PGFA and JHDA. This is expected since, for JHDA, when the number of trials ($t$) increases the estimated failure probability moves towards the exact failure probability \cite{hafid2020joint}. We conclude that the proposed PGFA allows for an accurate computation of the failure probability.

\begin{figure*}[ht]
\centering
\includegraphics[width= 1 \textwidth]{Figures/Probability-Successful.pdf}
\caption{ Performance of PGFA on computing failure probability of selecting Sybil IDs from the ID Pool ($\mathcal{P}$), failure probability for at least one shard takeover attack ($\mathcal{P'}$), and probability of a successful attack ($\mathcal{P''}$) when varying the number of Sybil IDs from 10 to 200 (by a step of 10 IDs) for different network sizes ($\mathcal{N}$), values of committee resiliency ($r$), values of ID Selection Pool resiliency ($\mathcal{R}$), ID Selection Pool sizes ($\mathcal{K}$), and for different values of the size of the committee (n).}
\label{fig:r}
\end{figure*}

Figure \ref{fig:r} shows the failure probability of selecting Sybil IDs from the ID Pool ($\mathcal{P}$), the failure probability for at least one shard takeover attack ($\mathcal{P'}$), and the probability of a successful attack ($\mathcal{P''}$) when varying the number of Sybil IDs (we assume that $\mathcal{M}$ = $\mathcal{M'}$; the worst case that can happen) from 10 to 200 (by a step of 10 IDs) for different network sizes, values of committee resiliency, values of ID Selection Pool resiliency, ID Selection Pool sizes, and for different values of committee size (n). These results show that the failure probability increases with the number of Sybil IDs means a high hash-rate of the adversary; this increases the probability to compromise the security of the network. In particular, Figures \ref{fig:r} (a), \ref{fig:r} (b), and \ref{fig:r} (c) show the failure probability of selecting Sybil IDs from the ID Pool for different network size ($\mathcal{N}$ = 1000, $\mathcal{N}$ = 1200, and $\mathcal{N}$ = 1400), ID Selection Pool resiliency ($\mathcal{R}$ = 0.333, $\mathcal{R}$ = 0.25, and $\mathcal{R}$ = 0.20), and for different ID Selection Pool size ($\mathcal{K}$ = 400, $\mathcal{K}$ = 600, and $\mathcal{K}$ = 800), respectively. More specifically, Figure \ref{fig:r} (a) shows that as the network size increases (in this case, we set of the size of the ID Pool Selection to 800 IDs, and the resiliency of ID Selection Pool to 0.333) the failure probability ($\mathcal{P}$) delays to assume big values; this shows up the impact of the network size on the security of the network. Figure \ref{fig:r} (b) shows that when the committee resiliency gets larger the failure probability ($\mathcal{P}$) delays to assume values close to 1; this shows that a higher ID Selection Pool resiliency allows for higher security.

Figure \ref{fig:r} (c) shows the impact of the size of the ID Selection Pool on the failure probability ($ \mathcal{P}$). We observe that as the size of ID selection pool gets larger the failure probability is slow to assume values closer to 1; thus, the larger the size of the ID Selection Pool the higher the security of the network.

In addition, Figures \ref{fig:r} (d), \ref{fig:r} (e), and \ref{fig:r} (f) show the failure probability that at least one shard takeover attack ($\mathcal{P'}$) for different ID Selection Pool sizes, values of the committee resiliency, and committee sizes, respectively.

More specifically, Figure \ref{fig:r} (d) shows the impact of the size of the ID Selection Pool ($\mathcal{K}$ = 600 and $\mathcal{K}$ = 700; in this case, we set $\mathcal{N}$ to 1000, r to 0.333, and $n$ to 100) on the failure probability ($\mathcal{P'}$). We observe that as the size of ID Selection Pool gets larger the failure probability is slow to assume values closer to 1; thus, the larger the size of the ID Selection Pool the higher the security of the network.

Figure \ref{fig:r} (e) shows the impact of the committee resiliency ($r$) on the failure probability ($\mathcal{P'}$). We observe that as the committee resiliency gets larger the failure probability is slow to assume values closer to 1; thus, the larger committee resiliency the higher the security of the network.

Figure \ref{fig:r} (f) shows the impact of the committee size ($r$) on the failure probability ($\mathcal{P'}$). We observe that as the committee size gets larger the failure probability is slow to assume large values (i.e., values closer to 1); thus, the larger the size of the committee the higher the security of the network.

Figures \ref{fig:r} (g), \ref{fig:r} (h), and \ref{fig:r} (i) show the probability of a successful attack ($\mathcal{P''}$) when varying the number of Sybil IDs ($\mathcal{M}$) from 10 to 200 by a step of 10. We observe that the failure probability ($\mathcal{P''}$) increases with the number of Sybil IDs (generated by an adversary).
This is expected, since the increase in the number of Sybil IDs leads to an increase of the chance of an adversary to compromise the security of the network.

More specifically, Figure \ref{fig:r} (g) shows the impact of the network size ($\mathcal{N}$) on the probability of a successful attack ($\mathcal{P''}$); in this case, we set $r$ to 0.25, $\mathcal{R}$ to 0.10 , $\mathcal{K}$ to 800, and $n$ to 100. We observe that as the network size gets larger the probability of a successful attack is slow to assume values closer to 1; thus, the larger size of the network the higher the security of the network.

Figure \ref{fig:r} (h) shows the impact of the committee resiliency ($r$) on the probability of a successful attack ($\mathcal{P''}$); in this case, we set $\mathcal{N}$ to 1000, $\mathcal{R}$ to 0.10, $\mathcal{K}$ to 800, and $n$ to 100. We observe that as the committee resiliency gets larger the probability of a successful attack is slow to assume values closer to 1; thus, the larger committee resiliency the higher security of the network.

Finally, Figure \ref{fig:r} (i) shows the impact of the size of the committee ($n$) on the probability of a successful attack ($\mathcal{P''}$); in this case, we set $\mathcal{N}$ to 1000, $\mathcal{R}$ to 0.10, $\mathcal{K}$ to 800, and $r$ to 0.25. We observe that as the size of the committee gets larger the probability of a successful attack is slow to assume values closer to 1; thus, the larger size of the committee the higher security of the network.

To sum up, Figure \ref{fig:r} shows that by taking advantage of PGFA we get a promising results. In particular, we identify the parameters that impact the probability of a successful attack. This means $\mathcal{N}$, $\mathcal{K}$, $\mathcal{M}$, $\mathcal{M'}$, $n$, $\lambda$, $r$, and $\mathcal{R}$.

\begin{table*}[ht]
\centering
\caption{Computation of Years to Fail by PGFA}
\label{table:3}
\setlength{\tabcolsep}{6pt}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
$\mathcal{N}$ &
$\mathcal{K}$ &
$\mathcal{M}$ &
$\mathcal{M'}$ &
$n$ &
$\lambda$ $^{\mathrm{a}}$ &
$r$ &
$\mathcal{R}$ &
$\mathcal{P}$ &
$\mathcal{P^{'}}$ &
$\mathcal{P^{''}}$ &
$N_{s}$ &
$\mathcal{A}$ $^{\mathrm{c}}$ &
Secure \\
\hline
1000 &
800&
200&
200&
100&
8 &
0.333&
0.20&
2.04e-06 &
1.56e-01 &
3.18e-07 &
365 &
8623.61 &
$\textcolor{green}{\checkmark } $\\
1000 &
800&
200&
200&
100&
8 &
0.333&
0.20&
2.04e-06 &
1.56e-01 &
3.18e-07 &
185 &
17014.16 &
$\textcolor{green}{\checkmark } $\\
1400&
800&
200&
200&
200&
8 &
0.333&
0.20&
9.25e-13 &
1.56e-01 &
1.49e-13 &
365 &
19e08 &
$\textcolor{green}{\checkmark } $ \\
1000&
800 &
200 &
200 &
100 &
8 &
0.333 &
0.15 &
9.83e-01 &
1.56e-01 &
1.53e-01 &
365 &
1.02e-02 &
$\textcolor{red}{\times} $\\
1000 &
800&
250 &
250 &
100 &
8 &
0.333 &
0.20 &
4.79e-01 &
9.94e-01&
4.77e-01&
365 &
3.37e-02&
$\textcolor{red}{\times} $\\
1000 &
800&
250 &
250 &
100 &
8 &
0.333 &
0.20 &
4.79e-01 &
9.94e-01&
4.77e-01&
185 &
1.13e-02 &
$\textcolor{red}{\times} $\\
1000 &
800 &
250 &
125 &
100 &
8 &
0.333 &
0.20 &
4.79e-01 &
5.69e-06 &
2.73e-06 &
185 &
1980.16 &
$\textcolor{green}{\checkmark }$\\
1000 &
800 &
250 &
125 &
80 &
10 &
0.333 &
0.20 &
4.79e-01 &
1.61e-04 &
7.73e-05 &
185 &
69.97 &
$\textcolor{red}{\times} $ \\
\hline
\multicolumn{10}{p{295pt}}{$^{\mathrm{a}}$ $\lambda$ = $\frac{\mathcal{K}}{n}$;
$^{\mathrm{c}}$: Years to fail, which is calculated by using the formula described in \eqref{eq:12}.}
\end{tabular}
\label{tab:Years to Fail}
\end{table*}
Table \ref{tab:Years to Fail} shows the probability of a successful attack ($\mathcal{P^{''}}$) and the average number of years to fail ($\mathcal{A}$) for
different parameters (i.e., $\mathcal{N}$, $\mathcal{K}$, $\mathcal{M}$, $\mathcal{M'}$, $n$, $\lambda$, $r$, $\mathcal{R}$, and $N_s$). We observe that when we change the values of some parameters (even small changes), the network security can be considerably impacted. For example, Table \ref{tab:Years to Fail} shows that for $\mathcal{R}$ = 0.2, the  number of years to fail is 8623.61 and for $\mathcal{R}$ = 0.15, the number of years to fail is 1.02e-02. Indeed, a network that fails 1000s years on average has a high acceptable level of security (i.e., secure) whereas a network that fails less than one year on average is not secure enough.

Now, to validate the feasibility of our approach, we perform a comparison with another existing approach called Break Consensus Protocol attack (BCP) \cite{rajab2020feasibility}. Rajab et al. \cite{rajab2020feasibility} computed (by using BCP) $\mathcal{P}$, but failed to accurately compute $\mathcal{P'}$. Thus, they failed to accurately compute $\mathcal{P''}$. BCP proposed a similar model to that of Figure \ref{fig:2}; for that reason, we compare the proposed PGFA with BCP.

\begin{figure}[ht]
\centering
\includegraphics[width= 0.5 \textwidth]{Figures/Comparison-Successful.pdf}
\caption{Comparison between PGFA and BCP}
\label{fig:comparison_BCP}
\end{figure}
Figure \ref{fig:comparison_BCP} shows the probability of a successful attack when varying the number of Sybil IDs from 10 to 200 (by a step of 10 IDs) for both PGFA and BCP approach. We observe that the probability of a successful attack computed by BCP exceeds 1. This means that BCP computes false probabilities and its formula (\textit{Theorem 1} in \cite{rajab2020feasibility}) does not corresponds to a proper probability distribution. In particular, they computed the probability that at least one shard fails by assuming that the probability of the first shard is indicative to the probability of the other shards; more specifically, they multiply the failure probability of the first shard by the number of shards to get the probability that at least one shard fails.

Note that the proposed probabilistic model can be adopted to different scenarios by adjusting some parameters (e.g. $\mathcal{K}$, $\mathcal{M^{'}}$). For instance, (1) A network with many malicious nodes where each generates numerous Sybil IDs; and (2) Honest node/nodes participate with many IDs.

\section{Conclusion} \label{sec: Conclusion}
In this paper, we propose a tractable probabilistic approach to analyze the security of sharding-based blockchain protocols by using generating function. The proposed PGFA takes into consideration the failure probability of each committee to analyze the security instead of assuming that the failure probability for the first committee is indicative to the failure probabilities of the other committees. More specifically, we compute the failure probability that at least one committee fails. Finally, after calculating the correct failure probability (i.e., the failure probability that at least one committee fails), we propose to quantify the security of the network by computing the average number of years to failure. Furthermore, based on these probabilities, we investigate the threat of Sybil attacks. We conclude that the proposed PGFA is a promising solution to evaluate the security of existing sharding-based blockchain protocols; indeed, to the best of our knowledge, it is the most accurate and tractable approach to compute the failure probability.

\newpage