Vote sharing
In shyvoting-v1, how a ballot voted is public on the canonical ledger (anyone can verify the tally), but which participant cast which ballot is not: the identity_hash → ballot_id linkage lives only with the reconciling authority (RA), off-chain. Vote sharing lets a participant give another account ongoing access to that linkage for their own votes -- for example so two citizens can see how often they agree -- without the RA, the operator or the IDV enclave being able to create such access on anyone's behalf.
The model
- One way. Alice sharing with Bob lets Bob see Alice's votes. Bob's stay private unless Bob shares with Alice.
- Ongoing until withdrawn. One grant, no per-access approval and no expiry. Alice can withdraw at any time; it takes effect on Bob's next request.
- Only the granter is verified. The grantee is just a named account; their own sign-in has to be that account.
- Every access is logged as a reveal, and the granter can see who looked and when.
How a grant is made
Granting works the way a ballot is authorized: the device holds the key, and the IDV enclave vouches for it.
- The device is enrolled. Right after the participant's identity verification, their device enrolls with the IDV attestation enclave and keeps a device secret. A Didit session id alone can't enroll a device -- the device committed to its own secret before the scan.
- The enclave vouches for the device's sharing key. The device keeps an Ed25519 vote-sharing key in its keychain and asks the enclave (
POST /vote-share/attest-key) to vouch for it, proving its enrollment with an HMAC under the device secret over the newline-joined fieldsshyware-vote-share-key-request-v1, account, device, public key and time. The enclave signsshyware-vote-share-key-v1, account, public key (newline-joined). - The device signs the grant. The grant names the purpose (
vote_share), scope (all_votes), granter, grantee, a fresh id and the time; the device signsshyware-vote-share-grant-v1, id, purpose, scope, granter, grantee, time (newline-joined). - The RA stores it only if the enclave's statement and the device's signature both verify against the enclave's pinned public key, the grant is the caller's own, it names an existing account, and it was signed within the last 10 minutes.
Nobody without the granter's enrolled device can produce a grant: not the RA (it never holds the device's keys), not the operator, not the enclave (it never holds the device's sharing key), and not anyone who knows the participant's Didit session id.
How access is checked
On every request that would reveal one participant's votes to another account -- a vote comparison, another citizen's thumbprint -- the RA:
- looks up an active (not withdrawn) grant from the owner naming the requesting account;
- re-verifies the enclave's statement and the device's signature;
- confirms the requester's own sign-in is the named grantee;
- logs the reveal, then answers.
The enclave is never in the access path, so it never learns when a grant is used. Withdrawal is recorded where access is checked, so there is no window in which an already-issued token keeps working.
What each party learns
| Party | Learns |
|---|---|
| IDV enclave | That a verified account has a sharing key (when it vouches). Not who it shares with, not when anyone looks, never how anyone voted. |
| Reconciling authority | Who shares with whom, and each reveal. It already holds the pseudonymous linkage this exposes; a grant changes who else may see it, not what the RA holds. |
| Auth provider (Firebase) | Sign-in only. Stores none of this. |
| Grantee | The granter's votes, in readable form. Withdrawal stops future access; it cannot take back what was already seen. |
This is GDPR Art. 4(5) pseudonymisation throughout: the RA processes pseudonymous personal data, and a grant is the data subject's own instruction to disclose it to a named recipient.
Compared with shystore health-record disclosure
Vote sharing follows the same pattern as selective disclosure of sealed records in shystore-v1 (e.g. a patient granting a provider ongoing access to a category of records):
| shystore selective disclosure | Vote sharing | |
|---|---|---|
| Who consents | The record owner, per recipient and purpose | The voter, per recipient (purpose: vote_share) |
| Scope | Per category (e.g. Condition, Observation) | all_votes (the only scope today) |
| Duration | Ongoing until consent is withdrawn | Ongoing until withdrawn |
| What is disclosed | Sealed payloads, opened via the RA reveal path | The owner's ballot linkage (directions are already public on the ledger) |
| Each access | RA reveal event | RA reveal log entry |
| Who can create it | The owner | The owner's enrolled device only |
Two differences are worth stating plainly:
- Where the consent record lives. shystore's design writes consent records to List 2 of the ledger. Vote-share grants are held by the RA, off-chain, as device-signed records anyone with the enclave's public key can re-verify. Writing them to the ledger is possible but isn't done today.
- What a reveal opens. A shystore reveal decrypts a sealed payload; a vote-share reveal exposes linkage, because vote directions are public by design.
API (reference deployment)
| Endpoint | Auth | Purpose |
|---|---|---|
POST /api/vote-shares/grants | sign-in | Body: {grant, device_sig, grantor_pub_key, key_attestation_sig}. Stores a grant after both signatures verify. |
DELETE /api/vote-shares/grants/:userId | sign-in | Withdraws your grant to that account. |
GET /api/vote-shares/grants | sign-in | Your active grants, given and received, and the reveals of your votes. |
iOS: VotingClient.signVoteShareGrant(grantorUid:granteeUid:) produces the signed body; the device must be enrolled first (enrollDeviceSecretIfNeeded).