Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two comprehensive zero-knowledge proof (ZKP) examples demonstrating real-world privacy-preserving applications on Neo N3 using the native BLS12-381 elliptic curve cryptography.
What's New
1. Privacy-Preserving Voting System (
examples/ZKPVoting/
)A complete anonymous voting system where individual votes remain encrypted while the final tally is publicly verifiable.
Features:
Technical Implementation:
2. Privacy-Preserving Transactions (
examples/ZKPTransaction/
)A Zcash-inspired shielded transaction system enabling private value transfers on Neo.
Features:
Technical Implementation:
Technical Details
BLS12-381 Operations Used
Both contracts leverage Neo's native cryptographic operations:
CryptoLib.Bls12381Deserialize()
- Point deserialization and validationCryptoLib.Bls12381Add()
- Homomorphic point additionCryptoLib.Bls12381Serialize()
- Point serialization for storageCryptoLib.Bls12381Pairing()
- Bilinear pairing for proof verificationCryptoLib.Sha256()
- Hash functions for Merkle trees and nullifiersCompilation Status
✅ Both contracts compile successfully:
PrivateVotingContract.nef
(2,307 bytes) + manifest (2,688 bytes)PrivateTransactionContract.nef
(2,773 bytes) + manifest (2,437 bytes)Gas Consumption (Estimated)
Voting System:
Transaction System:
Project Structure
Documentation
Each example includes:
Testing Instructions
Build Both Examples
Deploy and Test Voting System
Deploy and Test Transaction System
Security Considerations
Privacy Guarantees
Attack Resistance
Use Cases
Voting System Applications
Transaction System Applications
Why This Matters
These examples demonstrate:
Checklist
Future Enhancements
Potential improvements for future PRs: