arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
davinci-paper/v2/figures/state-tree.drawio
v2/figures/state-tree.drawioRaw
1<mxfile host="drawio"><diagram name="state-tree" id="state-tree"><mxGraphModel dx="1200" dy="800" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="c20" value="" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=none;strokeColor=#000000;fontFamily=Courier New;verticalAlign=top;align=center;spacingTop=4;spacingLeft=6;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="0" y="0" width="800" height="388" as="geometry"/></mxCell><mxCell id="c3" value="&lt;b&gt;state tree&lt;/b&gt;: sparse Merkle tree, depth 64, SHA-256, 64-bit keys; its root is the on-chain &lt;b&gt;stateRoot&lt;/b&gt;" style="text;html=1;whiteSpace=wrap;fontSize=13;fontFamily=Courier New;align=center;verticalAlign=middle;fontColor=#000000;" vertex="1" parent="1"><mxGeometry x="14" y="8" width="772" height="26" as="geometry"/></mxCell><mxCell id="c4" value="&lt;b&gt;configuration&lt;/b&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=13;fillColor=#f5f5f5;strokeColor=#666666;fontFamily=Courier New;align=center;verticalAlign=middle;" vertex="1" parent="1"><mxGeometry x="14" y="50" width="200" height="44" as="geometry"/></mxCell><mxCell id="c5" value="&lt;b&gt;encrypted ballots&lt;/b&gt;&lt;br&gt;one slot per voter" style="rounded=0;whiteSpace=wrap;html=1;fontSize=13;fillColor=#ffe6cc;strokeColor=#d79b00;fontFamily=Courier New;align=center;verticalAlign=middle;" vertex="1" parent="1"><mxGeometry x="214" y="50" width="290" height="44" as="geometry"/></mxCell><mxCell id="c6" value="&lt;b&gt;vote identifiers&lt;/b&gt;&lt;br&gt;one per ballot cast" style="rounded=0;whiteSpace=wrap;html=1;fontSize=13;fillColor=#dae8fc;strokeColor=#6c8ebf;fontFamily=Courier New;align=center;verticalAlign=middle;" vertex="1" parent="1"><mxGeometry x="504" y="50" width="282" height="44" as="geometry"/></mxCell><mxCell id="c7" value="0x00" style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="14" y="96" width="100" height="20" as="geometry"/></mxCell><mxCell id="c8" value="0x0F" style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=right;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="112" y="96" width="100" height="20" as="geometry"/></mxCell><mxCell id="c9" value="0x10" style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="216" y="96" width="100" height="20" as="geometry"/></mxCell><mxCell id="c10" value="2&lt;sup&gt;63&lt;/sup&gt;&amp;minus;1" style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=right;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="404" y="96" width="100" height="20" as="geometry"/></mxCell><mxCell id="c11" value="2&lt;sup&gt;63&lt;/sup&gt;" style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="506" y="96" width="100" height="20" as="geometry"/></mxCell><mxCell id="c12" value="2&lt;sup&gt;64&lt;/sup&gt;&amp;minus;1" style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=right;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="686" y="96" width="100" height="20" as="geometry"/></mxCell><mxCell id="c13" value="&lt;div style='text-align:left;font-size:12px;line-height:1.45'&gt;0x00 processID&lt;br&gt;0x02 ballotMode&lt;br&gt;0x03 H(encryptionKey)&lt;br&gt;0x04 H(encryptedResults)&lt;br&gt;0x06 censusOrigin&lt;br&gt;0x07 ballotVKHash&lt;br&gt;&lt;font color='#666666'&gt;0x01, 0x05, 0x08&amp;ndash;0x0F&lt;br&gt;reserved&lt;/font&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=12;fillColor=#ffffff;strokeColor=#000000;fontFamily=Courier New;align=left;verticalAlign=middle;spacingLeft=6;" vertex="1" parent="1"><mxGeometry x="14" y="130" width="192" height="184" as="geometry"/></mxCell><mxCell id="c14" value="&lt;div style='text-align:left;font-size:12px;line-height:1.45'&gt;&lt;b&gt;key&lt;/b&gt; = slot:&lt;br&gt;&amp;bull; Merkle census: 0x10 + (h mod&lt;br&gt;&amp;nbsp;&amp;nbsp;(2&lt;sup&gt;63&lt;/sup&gt; &amp;minus; 16)), h = first 8 bytes&lt;br&gt;&amp;nbsp;&amp;nbsp;of H(&amp;quot;davinci-slot-v1&amp;quot; || address)&lt;br&gt;&amp;bull; CSP census: 0x10 + idx&lt;br&gt;&lt;b&gt;value&lt;/b&gt; = H(reEncryptedBallot)&lt;br&gt;&lt;font color='#666666'&gt;written by votes and overwrites,&lt;br&gt;refreshed by silent re-encryptions&lt;/font&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=12;fillColor=#ffffff;strokeColor=#000000;fontFamily=Courier New;align=left;verticalAlign=middle;spacingLeft=6;" vertex="1" parent="1"><mxGeometry x="218" y="130" width="282" height="184" as="geometry"/></mxCell><mxCell id="c15" value="&lt;div style='text-align:left;font-size:12px;line-height:1.45'&gt;&lt;b&gt;key&lt;/b&gt; = voteID = 2&lt;sup&gt;63&lt;/sup&gt; +&lt;br&gt;&amp;nbsp;&amp;nbsp;(Poseidon(processID,&lt;br&gt;&amp;nbsp;&amp;nbsp;address, k) mod 2&lt;sup&gt;63&lt;/sup&gt;)&lt;br&gt;&lt;b&gt;value&lt;/b&gt; = 0&lt;br&gt;&lt;font color='#666666'&gt;insert-only: a vote identifier&lt;br&gt;can never be reused; it lets a&lt;br&gt;voter check that the ballot was&lt;br&gt;recorded without revealing its slot&lt;/font&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=12;fillColor=#ffffff;strokeColor=#000000;fontFamily=Courier New;align=left;verticalAlign=middle;spacingLeft=6;" vertex="1" parent="1"><mxGeometry x="512" y="130" width="274" height="184" as="geometry"/></mxCell><mxCell id="c16" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=none;startArrow=none;endSize=6;startSize=6;fontSize=10;fontFamily=Courier New;strokeColor=#000000;strokeWidth=1;dashed=1;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5208333333333334;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="c4" target="c13"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell><mxCell id="c17" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=none;startArrow=none;endSize=6;startSize=6;fontSize=10;fontFamily=Courier New;strokeColor=#000000;strokeWidth=1;dashed=1;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="c5" target="c14"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell><mxCell id="c18" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=none;startArrow=none;endSize=6;startSize=6;fontSize=10;fontFamily=Courier New;strokeColor=#000000;strokeWidth=1;dashed=1;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.4854014598540146;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="c6" target="c15"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell><mxCell id="c19" value="H = SHA-256 (value read as a big-endian integer). Leaf hash: H(key&lt;sub&gt;LE8&lt;/sub&gt; || value&lt;sub&gt;LE32&lt;/sub&gt; || 0x01); internal node: H(left || right). At creation, the registry computes the genesis root of the six configuration leaves, with the accumulator set to the encryption of zero." style="text;html=1;whiteSpace=wrap;fontSize=12;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="14" y="324" width="772" height="56" as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile>