--- title: PSE team project introduction --- # PSE team project introduction [toc] --- ## 1. MACI - [:computer: Github](https://github.com/privacy-scaling-explorations/maci) - [:green_book: Medium](https://medium.com/privacy-scaling-explorations/release-announcement-maci-1-0-c032bddd2157) - [:blue_book: 中文Medium](https://medium.com/taipei-ethereum-meetup/zkp-%E8%AE%80%E6%9B%B8%E6%9C%83-maci-1faa658a026) - [論共謀中文](https://cla2srbchi.medium.com/%E7%BF%BB%E8%AD%AF-vitalik-on-collusion-%E8%AB%96%E5%85%B1%E8%AC%80-8ecd4e012266) ### 想解決的問題 :grey_question: - **共謀**:自己灌票(Self-voting),金權政治(plutocracy) 和賄賂(bribes) - 人們為了自己的利益可能串通他人,導致多數資源掌握在少數人手裡 - **投票**:投票是共謀中最實際的應用 ### 簡介投票 :+1: - 投票人 - Identity - 如何避免有投票權的人重複投票 - 如何保障投票人的隱私 - 投票選項 - 如何避免賄賂 - 如何確定投的票為選項之中 (e.g. 選項ABCD是否真的選了其中一個,或能被認定為廢票) - 計票 - 中心化: 需有人負責計票,如何避免黑箱 去中心化:如何自動執行 - 如何限制投票時間結束 - 如何正確計票 ### 想法 :bulb: - 使用者有投票的隱私和自由 ### 作法 :hammer_and_wrench: - MACI的作法: - 投票人:公鑰 - 投票選項:加密後的投票選項 - 計票:需有計票人 - 流程: - Alice產生公私鑰 $pub_A/priv_A$ - Alice用公鑰 $pub_{A}$ 向合約註冊 - Alice送出投票結果 - Alice 選擇投 <font color=blue>$\text{i}$</font> - Alice 用私鑰 $priv_A$ 對票簽章 <font color=red>$Sign_{priv_A}($</font><font color=blue>$\text{i}$</font><font color=red>$)$</font> - Alice 用計票人的公鑰 <font color=green>$pub_D$</font> 作加密 <font color=green>$Encrypt_{pub_D}$(</font><font color=red><font color=red>$Sign_{priv_A}($</font><font color=blue>$\text{i}$</font><font color=red>$)$</font></font><font color=green>$)$</font> - 驗證: - 只有計票人可以用他的私鑰 $priv_D$ 解開此票 用 Alice 的公鑰檢查此簽章並還原此票 $\text{i}$ - 想賄賂 Alice 的 Bob 因為沒有計票人的私鑰所以無法解開此票 - 換票: - Alice 可以變票 $\text{i} \rightarrow \text{j}$ - 原先用公私鑰對 $pub_A/priv_A$ 可改成用新的公私鑰對 <font color=purple>$pub_{A'}/priv_{A'}$</font> - Alice 向合約申請 key-change - 用新的私鑰 <font color=purple>$priv_{A'}$</font> 對此指令簽章並用計票人的公鑰 <font color=green>$pub_D$</font> 加密 - 之後 Alice 就能用新的公私鑰對再送一張票 - 計票人收到此 key-change 指令後也會忽略 Alice 換票前的票,只記最後的票 - 驗證: - 只要 Alice 沒有向賄賂她的 Bob 揭露此換票指令,Bob 就不會知道 Alice 改了此票 ### ZKP :zap: 1. 確保 Alice 簽章+加密的訊息非亂碼,但不公開 Alice 的私鑰和 Alice 的票 2. 確保計票人是根據鏈上的資料計算,但不公開所有的票 --- ## 2. Clr.fund - [:computer: Github](https://github.com/quadratic-funding/qfi) - [:earth_asia: 網站](https://clr.fund/#/) - 基於 MACI 和 Quadratic funding 的 infrastructure - Project 可以被資助 ### Quadratic funding 概念 :bulb: - 希望收到越多人捐贈 (vote) 的 project 可以獲得越多的權重 反之如果少數人用高額捐贈的 project 權重會遞減 ### 作法 :hammer_and_wrench: - 會有人發起每一輪 (round) 投票 - 參加者會提供自己的 project 成為被投票的候選名單 - 捐贈者可以用想捐贈的 token (e.g. WXDAI) 給予不同 project 不同數量的 token > 好像無法匿名換票 > 捐贈和提領都是用 `msg.sender` ### ZKP :zap: - 用於驗證計票人有正確計票 --- ## 3. Semaphore - [:computer: Github](https://github.com/semaphore-protocol/) - [:earth_asia: 網站](https://semaphore.appliedzkp.org/) ### 想解決的問題 :grey_question: - 去中心化的使用者登入、身份驗證 - 中心化:server 存使用者的帳號和密碼,若 match 則登入 - 去中心化:帳號和密碼上鏈可以直接被別人重複使用,造成非此帳號密碼的使用者也能登入 ### 想法 :bulb: - Merkle tree 的 membership proof - 不公開密碼也能證明自己是某個群體中 (某顆 merkle tree) 的成員 (merkle tree 的其中一個 leaf) ### 作法 :hammer_and_wrench: - 生成一對公私鑰對 $pubKey/privKey$ - 使用者可以產生自己的群組 (group) - 使用者用 $pubKey$ 向某個 group 註冊身份 - 若被認證則把此 $pubKey$ 加入此 group 的 merkle tree - 使用者用 $privKey$ 即可計算 1. $privKey$ 可以計算公鑰 $pubKey$ 2. $pubKey$ 可以產生該 merkle tree 的 merkle proof - 在此 circuit 中只要公開該 merkle tree 的 root,其他使用者即可知道此使用者是這個 group 的成員 ### ZKP :zap: - 驗證公私鑰對 - 驗證公鑰是某個 merkle tree 的 leaf --- ## 4. Interep - [:computer: Github](https://github.com/interep-project) - [:earth_asia: 網站](https://interep.link/) - 基於 Semaphore 和其他 web2 Oauths 的身份驗證系統 ### 想解決的問題 :grey_question: - 女巫攻擊 (sybil attack) - 以 semaphore 為例,有權利在 semaphore group 中註冊的人可以一次產生好多個 identity 註冊 - 造成此棵 merkle tree 會被重複的 user 填滿,無法再註冊新的 user - **無法保證此 semaphore identity 真的對應到一個實際的 user** - 因此還是需要身份認證機制 ### 想法 :bulb: - 讓 web2 的 oauth (e.g. Twitter, Github...) 對應到唯一的 identity - 並且用 oauth 提供的資料判定此 identity 是否符合註冊資格 ### 作法 :hammer_and_wrench: - 需有 server 連接 oauth - 取得使用者的 oauth 資料 + wallet後決定是否能註冊 - 發布一 Interep 合約,在合約上註冊 semaphore 的群組 - e.g. `group = 1` 有自己的 merkle tree - 若要在 `group = 1` 註冊則在此 merkle tree 新增一個 leaf - 接著 Interep 會更新此 group 的 merkle tree root - 登入: - 使用者一樣連接 oauth + wallet - Interep 會用 oauth 資料和 wallet 計算出使用者的 semaphore identity - 產生 merkle proof,確認是否為 Interep 中的其中一個 group 的使用者 ### ZKP :zap: - 驗證 semaphore identity 是某顆 merkle tree 的 leaf ## 5. RLN (Rate Limiting Nullifier) - [:computer: Github](https://github.com/Rate-Limiting-Nullifier) - [:earth_asia: 網站](https://rate-limiting-nullifier.github.io/rln-docs/) ### 想解決的問題 :grey_question: - Spam - 用 semaphore 的話一個人可以產生不同的 proof 登入 - 使用者如果這樣攻擊的話原本的 semaphore 無法處罰這樣的使用者 ### 想法 :bulb: - 可以讓攻擊者的 secret key 被洩露 - Secret sharing: - 如果有超過某個 rate 的訊息被送出則攻擊者的 secret key 會被公開 - Secret key 被公開後則可以從 semaphore 的 membership 中移除 ### 作法 :hammer_and_wrench: - 用一個 `external nullifier` 當作時間區間的訊息 (可以是鏈上的訊息,某個 epoch) - 如果同個使用者在同個 `epoch` (相同 `external nullifier`) 送出兩個不同的訊息 (e.g. `msg1`, `msg2`) - $a_0$: `identitySecret` $a_1$: `poseidon([identitySecret, epoch])` $x$: signal (`msg1`, `msg2`,...) $$y=a_0 + x \cdot a_1$$ - public 訊息: - $x_1$ (`msg1`) - $x_2$ (`msg2`) - $y_1$ (ZKP用 `msg1` 算出來的public output) - $y_2$ (ZKP用 `msg2` 算出來的public output) - 其他使用者可由一元二次方程式可得斜率 ($a_1$) 跟截距 ($a_0$,即 `identitySecret`) ### ZKP :zap: - 算出某個訊息 $x$ 的 $y$,而不用公開自己的 identity secret ### 用法 :tanabata_tree: - zk-chat - 同個使用者不會在短時間內發太多訊息 (會被視為spam)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up