Documentation Index
Fetch the complete documentation index at: https://docs.snapshot.box/llms.txt
Use this file to discover all available pages before exploring further.
What’s special here?
Starknet having its own language (Cairo) and being a ZK Rollup, there are some Starknet specific details. The Snapshot X Starknet implementation allows DAOs to govern their L1 DAO trustlessly, with very little fees and no user friction. Indeed, users do not have to bridge their tokens, nor do they need to create and install a Starknet wallet. This is all handled seamlessly by the Snapshot X protocol by taking advantage of the existing native bridge, some storage proofs, and a transaction relayer.Overview
This diagram represents the flow of a proposal that will get executed on L1, with voters using their regular EVM account to vote.\
Storage proofs
In a nutshell, storage proofs are cryptographic proofs that a user had this token or that NFT in their wallet at a specific moment in time. We use them to compute the voting power of any user at the moment the proposal started, without the user having to bridge their tokens. This technology developed in collaboration with Herodotus, allows for a trustless balance verification that we can use to compute the voting power of users. The exact code for verifying a storage value can be found here.- A user creates a proposal. The space registers it and stores the start timestamp.
- When the proposal starts, the space caches the block number on L1 that corresponds to the stored
start timestamp. To do that, we use Herodotus’ timestamp remapper contract. - Later on, when a user vote, he provides a storage proof of his balance at the block cached by the space. The space then provides the
storage_proof, theblock_number, and thel1_contract_addressto Herodotus’ Facts Registry for verification. - If the verification succeeds, the space can safely accept the vote, the
voting_powerof the user having been correctly proven and verified.
get_past_votes is reproduced in this voting strategy by proving two values: we first verify the checkpoint c containing the number of delegated power ; and then verify that the checkpoint c + 1 is empty (ensuring that c was indeed the latest checkpoint). As a last detail, the Checkpoint structure got changed by OpenZeppelin to a Checkpoint 208, so we also support this version.