The part most demos skip: the tallies are public, and you can see which nullifier voted which way. What's private is your real identity.
So it's anonymous eligibility + one-vote-per-person โ not a secret ballot. Nullifiers are the primitive.
#Compact
Most "private voting" apps have the same bug: nothing actually stops you from voting twice.
Here's the zero-knowledge fix โ a nullifier โ in ~40 lines of Compact on @MidnightNtwrk.
breakdown in less that 90 secs below .
#MidnightForDevs
The trick: you prove you hold a secret key (a private witness), but the chain only ever stores nullifier = persistentHash(secretKey).
Vote twice โ same hash โ already spent โ rejected. Your identity never touches the ledger.
Code + tests: https://t.co/x2LDGdWQDp
The Midnight-native part: ownership is pseudonymous.
You prove control of a secret key (a private witness); only persistentHash(key) is written on-chain. The kitties + counts are public, who owns them is just a hash. Selective disclosure in practice. @MidnightNtwrk
I found a dead dApp in the Midnight ecosystem and brought it back to life.
midnight-kitties โ a CryptoKitties-style NFT in Compact, originally by Ricardo Ruis โ was stranded on a retired testnet + old compiler. I rebuilt it and shipped it live. Credit to Ricardo Rius for the original concept; this is a modern rebuild.
Thread #MidnightForDevs
The rebuild? Yes on current Compact:
- self-contained, zero external deps
- NFT primitives (ownerOf / balanceOf / mint / transfer) written inline
- mint, transfer, a for-sale marketplace, and breeding that bumps a generation counter
- full passing test suite