EulerLagrange
    • 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
      • Invitee
    • 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
    • Engagement control
    • 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 Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control 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
Invitee
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
3
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# zkTLS AVS https://www.opacity.network The collusion problem of MPC-TLS makes it so we need decentralized nodes that act correctly. The use of an AVS is requred to circumvent the collusion problem of MPC-TLS. We lay out a high level description of a protocol that circumvents the collusion issue of zkTLS. ## Introduction Building a general purpose verifiable bridge between web2 and web3 is something the founding team of Opacity has been obsessed with for many years now. There are generally three ways to verifiably port web2 data: 1. zkEmail 2. zkJWT (requires OIDC) 3. zkTLS (eg TLSNotary) By far zkTLS is the most powerful. It allows for extracting data from any existing https call and do rich ZKPs on the transcript. Example use cases: 1. Range proof of bank balance, 2. Proof of twitter handle, 3. Proof of KYC for DeFI, 4. Better oracles for price feeds or prediction markets. The use cases range from net new consumer products to oracles with better trust assumptions. We are trying to build a firehose of web2 data into web3 **WITHOUT** extra trust assumptions. Any web or mobile app is fair game. ## Background on zkTLS ### SSL/TLS **HTTPS**- HTTP + SSL + TLS **SSL** - End to end encryption, but is susceptible to a man in the middle attack. **TLS** - Centralized system that solves the man in the middle problem using a certificate authority. This is how your browser knows it's actually talking to your bank. --- To understand why zkTLS without trust assumptions is until now unsolved, we must talk about the details of how SSL/TLS work. **Server** has: 1. Public/Private key pair 2. Public key is signed by Certificate authority **Client** has: 1. Public/Private key pair **Steps of SSL/TLS** 1. Client verifies server certificate signature 2. Both sides do a Diffie-Hellman key exchange to find a shared secret (some point on elliptical curve) 3. X-coord of shared secret is HMAC'd to derive a symmetric key (AES or ChaCha20) 4. Both the client and the server use the SAME set of symmetric keys to encrypt/decrypt the transcript There are two main reasons zkTLS is difficult: 1. Use of a shared secret makes it possible for the client to swap the cipher text. So we **must complicate a normal network request** to trust the provenance, 2. Hashing the shared secret **restricts** the types of MPC we can use. ### Architectures to acheive zkTLS There are only three architectures to achieve zkTLS: - ❌**TEE/SGX** - Clique Offload SSL/TLS to a TEE, and have the enclave sign the request was encrypted/decrypted correctly. - ❌**Proxy witness** - Reclaim protocol The client routes the request through a proxy, and the proxy signs a statement of what traffic they saw go b/w client and server. At scale this architecture will be blocked. - ✅**MPC** - TLSNotary An MPC node helps the client make the request so no one knows the shared secret until the session is finalized. This approach is undetectable by the target server. We must use garbled circuits and oblivious transfer MPC schemes. ## Collusion problem of MPC-TLS In the MPC architecture of zkTLS a fundamental issue arises. The client and the MPC node can collude to reconstruct the shared secret, and **forge arbitrary proofs** from the target server. ### A note on N-way MPC-TLS In a shamir secret sharing MPC scheme it is very efficient to scale the number of parties involved with the MPC. SSS is what is commonly used in MPC-wallets like Lit Procotol. Unfortunately these MPC schemes are not as effective in MPC-TLS. SSS-MPC is unfortunately unavailable to us because of the use of a cryptographic hash to derive the symmetric key(s) from the shared secret. In a SSS-MPC scheme hashing a value where the pre-image cannot be constructed by anyone has extreme overhead. The request may timeout before the request is actually finalized. Another way is to extend garbled circuits and oblivious transfer to work with more than two parties. Sadly this scales very poorly, and is extremely complicated to engineer securely. There are a lot of optimizations for 2-party GC/OT that are unavailable for MPC with more parties. ### A note on proof by committee Another approach is to have the user generate multiple proofs from many nodes before a proof is valid. Unfortunately even this doesn't work in the general case. To explain why imagine we have a committee of 10 nodes, and we want to prove a bank balance. For the first 6 proofs can be done as normal. After the 6th the user can make a debit card TX to change the balance. So the last 4 disagree with the first 6. This leads to a situation **where nodes can get slashed even though they did nothing wrong**. By committee with slashing **ONLY WORKS** if the user can't change the trust value in b/w proofs. Otherwise a malicious user can slash honest nodes. In the case of a price feed we run into issues because the trust changes too quickly for a proof by committee to work. **This presents significant issues with using zkTLS based oracles.** ## Solution to the collusion problem Here we present the main innovation of the Opacity team in the zkTLS space. An innovation that allows us to trust arbitrary proofs with a minimal number of proofs. Fundamentally, it is a subtle shift in perspective. We are confident it's impossible to solve the collusion problem directly within the time contraints of a good user experience. However, if you have a reliable way to detect if someone is trying to collude, then indirectly we can solve the collusion problem. The solution is simple, and has four parts: 1. Commit and reveal scheme, 2. Random selection of MPC-node, 3. On-chain contract of wallet address to web2 account ID, 4. Verifiable log of attempts. --- ### Prove ownership of a web2 account A key part of the solution is a mapping between a wallet address and a web2 account. A UUID is most common, but not universal. Twitter uses a large number as their primary ID in the database. It's standard practice to never change a account ID in a web2 system because it's the primary identifier in the database. This makes it so we can use a committee to prove ownership of a web2 account. As a user, I might generate 6 identical proofs from different nodes in order claim a web2 account. Having a mapping of web2 accounts to wallet addresses is a essential part of how we solve the collusion problem. --- ### Walkthrough of proof generation Assume: - We have a decentralized network of MPC nodes, - The protocol can randomly select a MPC node for each job. The protocol to generate a proof is as follows: 1. Commit the claim, 2. MPC node is selected **AFTER** commitment of claim, 3. Prove the generated proof matches the claim. 4. Prove the correct wallet address is presenting the proof (via web2 identity contract) Lets walk through the example of notarizing a bank balance to help us understand. Say I have $100 in my account, but I am trying to forge a proof that I have $1m in my account using a colluding MPC node. 1. Commit "$1m" 2. Selected MPC-node is **NOT** colluding node 3. ❌ The wrong MPC node was selected, and in the verifiable log we have a failed attempt. Let's say we tried 5 times until we got the colluding node. Our verifiable log of attempts would look like: 1. ❌ 2. ❌ 3. ❌ 4. ❌ 5. ✅ Even though the user generated a forged proof, they have left behind a verifiable log of failures. As such, the protocol can reject a proof if it is preceded by a string of failures. Naturally there is a sybil issue here that is taken care of by the web2 identity contract. Since we have a mapping of web2 accounts to wallet addresses, only 1 wallet address is allowed to present proofs for any web2 account. So a user **CANNOT** rotate wallets until they succeed. **QED** ### A note on zkTLS Oracles In many cases an oracle is trying to port public data which is not associated with an account. Say a public price or weather feed. In this case we no longer have the web2 identity contract, and so we must solve the sybil issue seperately. We can limit the number of oracles, and have them stake. We can also be a lot stricter with the verifiable log of attempts. The oracle won't have random access ability to forge a proof. They will leave behind a log of failures before they can forge a proof. ### Sourcing randomness 1. Hash onion 2. MPC setup 3. RanDAO (https://github.com/randao/randao) ### Rules for slashing MPC nodes 1. Node has too many failed requests, 2. Doesn't use SGX, 3. User can prove knowledge of MPC-node key share before session finalization, 4. MPC node tried to force user down a malicious path ### Rules for slashing zkTLS Oracle 1. Oracle is offline 2. MPC node can prove knowledge of oracle key share before session finalization. 3. Too many failed requests

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