snapshot
Blog
  • Welcome to Snapshot docs
  • User guides
    • Spaces
      • What is a space?
      • Create a space
        • Register an ENS domain
        • Alternative way to create a space
      • Settings
      • Sub-spaces
      • Space verification
      • Space hibernation
      • Add a custom domain
      • Add a skin
      • Space roles
      • Space badges
      • Snapshot Pro
      • Space handbook
        • Most common
        • Voting threshold
        • Anti-whale
        • Sybil resistance, scam & spam prevention
        • Liquidity / staking pool
        • Delegation
        • NFT voting
          • Most common: ERC-721
          • Multi-token: ERC-1155
          • POAP - Proof of Attendance
        • Custom calculations
    • Create a proposal
    • Voting
      • Vote on a proposal
      • Delegate your voting power
    • Voting strategies
    • Validation strategies
    • Using Safe multi-sig
    • Delegation
  • Developer Guides
    • Create a voting strategy
    • Create a validation strategy
    • Identify integrator activity
    • Add a network
  • Tools
    • Tools overview
    • Snapshot.js
    • API
      • API Keys
    • Webhooks
    • Subgraphs
    • Mobile notifications
    • Bots
  • Snapshot X
    • Overview
    • User guides
      • Create a space
      • Proposals
      • Voting
      • Safe execution setup
    • Protocol
      • Overview
      • Space actions
      • Space controller actions
      • Authenticators
      • Proposal validations
      • Voting strategies
      • Starknet specifics
      • Execution strategies
      • Audits
    • Services
      • Architecture
      • API
      • SX.js
      • UI
      • Mana
  • V1 interface
    • Email notifications
    • Plugins
      • What is a plugin?
      • Create a plugin
      • oSnap
      • SafeSnap
      • POAP
      • Quorum
      • Domino notifications
      • Galxe
    • Boost
  • Community
    • Help center
    • Discord
    • X (Twitter)
    • GitHub
Powered by GitBook
On this page
  • What's special here?
  • Overview
  • Storage proofs
  • Transaction relayer
  • L1 execution

Was this helpful?

Edit on GitHub
Export as PDF
  1. Snapshot X
  2. Protocol

Starknet specifics

PreviousVoting strategiesNextExecution strategies

Last updated 5 months ago

Was this helpful?

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

  1. If the verification succeeds, the space can safely accept the vote, the voting_power of the user having been correctly proven and verified.

Transaction relayer

But who pays for the relaying fees? It is expected that DAOs who want to provide their users with this ease of vote would be the paying those fees, which should be minimal anyway!

L1 execution

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 , 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 .

A user creates a proposal. The space registers it and .

When the proposal starts, the space caches the block number on L1 that corresponds to the stored start timestamp. To do that, we use .

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, the block_number, and the l1_contract_address to for verification.

For OpenZeppelin ERC20Votes tokens, the function get_past_votes is reproduced in 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 .

In order to avoid the overhead of installing and managing a Starknet account, we ask users to sign their vote with their Ethereum wallet, and then simply relay the transaction on the Starknet network using our transaction relayer . Once the transaction is relayed, and by leveraging the modularity of our authenticators system, a verifies the provided signature and lets the vote be counted in!

Once the proposal has ended, and if the proposal has been accepted, then the transaction can be broadcast back to our contract. This module works hand in hand with Zodiac's Avatar (e.g a Safe), and allows the transactions attached to the proposal to be executed directly on the avatar!

https://whimsical.com/storageproofs-7kjLqMvsR3okzFgMrad9Fu
Herodotus
here
stores the start timestamp
Herodotus' timestamp remapper contract
Herodotus' Facts Registry
this voting strategy
also support this version
Mana
special authenticator
L1 Avatar Execution Strategy