ReportDiagrams
ENGR446
Linkedblocks

Description

The code is a LaTeX document that creates a simple blockchain diagram using TikZ. The diagram consists of a horizontal line at the top, which represents the blockchain itself. Four sets of double-stranded DNA are drawn on the line using the coil decoration, with two strands for each DNA. Then, a set of six blocks is drawn below the line, connected by horizontal chains. The blocks are labeled A to F, and the last three blocks (D to F) are connected by a dotted line with three dots. Finally, the text "BLOCKCHAIN" is written in uppercase letters at the center of the diagram.

Keywords

tikz, lmodern, shadows, chains, scopes, decorations, shapes, dna, amplitude, segment, width, height, drop shadow, label, path, midway, sloped, blockchain.

Source Code

ReportDiagrams/ENGR446

\documentclass[tikz]{standalone}
\usepackage{lmodern}
\usetikzlibrary{shadows,chains,scopes}
\usetikzlibrary{decorations.pathmorphing, shapes}
\begin{document}
\begin{tikzpicture}
  [
    start chain=going right,
    node distance=5mm,
    every on chain/.style={
      thick,
      draw=black,
      top color=white,
      bottom color=blue!20,
      font=\sffamily\small,
      minimum width=12mm,
      minimum height=10mm,
      drop shadow,
      %label={below:block \tikzchaincount},
    },
    decoration={coil},
    dna/.style={decorate, thick, decoration={aspect=0, segment length=0.75cm}},
%    post join/.style={
%      -stealth,
%      line width=1.5mm,
%      red,
%      rounded corners=1mm,
%    },
	square/.style={thick,
	      draw=black,
	      top color=white,
	      bottom color=black!10,
	      font=\sffamily\small,
	      minimum width=12mm,
	      minimum height=10mm,
	      drop shadow},
    every label/.style={
      font=\sffamily\scriptsize
    },
  ]
  \draw[dna, decoration={amplitude=.15cm}] (.5,-0) -- (1.9,-0);
  %\draw[dna, decoration={amplitude=.35cm}] (.9,-0) -- (1.5,-0);
  \draw[dna, decoration={amplitude=.15cm}] (.1,-0) -- (1.5,-0);
  
  \draw[dna, decoration={amplitude=.15cm}] (2.25,-0) -- (3.65,-0);
   %\draw[dna, decoration={amplitude=.35cm}] (.9,-0) -- (1.5,-0);
  \draw[dna, decoration={amplitude=.15cm}] (1.85,-0) -- (3.25,-0);
    
  \draw[dna, decoration={amplitude=.15cm}] (.5,-2.5) -- (1.9,-2.5);
  %\draw[dna, decoration={amplitude=.35cm}] (.9,-0) -- (1.5,-0);
  \draw[dna, decoration={amplitude=.15cm}] (.1,-2.5) -- (1.5,-2.5);
    
  \draw[dna, decoration={amplitude=.15cm}] (2.25,-2.5) -- (3.65,-2.5);
   %\draw[dna, decoration={amplitude=.35cm}] (.9,-0) -- (1.5,-0);
   \draw[dna, decoration={amplitude=.15cm}] (1.85,-2.5) -- (3.25,-2.5);
   
   %% Path for dots
  \node [on chain,label={above:block 1}] {A};
  \node [on chain,label={above:block 2}] {B};
  \node [on chain,label={above:block 3}] {C};
  \node [on chain=going below,yshift=-1cm,label={below:block n--2}] {D};
  {[continue chain=going left]
    \node [on chain,label={below:block n--1}] {E};
    \node [on chain,label={below:block n}] {F};
  }
  %\node[square,left of= chain-6] {G};
  {[transparency group, opacity=.25]
%    \draw [post join] (chain-1.south) |- (chain-3.center) |- (chain-6.center) -- (chain-6.north);
  }
 \path (chain-3.south) -- (chain-4.north) node [black, font=\Huge, midway, sloped,xshift=0cm] {$\dots$};
 
\node[] at (1.75,-1.25) { \textsc{BLOCKCHAIN}};
\end{tikzpicture}
\end{document}
Deploy to Overleaf