davinci-sdk
Davinci SDK (@vocdoni/davinci-sdk)
The TypeScript SDK for Davinci, Vocdoni's zk-based voting protocol. It runs private, verifiable elections where ballots are homomorphically encrypted (ElGamal) and accompanied by zk-SNARK validity proofs, collected and aggregated off-chain by a sequencer, with canonical state and results anchored in Ethereum smart contracts.
The SDK ships a single high-level facade, DavinciSDK, that orchestrates all of this. Almost every task goes through it. Lower-level services (ProcessRegistryService, the sequencer/census REST clients, the crypto primitives) exist and are reachable, but you reach for them only when the facade doesn't cover a case.
This is the entry point. Read the section matching the task, load the matching references/ file for the exhaustive API, and lift a recipes/ file when you need a complete working flow.
How to use this skill
- Find the area in the task → reference table below.
- Read only the references you need — most tasks need 1–3.
- Start from a recipe when one fits; adapt rather than reinvent the boilerplate.
- Respect the exact shapes. The facade hides most cryptography, but the public shapes still have sharp edges: a single root import (no subpaths), a
choices: number[]ballot model whose length must equalballot.numFields, two different status enums (TxStatusfor on-chain transactions,VoteStatusfor vote processing), andbigintresults. The references spell these out.