signet-protocol 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -10
- package/docs/bot-ownership-v1.md +43 -0
- package/docs/implementation-levels.md +235 -0
- package/docs/private-vault-v1.md +104 -0
- package/docs/signet-in-5-minutes.md +181 -0
- package/examples/full-flow.ts +260 -0
- package/examples/jurisdictions/brazil-lawyer.ts +186 -0
- package/examples/jurisdictions/eu-doctor.ts +160 -0
- package/examples/jurisdictions/india-doctor.ts +207 -0
- package/examples/jurisdictions/japan-notary.ts +157 -0
- package/examples/jurisdictions/multi-jurisdiction.ts +174 -0
- package/examples/jurisdictions/uae-professional.ts +190 -0
- package/examples/jurisdictions/uk-solicitor.ts +170 -0
- package/examples/jurisdictions/us-attorney.ts +161 -0
- package/examples/signet-me.ts +253 -0
- package/llms-full.txt +3775 -0
- package/llms.txt +152 -0
- package/package.json +14 -3
- package/spec/protocol.md +2628 -0
- package/spec/voting.md +563 -0
package/spec/voting.md
ADDED
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
# Signet Voting Extension
|
|
2
|
+
|
|
3
|
+
**Cryptographically Secure Elections for Nostr**
|
|
4
|
+
|
|
5
|
+
**Version:** 0.1.0 (Draft)
|
|
6
|
+
**Date:** 2026-03-04
|
|
7
|
+
**Status:** Draft specification — seeking community feedback
|
|
8
|
+
**Licence:** MIT
|
|
9
|
+
**Depends on:** [Signet Protocol Specification](protocol.md) v0.1.0+
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Abstract
|
|
14
|
+
|
|
15
|
+
This specification defines a voting extension for the Signet protocol. It enables cryptographically secure elections at organisational, community, and national scale, using linkable ring signatures for ballot secrecy and one-person-one-vote enforcement.
|
|
16
|
+
|
|
17
|
+
The extension depends on the Signet protocol for identity verification (credential tiers, entity types, Signet Score) and adds three new Nostr event kinds: Election Definition (30482), Ballot (30483), and Election Result (30484).
|
|
18
|
+
|
|
19
|
+
Ballot secrecy is achieved through linkable ring signatures — voters prove membership in an eligible set without revealing which member they are, while key images prevent double voting. Encrypted ballots ensure vote content remains secret until tallying.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Table of Contents
|
|
24
|
+
|
|
25
|
+
1. [Motivation](#1-motivation)
|
|
26
|
+
2. [Three Scales](#2-three-scales)
|
|
27
|
+
3. [Architecture](#3-architecture)
|
|
28
|
+
4. [Event Kinds](#4-event-kinds)
|
|
29
|
+
5. [Linkable Ring Signature Scheme](#5-linkable-ring-signature-scheme)
|
|
30
|
+
6. [Encrypted Ballots](#6-encrypted-ballots)
|
|
31
|
+
7. [Re-Voting Protocol](#7-re-voting-protocol)
|
|
32
|
+
8. [Use Cases](#8-use-cases)
|
|
33
|
+
9. [Global Legal Context](#9-global-legal-context)
|
|
34
|
+
10. [Security Considerations](#10-security-considerations)
|
|
35
|
+
11. [Future: National-Scale Elections](#11-future-national-scale-elections)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 1. Motivation
|
|
40
|
+
|
|
41
|
+
Every voting fraud vector traces back to identity:
|
|
42
|
+
|
|
43
|
+
| Problem | Root Cause | Category |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Impersonation fraud | Can't prove who you are | Identity |
|
|
46
|
+
| Multiple voting | Can't prove uniqueness | Identity |
|
|
47
|
+
| Ballot harvesting | Third parties submit ballots on behalf of voters | Chain of custody |
|
|
48
|
+
| Vote buying / bribery | Voter can prove how they voted to a buyer | Ballot secrecy |
|
|
49
|
+
| Coercion / undue influence | Voter can be forced to reveal or prove their vote | Ballot secrecy |
|
|
50
|
+
| Treating | Votes linkable to identity, enabling reward/punishment | Ballot secrecy |
|
|
51
|
+
|
|
52
|
+
The Signet protocol solves the identity problems (top rows) through its credential tier system and entity type classification. The ballot secrecy problems (bottom rows) require additional cryptography — specifically, a mechanism that proves "I am eligible to vote" without revealing "I am this specific person."
|
|
53
|
+
|
|
54
|
+
This extension provides that mechanism using linkable ring signatures and encrypted ballots.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 2. Three Scales
|
|
59
|
+
|
|
60
|
+
Elections operate at different scales with different requirements:
|
|
61
|
+
|
|
62
|
+
| Scale | Stakeholders | Secrecy Needs | Coercion Risk | Complexity |
|
|
63
|
+
|---|---|---|---|---|
|
|
64
|
+
| **Organisational** | Board members, committees, DAO governance | Often non-secret or low stakes | Low | Simple |
|
|
65
|
+
| **Community** | Relay governance, meetups, party policy votes | Ballot secrecy needed | Moderate | Moderate |
|
|
66
|
+
| **National** | Citizens of a country | Full secrecy + coercion resistance | High | Very high |
|
|
67
|
+
|
|
68
|
+
**Pragmatic scope:** This specification covers organisational and community-scale elections. These are sufficient for most Nostr use cases and can be made robust with linkable ring signatures and re-voting. National-scale elections require additional mechanisms (see §11) and are a future goal, not a launch requirement.
|
|
69
|
+
|
|
70
|
+
### 2.1 Scale Requirements
|
|
71
|
+
|
|
72
|
+
**Organisational elections** require:
|
|
73
|
+
- Proof of membership (existing Signet credentials)
|
|
74
|
+
- One-member-one-vote enforcement
|
|
75
|
+
- Optional ballot secrecy (some organisational votes are open)
|
|
76
|
+
- Verifiable tally
|
|
77
|
+
|
|
78
|
+
**Community elections** require all of the above plus:
|
|
79
|
+
- Mandatory ballot secrecy
|
|
80
|
+
- Re-voting capability for coercion resistance
|
|
81
|
+
- Multiple tally authorities to prevent single-authority manipulation
|
|
82
|
+
|
|
83
|
+
**National elections** require all of the above plus:
|
|
84
|
+
- Full coercion resistance (fake credentials, deniable encryption)
|
|
85
|
+
- Threshold tally authorities with no single point of failure
|
|
86
|
+
- Legal framework integration (see §9)
|
|
87
|
+
- Accessibility for non-technical citizens
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 3. Architecture
|
|
92
|
+
|
|
93
|
+
### 3.1 Design Choice: Linkable Ring Signatures
|
|
94
|
+
|
|
95
|
+
This extension uses **linkable ring signatures** rather than blind signatures for ballot secrecy. The rationale:
|
|
96
|
+
|
|
97
|
+
| Property | Blind Signatures | Linkable Ring Signatures |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| Authority interaction | Voter must interact with signing authority | No authority interaction needed |
|
|
100
|
+
| Single point of failure | Signing authority can deny ballot tokens | No authority can deny participation |
|
|
101
|
+
| Anonymity model | Authority knows who requested a token (but not the vote) | No one learns who voted |
|
|
102
|
+
| Double-vote prevention | Authority tracks token issuance | Key images are deterministic per election |
|
|
103
|
+
| Alignment with Signet principles | Requires trusted authority | Fully decentralised |
|
|
104
|
+
|
|
105
|
+
Linkable ring signatures align with Signet's core principle of decentralisation (see protocol spec §18.3). No single entity can deny a voter's participation or learn who voted.
|
|
106
|
+
|
|
107
|
+
### 3.2 How It Works
|
|
108
|
+
|
|
109
|
+
1. **Eligibility** — An election definition specifies which entity types, credential tiers, and (optionally) community memberships are required. Eligibility is determined by existing Signet credentials — no new credential type is needed.
|
|
110
|
+
|
|
111
|
+
2. **Eligible set** — The set of public keys that hold qualifying credentials forms the ring. All eligible voters are members of this ring.
|
|
112
|
+
|
|
113
|
+
3. **Key images** — Each voter computes a deterministic key image for the election:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
I = x * H_p(P || election_id)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Where `x` is the voter's private key, `P` is their public key, `H_p` is a hash-to-point function, and `election_id` uniquely identifies the election. The key image is the same every time this voter signs for this election, but different across elections. This prevents double voting without revealing the voter's identity.
|
|
120
|
+
|
|
121
|
+
4. **Encrypted ballots** — The voter encrypts their vote content to the tally authority's public key(s). The encrypted vote is included in the ballot event. No one can read the vote until the tally phase.
|
|
122
|
+
|
|
123
|
+
5. **Ring signature** — The voter produces a linkable ring signature over a commitment to the encrypted ballot (`electionId:SHA-256(encryptedVote)`), proving they are a member of the eligible set without revealing which member or how they voted. The signed message MUST NOT contain the plaintext vote.
|
|
124
|
+
|
|
125
|
+
6. **Submission** — The voter publishes the ballot as a kind 30483 event on Nostr relays.
|
|
126
|
+
|
|
127
|
+
7. **Re-voting** — If the election allows re-voting, a voter may submit a new ballot with the same key image. The latest ballot (by event timestamp) replaces all previous ballots with that key image.
|
|
128
|
+
|
|
129
|
+
8. **Tally** — After the election closes, tally authorities decrypt the ballots, deduplicate by key image (keeping the latest), count the votes, and publish the result as a kind 30484 event.
|
|
130
|
+
|
|
131
|
+
9. **Verification** — Anyone can verify: each ballot has a valid ring signature from the eligible set, each key image appears at most once in the final tally, and the published totals match the decrypted ballots.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 4. Event Kinds
|
|
136
|
+
|
|
137
|
+
> **Note:** Kinds 30480-30481 are reserved for the Dominion Protocol (vault share, vault config).
|
|
138
|
+
|
|
139
|
+
### Kind 30482 — Election Definition
|
|
140
|
+
|
|
141
|
+
A replaceable event published by an election authority defining an election.
|
|
142
|
+
|
|
143
|
+
```jsonc
|
|
144
|
+
{
|
|
145
|
+
"kind": 30482,
|
|
146
|
+
"pubkey": "<election_authority_pubkey>",
|
|
147
|
+
"tags": [
|
|
148
|
+
["d", "<election_id>"],
|
|
149
|
+
["title", "<election title>"],
|
|
150
|
+
["description", "<human-readable description>"],
|
|
151
|
+
["options", "<option_1>", "<option_2>", "..."], // candidates or choices
|
|
152
|
+
["scale", "<organisational|community|national>"],
|
|
153
|
+
["eligible-entity-types", "<type1>,<type2>,..."], // e.g. "natural_person,persona"
|
|
154
|
+
["eligible-min-tier", "<1-4>"], // minimum verification tier
|
|
155
|
+
["eligible-community", "<community_id>"], // optional: restrict to community
|
|
156
|
+
["opens", "<unix_timestamp>"],
|
|
157
|
+
["closes", "<unix_timestamp>"],
|
|
158
|
+
["re-vote", "<allowed|denied>"], // re-voting policy
|
|
159
|
+
["tally-pubkeys", "<pubkey1>", "<pubkey2>", "..."], // keys that can decrypt ballots
|
|
160
|
+
["tally-threshold", "<m>", "<n>"], // m-of-n threshold for decryption
|
|
161
|
+
["ring-size", "<minimum_ring_size>"], // minimum eligible set size
|
|
162
|
+
["algo", "secp256k1"], // cryptographic algorithm
|
|
163
|
+
["L", "signet"],
|
|
164
|
+
["l", "election", "signet"]
|
|
165
|
+
],
|
|
166
|
+
"content": "<optional: extended description, rules, or context>"
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Field requirements:**
|
|
171
|
+
- `election_id` MUST be unique across all elections by this authority
|
|
172
|
+
- `options` MUST contain at least 2 values
|
|
173
|
+
- `opens` MUST be a future Unix timestamp at time of publication
|
|
174
|
+
- `closes` MUST be after `opens`
|
|
175
|
+
- `tally-pubkeys` MUST contain at least one public key
|
|
176
|
+
- `tally-threshold` is OPTIONAL; defaults to all tally pubkeys required (n-of-n)
|
|
177
|
+
- `ring-size` is OPTIONAL; defaults to the full eligible set. Elections with fewer eligible voters than `ring-size` MUST NOT proceed
|
|
178
|
+
- `scale` MUST be one of: `organisational`, `community`, `national`
|
|
179
|
+
|
|
180
|
+
### Kind 30483 — Ballot
|
|
181
|
+
|
|
182
|
+
A replaceable event published by a voter. The voter's actual pubkey is NOT used — ballots are published from an ephemeral key to prevent linking.
|
|
183
|
+
|
|
184
|
+
```jsonc
|
|
185
|
+
{
|
|
186
|
+
"kind": 30483,
|
|
187
|
+
"pubkey": "<ephemeral_ballot_pubkey>",
|
|
188
|
+
"tags": [
|
|
189
|
+
["d", "<election_id>:<random_16_bytes_hex>"],
|
|
190
|
+
["election", "<kind_30482_event_id>"],
|
|
191
|
+
["key-image", "<hex_encoded_key_image>"],
|
|
192
|
+
["ring-sig", "<hex_encoded_linkable_ring_signature>"],
|
|
193
|
+
["encrypted-vote", "<encrypted_vote_content>"],
|
|
194
|
+
["algo", "secp256k1"], // cryptographic algorithm
|
|
195
|
+
["L", "signet"],
|
|
196
|
+
["l", "ballot", "signet"]
|
|
197
|
+
],
|
|
198
|
+
"content": ""
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Field requirements:**
|
|
203
|
+
- `d` tag MUST be `<election_id>:<random_16_bytes_hex>` where the 16 bytes are generated fresh for each ballot submission. The random suffix prevents relays and observers from correlating ballot submissions via the `d` tag (which would expose re-voting patterns). Key image deduplication is performed at tally time using the `key-image` tag, not via relay-level replaceable event semantics.
|
|
204
|
+
- `election_id` MUST match a published kind 30482 election
|
|
205
|
+
- `key-image` MUST be deterministically derived as `I = x * H_p(P || election_id)` where `x` is the voter's private key and `P` is their public key in the eligible set
|
|
206
|
+
- `ring-sig` MUST be a valid linkable ring signature over the message `<election_id>:SHA-256(<encrypted-vote>)`, verifiable against the eligible set. The signed message MUST be a commitment to the ciphertext, never the plaintext vote — this ensures ballot secrecy even if the ring signature is inspected
|
|
207
|
+
- `encrypted-vote` MUST be the vote content encrypted to the tally authority pubkey(s) specified in the election definition
|
|
208
|
+
- `content` MUST be empty (vote content is in the encrypted tag)
|
|
209
|
+
- The ephemeral pubkey MUST NOT be reused across elections
|
|
210
|
+
|
|
211
|
+
**Validation rules:**
|
|
212
|
+
- Relays and clients MUST verify the ring signature before accepting
|
|
213
|
+
- If the key image matches a previously seen ballot for this election and re-voting is allowed, the new ballot replaces the old one
|
|
214
|
+
- If re-voting is denied and a matching key image exists, the ballot MUST be rejected
|
|
215
|
+
|
|
216
|
+
### Kind 30484 — Election Result
|
|
217
|
+
|
|
218
|
+
A replaceable event published after an election closes with the verified tally.
|
|
219
|
+
|
|
220
|
+
```jsonc
|
|
221
|
+
{
|
|
222
|
+
"kind": 30484,
|
|
223
|
+
"pubkey": "<tallier_pubkey>",
|
|
224
|
+
"tags": [
|
|
225
|
+
["d", "<election_id>"],
|
|
226
|
+
["election", "<kind_30482_event_id>"],
|
|
227
|
+
["result", "<option_1>", "<count>"],
|
|
228
|
+
["result", "<option_2>", "<count>"],
|
|
229
|
+
["total-ballots", "<count>"],
|
|
230
|
+
["total-eligible", "<count>"],
|
|
231
|
+
["total-invalid", "<count>"],
|
|
232
|
+
["tally-proof", "<proof_data>"],
|
|
233
|
+
["algo", "secp256k1"], // cryptographic algorithm
|
|
234
|
+
["L", "signet"],
|
|
235
|
+
["l", "election-result", "signet"]
|
|
236
|
+
],
|
|
237
|
+
"content": "<optional: detailed breakdown, notes, or methodology>"
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Field requirements:**
|
|
242
|
+
- `tallier_pubkey` SHOULD be one of the `tally-pubkeys` from the election definition
|
|
243
|
+
- The sum of all `result` counts plus `total-invalid` MUST equal `total-ballots`
|
|
244
|
+
- `tally-proof` SHOULD contain sufficient data for independent verification (e.g., the decrypted ballots and their ring signatures)
|
|
245
|
+
- Anyone MAY publish a kind 30484 for any election — independent tallies increase confidence
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 5. Linkable Ring Signature Scheme
|
|
250
|
+
|
|
251
|
+
### 5.1 Overview
|
|
252
|
+
|
|
253
|
+
The linkable ring signature scheme extends the Spontaneous Anonymous Group (SAG) signature scheme already used in `src/ring-signature.ts` in the Signet reference implementation. Linkability is achieved through key images — deterministic values that are the same for a given signer in a given election, but reveal nothing about which ring member produced them.
|
|
254
|
+
|
|
255
|
+
### 5.2 Definitions
|
|
256
|
+
|
|
257
|
+
- **Ring** `R = {P_0, P_1, ..., P_{n-1}}`: the set of public keys of all eligible voters
|
|
258
|
+
- **Signer index** `s`: the position of the actual signer in the ring
|
|
259
|
+
- **Private key** `x_s`: the signer's private key, where `P_s = x_s * G`
|
|
260
|
+
- **Election ID** `e`: a unique identifier for the election
|
|
261
|
+
- **Hash-to-point** `H_p`: a function that maps arbitrary data to a point on secp256k1
|
|
262
|
+
- **Key image** `I = x_s * H_p(P_s || e)`: deterministic per signer per election
|
|
263
|
+
|
|
264
|
+
### 5.3 Signing
|
|
265
|
+
|
|
266
|
+
Given a message `m` (the commitment `<election_id>:SHA-256(<encrypted_vote>)` — never the plaintext vote), ring `R`, signer index `s`, private key `x_s`, and election ID `e`:
|
|
267
|
+
|
|
268
|
+
1. Compute key image: `I = x_s * H_p(P_s || e)`
|
|
269
|
+
2. Generate random scalar `α`
|
|
270
|
+
3. For each non-signer index i (wrapping from s+1 back to s), generate a random response r_i. Compute the challenge c_{i+1} sequentially from the hash chain: c_{i+1} = H(m || L_i || R_i).
|
|
271
|
+
4. Compute initial commitment: `L_s = α * G`, `R_s = α * H_p(P_s || e)`
|
|
272
|
+
5. For each `i` from `s+1` to `s-1` (wrapping):
|
|
273
|
+
- `L_i = r_i * G + c_i * P_i`
|
|
274
|
+
- `R_i = r_i * H_p(P_i || e) + c_i * I`
|
|
275
|
+
- `c_{i+1} = H(m || L_i || R_i)`
|
|
276
|
+
6. Close the ring: `c_s = H(m || L_{s-1} || R_{s-1})`
|
|
277
|
+
7. Compute `r_s = α - c_s * x_s`
|
|
278
|
+
8. Output signature: `σ = (I, c_0, r_0, r_1, ..., r_{n-1})`
|
|
279
|
+
|
|
280
|
+
### 5.4 Verification
|
|
281
|
+
|
|
282
|
+
Given message `m`, ring `R`, election ID `e`, and signature `σ = (I, c_0, r_0, ..., r_{n-1})`:
|
|
283
|
+
|
|
284
|
+
1. For each `i` from `0` to `n-1`:
|
|
285
|
+
- `L_i = r_i * G + c_i * P_i`
|
|
286
|
+
- `R_i = r_i * H_p(P_i || e) + c_i * I`
|
|
287
|
+
- `c_{i+1} = H(m || L_i || R_i)`
|
|
288
|
+
2. Verify: `c_n == c_0` (the ring closes)
|
|
289
|
+
3. Verify: `I` is a valid point on secp256k1
|
|
290
|
+
|
|
291
|
+
### 5.5 Linkability
|
|
292
|
+
|
|
293
|
+
Two signatures with the same key image `I` were produced by the same signer for the same election. This is because `I = x_s * H_p(P_s || e)` is deterministic — the signer cannot produce a different key image without using a different private key (which wouldn't be in the ring).
|
|
294
|
+
|
|
295
|
+
**Cross-election unlinkability:** Different election IDs produce different key images for the same signer, because `H_p(P_s || e_1) ≠ H_p(P_s || e_2)`. A voter's participation in one election cannot be linked to their participation in another.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 6. Encrypted Ballots
|
|
300
|
+
|
|
301
|
+
### 6.1 Encryption
|
|
302
|
+
|
|
303
|
+
The voter encrypts their vote content to the tally authority's public key(s) before including it in the ballot event:
|
|
304
|
+
|
|
305
|
+
1. Voter selects their choice from the election's `options`
|
|
306
|
+
2. Vote content is serialised as a JSON string: `{"option": "<selected_option>"}`
|
|
307
|
+
3. Content is encrypted using ECDH with the tally authority's public key:
|
|
308
|
+
- Generate ephemeral keypair `(k, K = k * G)`
|
|
309
|
+
- Compute shared secret `S = k * T` where `T` is the tally authority's public key
|
|
310
|
+
- Derive encryption key from `S` using HKDF
|
|
311
|
+
- Encrypt vote content using AEAD cipher (AES-256-GCM recommended; available in Web Crypto API across all target runtimes)
|
|
312
|
+
- Output: `K || nonce || ciphertext || tag`
|
|
313
|
+
|
|
314
|
+
### 6.2 Multi-Authority Threshold Decryption
|
|
315
|
+
|
|
316
|
+
When multiple tally authorities are specified with an m-of-n threshold:
|
|
317
|
+
|
|
318
|
+
1. Each authority holds a share of the decryption key (generated via Shamir's Secret Sharing or a DKG protocol)
|
|
319
|
+
2. After the election closes, at least `m` authorities must cooperate to decrypt each ballot
|
|
320
|
+
3. No single authority (or fewer than `m`) can decrypt any ballot
|
|
321
|
+
4. The decryption process produces the plaintext votes, which are then tallied
|
|
322
|
+
|
|
323
|
+
This prevents a single compromised or coerced authority from reading votes before the close, or from selectively revealing individual votes.
|
|
324
|
+
|
|
325
|
+
### 6.3 Post-Close Transparency
|
|
326
|
+
|
|
327
|
+
After decryption and tallying:
|
|
328
|
+
- All decrypted votes are published (without linking to specific voters)
|
|
329
|
+
- The ring signatures remain verifiable
|
|
330
|
+
- Anyone can independently verify that the tally matches the decrypted ballots
|
|
331
|
+
- The election result event (kind 30484) references the verification data
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 7. Re-Voting Protocol
|
|
336
|
+
|
|
337
|
+
### 7.1 Motivation
|
|
338
|
+
|
|
339
|
+
Re-voting is the primary coercion resistance mechanism for organisational and community-scale elections. If a voter is coerced ("vote X while I watch"), they comply, then later re-vote from a safe context. The coercer cannot determine whether the voter re-voted.
|
|
340
|
+
|
|
341
|
+
### 7.2 Mechanics
|
|
342
|
+
|
|
343
|
+
1. Election definition specifies `["re-vote", "allowed"]`
|
|
344
|
+
2. Voter submits initial ballot with key image `I` and timestamp `t_1`
|
|
345
|
+
3. Later, voter submits a new ballot with the same key image `I` and timestamp `t_2 > t_1`
|
|
346
|
+
4. At tally time, only the ballot with the latest timestamp for each key image is counted
|
|
347
|
+
5. The coercer sees the first ballot was published but cannot determine whether a replacement exists (all ballots are encrypted and signed with ephemeral keys)
|
|
348
|
+
|
|
349
|
+
### 7.3 Why Re-Voting Is Sufficient at Community Scale
|
|
350
|
+
|
|
351
|
+
At community scale, the coercer typically cannot:
|
|
352
|
+
- Monitor the voter's network traffic continuously
|
|
353
|
+
- Distinguish a re-vote from any other Nostr event
|
|
354
|
+
- Determine which ephemeral pubkey belongs to the voter
|
|
355
|
+
|
|
356
|
+
The coercer can see that a ballot was cast (they watched), but cannot see that it was replaced. This provides practical coercion resistance without the complexity of full JCJ coercion resistance.
|
|
357
|
+
|
|
358
|
+
### 7.4 Limitations
|
|
359
|
+
|
|
360
|
+
Re-voting does NOT protect against:
|
|
361
|
+
- A coercer who controls the voter's device or key material
|
|
362
|
+
- A coercer who can monitor all relay traffic and correlate timing
|
|
363
|
+
- State-level adversaries with mass surveillance capability
|
|
364
|
+
|
|
365
|
+
These threats require national-scale mechanisms (see §11).
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## 8. Use Cases
|
|
370
|
+
|
|
371
|
+
### 8.1 Party Policy Votes
|
|
372
|
+
|
|
373
|
+
A political party (e.g., Restore Britain) wants members to vote on policy positions:
|
|
374
|
+
|
|
375
|
+
1. Party establishes itself as a Juridical Person (verified organisation) with Signet credentials
|
|
376
|
+
2. Members are verified Natural Persons who hold party membership credentials (kind 31000, `type: credential`)
|
|
377
|
+
3. Party leadership publishes a kind 30482 election: "Should the party support policy X?"
|
|
378
|
+
- `eligible-entity-types`: `natural_person`
|
|
379
|
+
- `eligible-min-tier`: `2` (web-of-trust verified)
|
|
380
|
+
- `eligible-community`: `<party_community_id>`
|
|
381
|
+
- `re-vote`: `allowed`
|
|
382
|
+
4. Each eligible member computes their key image and submits an encrypted ballot (kind 30483)
|
|
383
|
+
5. After close, tally authorities decrypt and count
|
|
384
|
+
6. Result published as kind 30484 — anyone can verify
|
|
385
|
+
7. If a member was coerced by party leadership, they re-vote privately — last ballot counts
|
|
386
|
+
|
|
387
|
+
### 8.2 Relay / Community Governance
|
|
388
|
+
|
|
389
|
+
A Nostr relay community votes on moderation policy:
|
|
390
|
+
|
|
391
|
+
1. Relay operator publishes community verification policy (kind 30078, NIP-78) requiring Tier 2+
|
|
392
|
+
2. Operator publishes a kind 30482 election for policy change
|
|
393
|
+
- `scale`: `community`
|
|
394
|
+
- `eligible-entity-types`: `natural_person,persona`
|
|
395
|
+
- `eligible-min-tier`: `2`
|
|
396
|
+
- `ring-size`: `20` (minimum anonymity set)
|
|
397
|
+
3. Community members vote via kind 30483
|
|
398
|
+
4. If fewer than 20 eligible members exist, election cannot proceed (ring too small for meaningful anonymity)
|
|
399
|
+
|
|
400
|
+
### 8.3 Organisational Board Votes
|
|
401
|
+
|
|
402
|
+
A company board votes on a resolution:
|
|
403
|
+
|
|
404
|
+
1. Board members hold Juridical Person delegation credentials
|
|
405
|
+
2. Chair publishes kind 30482 election
|
|
406
|
+
- `scale`: `organisational`
|
|
407
|
+
- `eligible-entity-types`: `natural_person`
|
|
408
|
+
- `eligible-min-tier`: `3` (professionally verified)
|
|
409
|
+
- `re-vote`: `denied` (board votes are typically final)
|
|
410
|
+
3. Board members vote; ring size equals the full board
|
|
411
|
+
4. Small ring size means limited anonymity — acceptable for organisational votes where participants are known but vote content should be private
|
|
412
|
+
|
|
413
|
+
### 8.4 Citizenship Verification for Voting Eligibility
|
|
414
|
+
|
|
415
|
+
Using civic identity from the Signet protocol spec (§19):
|
|
416
|
+
|
|
417
|
+
1. Government issues citizen credentials (kind 31000, `type: credential`) as described in protocol spec §19.2
|
|
418
|
+
2. Election authority publishes kind 30482 referencing citizenship credentials
|
|
419
|
+
- `eligible-entity-types`: `natural_person`
|
|
420
|
+
- `eligible-min-tier`: `3` (government-verified)
|
|
421
|
+
3. Citizens vote using their government-attested public keys as ring members
|
|
422
|
+
4. Ring signature proves "I am a verified citizen" without revealing which one
|
|
423
|
+
5. Key image prevents any citizen from voting twice
|
|
424
|
+
|
|
425
|
+
This use case requires the civic identity framework described in the core protocol spec §19 and appropriate legal frameworks (see §9).
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## 9. Global Legal Context
|
|
430
|
+
|
|
431
|
+
### 9.1 Election Law Survey
|
|
432
|
+
|
|
433
|
+
Cryptographic voting must operate within existing legal frameworks. The following survey identifies key legal considerations by jurisdiction.
|
|
434
|
+
|
|
435
|
+
**Estonia — i-Voting:**
|
|
436
|
+
Estonia has operated internet voting since 2005. Key precedent: voters can re-vote during the advance voting period, with only the last vote counted. This establishes legal precedent for re-voting as a coercion resistance mechanism. The Estonian system uses a different cryptographic approach (server-side identity verification) but the re-voting principle maps directly to this specification's re-voting protocol.
|
|
437
|
+
|
|
438
|
+
**European Union — eIDAS:**
|
|
439
|
+
The EU's eIDAS regulation establishes a framework for electronic identification and trust services. eIDAS-compliant electronic identities could serve as the basis for voting eligibility credentials. Signet's credential tier system could map to eIDAS assurance levels: Tier 2 ≈ Substantial, Tier 3 ≈ High. The EU does not mandate a specific voting protocol, so member states could adopt Signet-based voting independently.
|
|
440
|
+
|
|
441
|
+
**United States — State-Level Variation:**
|
|
442
|
+
US election law varies by state. No federal standard exists for electronic voting. Some states permit electronic ballot delivery (for overseas/military voters under UOCAVA). Blockchain-based voting has been piloted in limited contexts (e.g., West Virginia, Utah County). Legal challenges focus on auditability, accessibility, and the Help America Vote Act (HAVA) requirements. Signet voting's verifiable tally and public auditability address several HAVA concerns.
|
|
443
|
+
|
|
444
|
+
**Switzerland — E-Voting Trials:**
|
|
445
|
+
Switzerland has conducted multiple e-voting trials, with mixed results. The Swiss Federal Chancellery requires individual verifiability (voters can verify their vote was recorded) and universal verifiability (anyone can verify the tally). Post Office's e-voting system was withdrawn in 2019 after security researchers found critical flaws. Swiss requirements align well with Signet's verifiable tally approach, but the Swiss experience underscores the importance of independent security audits.
|
|
446
|
+
|
|
447
|
+
**United Kingdom — Representation of the People Act 1983:**
|
|
448
|
+
UK election law defines specific offences relevant to coercion resistance:
|
|
449
|
+
- **Treating** (s.114): providing food, drink, or entertainment to influence votes
|
|
450
|
+
- **Undue influence** (s.115): using force, threats, or fraud to influence votes
|
|
451
|
+
- **Bribery** (s.113): giving money or procuring office to influence votes
|
|
452
|
+
- **Personation** (s.60): voting as another person
|
|
453
|
+
|
|
454
|
+
Signet voting addresses personation (ring signature proves eligibility), and re-voting provides practical defence against treating, undue influence, and bribery (the coerced vote can be replaced). The Ballot Secrecy Act 1872 and subsequent legislation require that votes cannot be traced to individual voters — ring signatures provide this mathematically.
|
|
455
|
+
|
|
456
|
+
**Ballot Secrecy Requirements:**
|
|
457
|
+
Most democratic jurisdictions require ballot secrecy as a fundamental principle. Requirements vary:
|
|
458
|
+
- Some require secrecy of the act of voting (who voted)
|
|
459
|
+
- All require secrecy of the vote content (how they voted)
|
|
460
|
+
- Some explicitly permit the voter to voluntarily disclose their own vote
|
|
461
|
+
|
|
462
|
+
Signet voting provides both forms of secrecy through ring signatures (who) and encrypted ballots (how), while allowing voluntary self-disclosure (a voter can reveal their own key image and vote content if they choose).
|
|
463
|
+
|
|
464
|
+
### 9.2 Mapping to Legal Frameworks
|
|
465
|
+
|
|
466
|
+
| Legal Requirement | Signet Voting Mechanism |
|
|
467
|
+
|---|---|
|
|
468
|
+
| Voter eligibility verification | Signet credential tiers + entity types |
|
|
469
|
+
| One-person-one-vote | Key images (deterministic, unique per voter per election) |
|
|
470
|
+
| Ballot secrecy | Ring signatures + encrypted ballots |
|
|
471
|
+
| Coercion resistance | Re-voting protocol (last vote counts) |
|
|
472
|
+
| Auditability / verifiable tally | Public ring signatures + published decrypted ballots |
|
|
473
|
+
| Accessibility | Client implementation concern (not protocol-level) |
|
|
474
|
+
| Independent oversight | Anyone can verify; multiple tally authorities |
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## 10. Security Considerations
|
|
479
|
+
|
|
480
|
+
### 10.1 Sybil Attacks
|
|
481
|
+
|
|
482
|
+
**Threat:** An attacker creates multiple fake identities to cast multiple votes.
|
|
483
|
+
|
|
484
|
+
**Mitigation:** Signet's credential tier system. Elections that require Tier 2+ credentials require web-of-trust verification or professional attestation. Creating fake Tier 3 identities requires corrupting a licensed professional verifier — a real-world attack with legal consequences. The anti-corruption framework (protocol spec §7) provides detection and accountability mechanisms.
|
|
485
|
+
|
|
486
|
+
### 10.2 Key Image Collision Resistance
|
|
487
|
+
|
|
488
|
+
**Threat:** Two different voters produce the same key image, causing one ballot to overwrite the other.
|
|
489
|
+
|
|
490
|
+
**Mitigation:** Key images are points on secp256k1, derived via `I = x * H_p(P || e)`. Collision requires finding two distinct private keys that produce the same key image for a given election — equivalent to finding a collision in the hash-to-point function composed with scalar multiplication. This is computationally infeasible under standard cryptographic assumptions.
|
|
491
|
+
|
|
492
|
+
### 10.3 Encrypted Ballot Timing
|
|
493
|
+
|
|
494
|
+
**Threat:** An observer correlates the timing of ballot submission with voter activity to de-anonymise votes.
|
|
495
|
+
|
|
496
|
+
**Mitigation:** Voters SHOULD submit ballots at random times during the voting period, not immediately after the election opens. Clients SHOULD implement random delay. Additionally, the use of ephemeral pubkeys for ballot submission prevents linking a ballot to a voter's known Nostr identity.
|
|
497
|
+
|
|
498
|
+
### 10.4 Tally Authority Collusion
|
|
499
|
+
|
|
500
|
+
**Threat:** All tally authorities collude to decrypt ballots before the election closes, or selectively reveal individual votes.
|
|
501
|
+
|
|
502
|
+
**Mitigation:** Threshold decryption (m-of-n) ensures that fewer than `m` authorities cannot decrypt. The threshold should be set high enough that collusion is impractical. For community elections, a 3-of-5 threshold is recommended. Tally authorities SHOULD be from different organisations or jurisdictions.
|
|
503
|
+
|
|
504
|
+
### 10.5 Ring Size and Anonymity
|
|
505
|
+
|
|
506
|
+
**Threat:** Small ring sizes provide weak anonymity. In a ring of 5, each voter has a 20% chance of being the signer.
|
|
507
|
+
|
|
508
|
+
**Mitigation:** Elections SHOULD enforce a minimum ring size. The recommended minimums:
|
|
509
|
+
- Organisational: 5 (acceptable given participants are known)
|
|
510
|
+
- Community: 20
|
|
511
|
+
- National: 1000+
|
|
512
|
+
|
|
513
|
+
Elections with fewer eligible voters than the minimum ring size MUST NOT proceed, or MUST clearly disclose the reduced anonymity.
|
|
514
|
+
|
|
515
|
+
### 10.6 Quantum Threats
|
|
516
|
+
|
|
517
|
+
**Threat:** A quantum computer could break the discrete logarithm problem underlying secp256k1, allowing recovery of private keys from public keys and breaking ring signature anonymity.
|
|
518
|
+
|
|
519
|
+
**Mitigation:** This is a long-term threat shared with all secp256k1-based systems (including Nostr itself and Bitcoin). The Signet protocol spec §18.3 mandates a post-quantum migration path. When post-quantum ring signature schemes mature (e.g., lattice-based), the voting extension will migrate. In the interim, the practical risk is low — quantum computers capable of breaking secp256k1 do not yet exist.
|
|
520
|
+
|
|
521
|
+
### 10.7 Relay Censorship
|
|
522
|
+
|
|
523
|
+
**Threat:** A relay refuses to accept or relay ballot events, effectively disenfranchising voters.
|
|
524
|
+
|
|
525
|
+
**Mitigation:** Voters can submit ballots to multiple relays. Election definitions SHOULD specify multiple recommended relays across different jurisdictions. The Nostr protocol's relay diversity is a natural defence.
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## 11. Future: National-Scale Elections
|
|
530
|
+
|
|
531
|
+
This section describes mechanisms that are NOT part of v0.1.0 but are planned for future versions to support national-scale elections with full coercion resistance.
|
|
532
|
+
|
|
533
|
+
### 11.1 JCJ Coercion Resistance
|
|
534
|
+
|
|
535
|
+
The Juels-Catalano-Jakobsson (JCJ) protocol provides full coercion resistance through:
|
|
536
|
+
|
|
537
|
+
- **Fake credentials:** Voters can generate fake voting credentials that are indistinguishable from real ones. Under coercion, the voter provides a fake credential. The coercer cannot tell whether the credential is real.
|
|
538
|
+
- **Credential validation at tally time:** Only real credentials produce valid votes. Fake credentials produce ballots that pass verification but are silently excluded during tallying.
|
|
539
|
+
|
|
540
|
+
This requires a more complex credential infrastructure than the current ring signature approach.
|
|
541
|
+
|
|
542
|
+
### 11.2 Deniable Encryption
|
|
543
|
+
|
|
544
|
+
A voter can encrypt their ballot such that, under coercion, they can produce a plausible decryption to a different vote. The real vote is only recoverable by the tally authority.
|
|
545
|
+
|
|
546
|
+
### 11.3 Scale Challenges
|
|
547
|
+
|
|
548
|
+
National-scale elections introduce challenges not present at community scale:
|
|
549
|
+
|
|
550
|
+
- **Ring size:** Millions of eligible voters. Ring signature computation scales with ring size. Efficient constructions (sub-linear proofs) are required.
|
|
551
|
+
- **Tally time:** Decrypting and verifying millions of ballots. Parallelisable tally protocols are needed.
|
|
552
|
+
- **Accessibility:** Non-technical citizens must be able to participate. Hardware security modules, polling station terminals, and mobile apps must all be supported.
|
|
553
|
+
- **Legal integration:** National elections are governed by detailed legislation. Protocol compliance must be formally verified.
|
|
554
|
+
|
|
555
|
+
### 11.4 Roadmap
|
|
556
|
+
|
|
557
|
+
1. **v0.1.0** (this specification): Organisational and community elections with linkable ring signatures and re-voting
|
|
558
|
+
2. **v0.2.0**: Improved ring signature efficiency for larger rings, multi-authority key generation protocols
|
|
559
|
+
3. **v1.0.0**: National-scale with JCJ coercion resistance, deniable encryption, formal security proofs
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
*This specification is an extension to the Signet protocol. It will evolve through community feedback and implementation experience.*
|