update readme with zksnarks

This commit is contained in:
Oskar Thoren 2019-11-04 14:54:04 +08:00
parent c36ad963bf
commit eb85d291ac
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
2 changed files with 9 additions and 25 deletions

View File

@ -12,6 +12,8 @@ This repository contains experimental code related to research for the [vac prot
- [Whisper Scalability Model](./whisper_scalability) - Theoretical model for bandwidth usage given some assumptions and usage, see [report](https://htmlpreview.github.io/?https://github.com/vacp2p/research/blob/master/whisper_scalability/report.html) and [Discuss post](https://discuss.status.im/t/fixing-whisper-for-great-profit/1419).
- [zkSNARKs/Semaphore](./zksnarks/semaphore) - Feasability study for zkSnarks and [Semaphore](https://github.com/kobigurk/semaphore) to do anonymous signaling, including [rate limiting](https://ethresear.ch/t/semaphore-rln-rate-limiting-nullifier-for-spam-prevention-in-anonymous-p2p-setting/5009) in p2p networks (not everything in snarks).
## License

View File

@ -4,31 +4,13 @@ Based on https://github.com/kobigurk/semaphore but only focusing on the core cir
See https://github.com/iden3/snarkjs for a quick start.
According to https://github.com/kobigurk/semaphore#zksnark-statement:
Experimenting with feasability of Semaphore in general and https://ethresear.ch/t/semaphore-rln-rate-limiting-nullifier-for-spam-prevention-in-anonymous-p2p-setting/5009 in particular.
```
The statement assures that given public inputs:
See https://github.com/vacp2p/research/issues/2
signal_hash
external_nullifier
root
nullifiers_hash
Main file in `src/hello.js`
and private inputs:
identity_pk
identity_nullifier
identity_trapdoor
identity_path_elements
identity_path_index
auth_sig_r
auth_sig_s
the following conditions hold:
The commitment of the identity structure (identity_pk, identity_nullifier, identity_trapdoor) exists in the identity tree with the root root, using the path (identity_path_elements, identity_path_index). This ensures that the user was added to the system at some point in the past.
nullifiers_hash is uniquely derived from external_nullifier, identity_nullifier and identity_path_index. This ensures a user cannot broadcast a signal with the same external_nullifier more than once.
The message (external_nullifier, signal_hash) is signed by the secret key corresponding to identity_pk, having the signature (auth_sig_r, auth_sig_s). This ensures that a state of the contract having a specific external_nullifier, ensuring no double-signaling.
```
So we need to setup these identity_* and auth_* inputs.
To play:
- `npm install`
- generate circuits in build dir (see tutorial above)
- `time node --experimental-repl-await -i -e "$(< src/hello.js)"`