Takamichi Tsutsumi
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 2-party private binding computation using garbled circuits What is this: 2-party computation that let 2 parties to compute agreed upon function with their private data forcing them to take some pre-defined on-chain action depending on the result of the computation. By using garbled circuit and some zkps, we can construct such scheme as publicly verifiable 2-party computation. [MPC Discussion](https://www.notion.so/Casual-MPC-Discussion-f5e60eb389ee4633869963894e5ac59c) ## What is MPC (Secure multiparty computation)? Quick review. MPC is a cryptographic schemes that enable multiple parties to jointly compute a function on their private inputs without revealing any information about their inputs to the other parties. ![](https://i.imgur.com/gvClZ0O.png) Parties: P_1, ..., P_n Secret Inputs: x_1, ..., x_n Evaluate: f(x_1, x_2, ..., x_n) ### Important requirements to consider - Correctness : Parties should get correct output - Security : Parties should not learn anything other than the output ### General MPC Schemes #### Linear Secret Sharing Scheme (LSSS) based MPC Use *additive homomorphism* of secret sharing scheme, parties can compute addition and constant multiplication on secret shares. Multiplication requires additional values and opening of the intermediary values (Beaver's trick). LSSS based MPC requires number of rounds of communication between parties based on circuit size. (Rounds complexity) --- **Additive homomorphism [x] denotes share of x [x] + [y] = [x+y] c * [x] = [c*x] where c is some constant value **Beaver's trick goal: calculate [x*y] from [x], [y] preparation: pick three random a, b and c s.t. c = a * b for each multiplication gate and distribute as shares. Now, every party has [x], [y], [a], [b], [c] calculate [d] = [x] - [a], [e] = [y] - [b] locally. Open [d] and [e] to reconstruct d and e from shares. But parties keep [a] and [b] keep private so that no one learns about your [x] and [y]. d = x - a, e = y - b now, [x*y] = d * [b] + e * [a] + [c] (+ de) **(1 party in a network has this +de term if additive sharing scheme is used) --- #### Garbled Circuit 2-party computation using encryption of a circuit gates and oblivious transfer. This scheme is efficient in 2-party settings. It requires only constant number of rounds communication. Comparing to LSSS-based MPC, GC-based MPC requires only constant round of communication, but it requires more data size depending on the circuit.(Communication complexity) ### Difficulty of n-party computation n(>2)-party computation -> Efficiency of MPC degrades dramatically as number of parties increases. (LSSS-based, GC-based) -> we focus on 2-party computation ## Publicly verifiable (auditable) MPC Normally, the result of multi party computation can be verified by the parties who joined the computation. (LSSS-based, GC-based) There is a construction called publicly verifiable(auditable) MPC. In this construction, we generate additional transcript along with the computation to prove the correctness of the computation to public. Usin this proof, we can convince the output correctness to anybody even who did not joined the computation. ![](https://i.imgur.com/qW2U55A.png) ## What is garbled circuit? [Briefly explain garbled circuit] Suppose Alice and Bob want to compute a function `f` on their secret inputs `x_a` and `x_b`. 1. Alice encrypt circuit wires and gates with her inptus `x_a` so that Bob cannot learn about `x_a` ![](https://i.imgur.com/XMxI4iR.png) 2. Alice sends the encrypted circuit to Bob ![](https://i.imgur.com/pyf3wpJ.png) 3. Bob evaluate the circuit using his private input `x_b`. In this step, he asks Alie decryption key of gates corresponding to his secret inputs using Oblivious Transfer. ![](https://i.imgur.com/fjVcYzG.png) In this way, 2-party securely compute on a certain function over their private inputs. With constant rounds of communication. * https://vitalik.ca/general/2020/03/21/garbled.html * https://web.mit.edu/sonka89/www/papers/2017ygc.pdf ## Private binding 2-party computation Using garbled circuit, we can construct some interesting scheme called private binding computation. ### What is it? It's a 2-party computation using garbled circuit with *binding property*. Binding property: the two parties are enforced to execute some pre-defined on-chain activity after evaluation of the garbled circuit. ### How? Create a circuit which produces signatures of both party under pre-defined condition. (for example, if price matches) 1. Alice and Bob agree upon certain circuit. 2. Both parties encrypt the circuit with their own private inputs. 3. Generate zk proof of correct garbling of the circuit. 4. Send the circuits and proof to each other.(exchange the encrypted circuits) 5. Now, Alice has circuit which Bob encrypt with his private inputs and vice versa. 6. Both parties evaluate the circuits. 7. They get output in both sides and get output with signature if some condition holds. 8. Create a zk proof of correct execution. 9. Both party can submit transaction using the signature and proof to enforce some on-chain activity. ![](https://i.imgur.com/1crXMgj.png) --- ![](https://i.imgur.com/zI6K05q.png) --- ![](https://i.imgur.com/FKQt7iE.png) --- ![](https://i.imgur.com/fix4J7G.png) --- ![](https://i.imgur.com/w45gp0c.png) ## Example Applications - Fair swap tx execution after price matching - Use KYC ML model result on-chain - Machine learning with private model and private input ## Discussion points - What are the potential applications we can build with this construction? - Is this binding property good thing for users? (Do users want this?) ## Ideas #### Framework for application for this construction Use this template to create ideas of applications. ![](https://i.imgur.com/8OLN5xO.png) --- #### Example of fair token trading ![](https://i.imgur.com/pH60GzL.png) # IDEATION Dark Forest Plugin for Private Collaboration - Alice inputs: own planet locations and intended direction of expansion. - Bob inputs: own planet locations and intended direction of expansion. - What circuit does: calculates the average distance of separation between players and a yes/no if the players are in route of expansion colision. - On-chain activity: (I´m not sure) gas to pay the coordination mechanism. No data should be public besides maybe initiating the MPC mechanism. --- [ZK Federated Learning ZK Federated Learning]( https://www.notion.so/pse-team/ZK-Federated-Learning-Initial-Idea-bf662d2b46a14406b1472c3441a15e44?pvs=4) Public ML model - Alice inputs: private health data A - Bob inputs: private health data B - What circuit does: trains model and proves it's with the correct data - On-chain activity: --- [MPC Correlation Finder](https://www.notion.so/pse-team/MPC-Correlation-Finder-Initial-Idea-49680fb495f84afb960674951bbe2e18?pvs=4) - Alice inputs: health data - Bob inputs: location data - What circuit does: checks correlation of diseases with different parameters - On-chain activity: --- Private KYC model inference - Alice (KYC provider) inputs: KYC machine learning model - Bob (citizen) inputs: id data(passport/id number/etc) - What circuit does: Evaluate the ML model using the id data and test if the id is valid or not. - On-chain activity: Issue certificate of having valid id data. --- International Trade Negotiation - Alice inputs: production metrics, tariffs, quotas, goals - Bob inputs: production metrics, tariffs, quotas, goals - What circuit does: calculates if there is a match - On-chain activity: --- Private auction - Alice (auction organizer) inputs: current auction price - Bob (auctioner) inputs: proposing a new auction - What circuit does: tells if it's higher than current or not - On-chain activity: execute trade at the end of the auctino --- - Alice inputs: - Bob inputs: - What circuit does: - On-chain activity: --- - Alice inputs: - Bob inputs: - What circuit does: - On-chain activity: --- - Alice inputs: - Bob inputs: - What circuit does: - On-chain activity: --- - Alice inputs: - Bob inputs: - What circuit does: - On-chain activity: --- ## Challenges - Because of the OT’s asynchronisity, it’s hard to guarantee the fairness(liveness) even in 2pc using garbled circuit - identifiable abort in 2PC is hard. gradual release is much easier - Verifying the correct garbling of circuit - This can be done with zk proof - What is an performance bottleneck? - circuit size (how large circuit can be?) GC-based MPC requires big amount of data to download and upload. (data size) - Garbled Circuit requires binary circuit - https://eprint.iacr.org/2012/255.pdf

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    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

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully