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="c3" 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="940" height="360" as="geometry"/></mxCell><mxCell id="c4" 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=11;fontFamily=Courier New;align=center;verticalAlign=middle;fontColor=#000000;" vertex="1" parent="1"><mxGeometry x="20" y="10" width="900" height="22" as="geometry"/></mxCell><mxCell id="c5" value="&lt;b&gt;configuration&lt;/b&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#f5f5f5;strokeColor=#666666;fontFamily=Courier New;align=center;verticalAlign=middle;" vertex="1" parent="1"><mxGeometry x="20" y="56" width="190" height="40" as="geometry"/></mxCell><mxCell id="c6" value="&lt;b&gt;encrypted ballots&lt;/b&gt; (one slot per voter)" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#ffe6cc;strokeColor=#d79b00;fontFamily=Courier New;align=center;verticalAlign=middle;" vertex="1" parent="1"><mxGeometry x="210" y="56" width="360" height="40" as="geometry"/></mxCell><mxCell id="c7" value="&lt;b&gt;vote identifiers&lt;/b&gt; (one per ballot cast)" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#dae8fc;strokeColor=#6c8ebf;fontFamily=Courier New;align=center;verticalAlign=middle;" vertex="1" parent="1"><mxGeometry x="570" y="56" width="350" height="40" as="geometry"/></mxCell><mxCell id="c8" value="0x00" style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="20" y="96" width="100" height="18" as="geometry"/></mxCell><mxCell id="c9" value="0x0F" style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=right;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="108" y="96" width="100" height="18" as="geometry"/></mxCell><mxCell id="c10" value="0x10" style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="212" y="96" width="100" height="18" as="geometry"/></mxCell><mxCell id="c11" value="2&lt;sup&gt;63&lt;/sup&gt;&amp;minus;1" style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=right;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="470" y="96" width="100" height="18" as="geometry"/></mxCell><mxCell id="c12" value="2&lt;sup&gt;63&lt;/sup&gt;" style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="572" y="96" width="100" height="18" as="geometry"/></mxCell><mxCell id="c13" value="2&lt;sup&gt;64&lt;/sup&gt;&amp;minus;1" style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=right;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="820" y="96" width="100" height="18" as="geometry"/></mxCell><mxCell id="c14" value="&lt;div style='text-align:left;font-size:10px;line-height:1.5'&gt;0x00 &amp;nbsp;processID&lt;br&gt;0x02 &amp;nbsp;ballotMode (packed)&lt;br&gt;0x03 &amp;nbsp;H(encryptionKey)&lt;br&gt;0x04 &amp;nbsp;H(encryptedResults)&lt;br&gt;0x06 &amp;nbsp;censusOrigin&lt;br&gt;0x07 &amp;nbsp;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=10;fillColor=#ffffff;strokeColor=#000000;fontFamily=Courier New;align=left;verticalAlign=middle;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="20" y="130" width="190" height="150" as="geometry"/></mxCell><mxCell id="c15" value="&lt;div style='text-align:left;font-size:10px;line-height:1.5'&gt;&lt;b&gt;key&lt;/b&gt; = slot&lt;br&gt;&amp;bull; Merkle census:&lt;br&gt;&amp;nbsp;&amp;nbsp;0x10 + (H(&amp;quot;davinci-slot-v1&amp;quot; || address)&lt;sub&gt;[0..8]&lt;/sub&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mod (2&lt;sup&gt;63&lt;/sup&gt; &amp;minus; 16))&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 new 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=10;fillColor=#ffffff;strokeColor=#000000;fontFamily=Courier New;align=left;verticalAlign=middle;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="232" y="130" width="316" height="150" as="geometry"/></mxCell><mxCell id="c16" value="&lt;div style='text-align:left;font-size:10px;line-height:1.5'&gt;&lt;b&gt;key&lt;/b&gt; = voteID =&lt;br&gt;&amp;nbsp;&amp;nbsp;2&lt;sup&gt;63&lt;/sup&gt; + (Poseidon(processID, address, k)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;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, which 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=10;fillColor=#ffffff;strokeColor=#000000;fontFamily=Courier New;align=left;verticalAlign=middle;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="592" y="130" width="306" height="150" as="geometry"/></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.5;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="" 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="c7" target="c16"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell><mxCell id="c20" value="H = SHA-256 (leaf 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). Genesis: the registry computes the root of the six configuration leaves at creation, with the accumulator set to the encryption of zero (all identity points)." style="text;html=1;whiteSpace=wrap;fontSize=9;fontFamily=Courier New;align=left;verticalAlign=middle;fontColor=#333333;" vertex="1" parent="1"><mxGeometry x="20" y="296" width="900" height="54" as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile>