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="<b>state tree</b>: sparse Merkle tree, depth 64, SHA-256, 64-bit keys; its root is the on-chain <b>stateRoot</b>" 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="<b>configuration</b>" 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="<b>encrypted ballots</b><br>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="<b>vote identifiers</b><br>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<sup>63</sup>&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<sup>63</sup>" 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<sup>64</sup>&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="<div style='text-align:left;font-size:12px;line-height:1.45'>0x00 processID<br>0x02 ballotMode<br>0x03 H(encryptionKey)<br>0x04 H(encryptedResults)<br>0x06 censusOrigin<br>0x07 ballotVKHash<br><font color='#666666'>0x01, 0x05, 0x08&ndash;0x0F<br>reserved</font></div>" 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="<div style='text-align:left;font-size:12px;line-height:1.45'><b>key</b> = slot:<br>&bull; Merkle census: 0x10 + (h mod<br>&nbsp;&nbsp;(2<sup>63</sup> &minus; 16)), h = first 8 bytes<br>&nbsp;&nbsp;of H(&quot;davinci-slot-v1&quot; || address)<br>&bull; CSP census: 0x10 + idx<br><b>value</b> = H(reEncryptedBallot)<br><font color='#666666'>written by votes and overwrites,<br>refreshed by silent re-encryptions</font></div>" 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="<div style='text-align:left;font-size:12px;line-height:1.45'><b>key</b> = voteID = 2<sup>63</sup> +<br>&nbsp;&nbsp;(Poseidon(processID,<br>&nbsp;&nbsp;address, k) mod 2<sup>63</sup>)<br><b>value</b> = 0<br><font color='#666666'>insert-only: a vote identifier<br>can never be reused; it lets a<br>voter check that the ballot was<br>recorded without revealing its slot</font></div>" 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<sub>LE8</sub> || value<sub>LE32</sub> || 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>