How beatrizlaranjinha/kaonashi works
Kaonashi is an encrypted, decade-based movie voting system. Voters select a movie in the frontend, which forms an encrypted one-hot vote and zero-knowledge proofs, then submits it through the API to the Solana program. The program validates voter eligibility and proofs and updates encrypted tallies; the chairperson manages ballots and election state. Results are decrypted off-chain and a winner is recorded on-chain. The graph includes documented capabilities whose detailed implementation was not sampled; those links are limited to the documented integration points.
Main entry points: client.rs API client · handler.rs Election handlers · lib.rs Election instructions · app.rs App and navigation
Components 25
Voting frontend
- App and navigation
kaonashi_frontend/src/app.rs - Movie ballot
kaonashi_frontend/src/pages/vote.rs - Election controls
kaonashi_frontend/src/pages/chairperson.rs - Results and ties
kaonashi_frontend/src/pages/results.rs - API client
kaonashi_frontend/src/api/client.rs
API coordination
- HTTP routes
kaonashi-api/src/bin/main.rs - Election handlers
kaonashi-api/src/handler.rs - Authentication checks
kaonashi-api/src/auth.rs - Vote and receipt state
kaonashi-api/src/keeping_votes.rs - Chain operations
kaonashi-api/src/blockchain.rs
Vote cryptography
- Vote encryption
kaonashi_frontend/src/crypto/vote_crypto.rs - Vote proofs
kaonashi_frontend/src/crypto/zk_vote.rs - Wallet signatures
kaonashi_frontend/src/crypto/wallet_signature.rs
Solana election program
- Election instructions
kaonashi-smart-contract/programs/projeto-kaonashi/src/lib.rs - Ciphertext validation
kaonashi-smart-contract/programs/projeto-kaonashi/src/crypto.rs - Proof verification
kaonashi-smart-contract/programs/projeto-kaonashi/src/proofs.rs - Rollup accounting
kaonashi-smart-contract/programs/projeto-kaonashi/src/rollups.rs - Ballots and voters
kaonashi-smart-contract/programs/projeto-kaonashi/src/election.rs
Off-chain processing
- Vote batching
kaonashi-api/src/batches.rs - Merkle receipts
kaonashi-api/src/merkle.rs - Off-chain crypto and rollups
kaonashi-smart-contract/zk-client/src/crypto.rs - Program client
kaonashi-smart-contract/zk-client/src/solana_client.rs
Other components
- Voter
- Chairperson
- Solana validator
Connections 27
- Voter → App and navigation: uses
- Chairperson → App and navigation: uses
- App and navigation → Movie ballot: opens ballot
- App and navigation → Election controls: opens controls
- App and navigation → Results and ties: opens results
- Movie ballot → API client: submits vote
- API client → Vote encryption: encrypts selection
- API client → Vote proofs: generates proofs
- API client → Wallet signatures: signs requests
- API client → HTTP routes: calls routes
- Election controls → API client: requests election actions
- Results and ties → API client: requests results
- HTTP routes → Election handlers: dispatches requests
- Election handlers → Authentication checks: checks signatures
- Election handlers → Vote and receipt state: stores receipts
- Election handlers → Vote batching: manages batches
- Election handlers → Chain operations: requests chain operations
- Chain operations → Solana validator: reads and writes
- Chain operations → Election instructions: invokes instructions
- Election instructions → Ciphertext validation: validates ciphertexts
- Election instructions → Proof verification: verifies proofs
- Election instructions → Rollup accounting: updates rollups
- Election instructions → Ballots and voters: updates election state
- Vote batching → Merkle receipts: builds proofs
- Vote batching → Off-chain crypto and rollups: prepares rollups
- Off-chain crypto and rollups → Program client: submits rollups
- Program client → Solana validator: reads and writes