Gonçalo Pestana
    • 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
    --- title: Brave - RFC&C submission reviews and notes tags: rfcc, themis --- # RFC&C submission reviews and notes ### Team submission repo **L2 layer** - [O1Labs submission](https://hackmd.io/@izzy/rJApOn5zu) - [The BBA implementation](https://github.com/imeckler/bba) - [Q&A v2](https://docs.google.com/document/d/1bQSrfDPYpNKxCYvetnIXKY2JHApIzJa-OLf6irLVD9g/edit) - [AZTEC submission](https://hackmd.io/@jaosef/HyY2lKI-O) - [AZTEC Q&As](https://hackmd.io/OR_Tt9qjQ6S-gXiHx8NhQQ) - [StarkWare submission and Q&As](https://docs.google.com/document/d/1eKPQ5Y9urIQ3VHfhOXqyupBf_GtFwDZDjd0Xzol2-QY) **L1 layer** - [NEAR protocol + ZeroPool submission](https://hackmd.io/@zthUvKNmRheIOgHHOGf1fA/rJf273n4u) - [PoC repo](https://github.com/zeropoolnetwork/libzeropool) - [Solana submission](https://drive.google.com/file/d/1aEX_7G8oCgEwCkGp8jnUsTA_q2zoZCRa/view?usp=sharing) - [THEMISv2 submission draft]( https://docs.google.com/document/d/1EKzestOCp2O4qDeI-p7yvlHrTmzR_f5jxNmN8VlJWfs) - [THEMISv1 upper bounds](https://docs.google.com/spreadsheets/d/1-luZUGtAeivfQQJzwhV4RJaws1WukRPldReIW1TcwXM/edit#gid=0) - [THEMISv1 benchmarking on Solana](https://docs.google.com/document/d/1fLhvHxXzNxUZy7bn6jAWa_7FOZQ9o3D28wWPhziBLSc/edit) - [Solana fees for Brave workloads](https://docs.google.com/document/d/1mqxQ-acas17L29-9hiyTKxwGO7umNiBVQEKWGuySfpY/edit) - [THEMISv1 implementation on Solana](https://github.com/solana-labs/solana-program-library/tree/master/themis) - [Parity + Plasm submission](https://drive.google.com/file/d/1R523_8evyNd2TvsxqYJagmRnRBLWY42X/view?usp=sharing) - [draft/initial ideas](https://hackmd.io/eKQKbsNxSdmhTk5pz3xH9A) - [Plasm follow-up](https://hackmd.io/RLOgGcRiRA2766Mfl1swzQ) - [Ava submission](https://gist.github.com/tyler-smith/5a0c5362c443d0c0a75ee8e160963806) - [Ava sketch v1](https://gist.github.com/tyler-smith/69fdfebbb68eeefd41c598227716446c) - [SKALE submission](https://hackmd.io/EM429T5kRdyoaGI99hQA6Q) **Researchers/others** - [IMDEA submission](https://drive.google.com/file/d/1-5N0Kpqpe84l4Z1Apj40dq4IXqRPxem7/view?usp=sharing) - [eV submission](https://hackmd.io/4XaZnrs4T7SuvlADEdXOYQ) ## RFC&C submission reviews and notes **L2 Summary Table** | Submissions | Proof generation computation | Proof generation bandwidth | Proof verification | Batching | On-Chain verification | | --------|--------|--------|--------|--------|--------| | O1Labs | ≈ 1sec proving time (for BBA update and reward calculation proof) | ≈ 1kB (for BBA update and reward calculation proof) | 1ms per proof + 10ms per batch (for BBA update); xxx (for BBA rewards) | 160 * N sec (N number of proofs to batch); roughly $0.000446 per proof @ GoogleCloud | on Mina: low costs (estimate); on Ethereum: $0.25/ payout for 50M batched transactions | | AZTEC | ≈ 9,300 constraints for BBA update (<1s); ≈ 250 N constrains for reward calculation (5-10s) ||| 4min to aggregate 28 tx in single rollup; aggregating 32*28tx takes 4min => ≈ 2h for building 896 tx rollup (UltraPlonk will be 2.5-3x faster)|| ### O1Labs The suggested protocol is based on THEMIS, but the pairing-based BBA is replaced by a ZKP-based BBA which leverages a roll-up system to batch proofs from multiple users. In addition, we can use Mina as the payout layer for lower on-chain costs and to allow users to verify the on-chain payments without relying on a 3rd party. - ZK-Rollup based protocol in which Brave operates the rollup prover. No privacy sensitive data is handled by this party, so any party could participate as a rollup prover (e.g. foundation); - If the payout L1 is Mina, resource-constrained users can verify the correctness of the payout by checking one SNARK only, without the need to rely on 3rd parties. - The pairing-friendly based BBA are replaced by a BBA constructed with Pasta curves. - The "opening" step of the BBA is replaced by a ZKP proving that the user knows an inner product of the BBA state with the policy vector that is a particular public value (the BAT reward to receive). - For batching the proofs, [O(1) Labs’ pickles library](https://minaprotocol.com/blog/meet-pickles-snark-enabling-smart-contracts-on-coda-protocol) implements the "wrap" and verifier circuits for merging the proofs. The programmer only needs to specify the application logic. **Questions** - Could you elaborate why the scheme relies on Lagrange polynomials -- I believe this is due to how PLONK encodes the program and its constraints? - Is there any mechanism to prevent spending of the BBA update request and the proof of reward? - Could you briefly explain our add references explaining why the scheme does not require a trusted setup? - In the BBA update proof system, you say "Verifier efficiency. Somewhere in the neighborhood of 1ms per proof, plus 10ms per batch." Does that mean you are considering batching BBA update proofs? If so, would those proof happen at a user-level (i.e multiple update from the same user) or at the service-level (i.e. batching multiple update proofs from multiple users)? - Is there any open source documentation of the Pickles SNARK library? - Do you have a ballpark of how cheaper would be the batch proof verification in Mina compared to the numbers for Ethereum? (roughly) - We've implemented a [POC of the pairing-friendly BBA](https://github.com/brave-experiments/sps-eq/blob/main/examples/bba_verification_example.rs). Is there any place where we could check an example of a Snapp similar to needed for THEMIS? - What would the "road to production" look like? I.e. which libraries/frameworks would you recommend to develop the proof verifier, circuits, smart contracts? Are they available already? Are there any required components that are not live yet? ### AZTEC The suggested protocol restructures the BBA encodes it as a merkle tree. The depth of the merkle tree influences the number of interactions we can store in the BBA (e.g. $depth = 10 ==> 2^{10} = 1024$ advertisers). Each BBA update is a PLONK proof (as in O(1) Labs' submission) generated by the user. The on-chain verification is performed using TurboPLONK over batched proofs. The verifier smart contract mints a AZTEC note that allows users to witdraw BAT from their on-chain proof verifications. - The protocol scheme consists of 3 different circuits: the i) ad interaction circuit (to update the BBA); the ii) reward circuit (to calculate reward and prove its correctness); and the iii) batching circuit. - In order to mint an AZTEC note after the reward calculation was verified on chain with lower gas costs, we assume it is possible to re-reploy (or in parallel?) a BAT token smart contract. **Questions** - Double speding protection (we've discussed about this before, but just making sure we are on the same page here): - BBA update: Brave checks if Nullifier has been signed. If not, then no souble spending; - Reward: Brave keeps a list of all signed nulifiers. Brave needs to check if the nulifier in the request has been used before. - Do you have any example of the smart contract that would improve the gas efficiency of withdrawing rewards? - What would the "road to production" look like? I.e. which libraries/frameworks would you recommend to develop the proof verifier, circuits, smart contracts (e.g. which libraries would you recommend to develop the native prover system and the batcher system)? Are they available already? Are there any required components that are not live yet? ### StarkWare The proposed scheme replaces the BBAs with a proof generated by Cairo. The commitment of the state is encoded as a single Merkle tree root, where each of the leaves on the tree encodes the number of interactions each ad had (the interaction vector is represented by the leaves of the tree). - When initializing, the root of the Merkle tree is initialized with 0 and signed by Brave; - At each ad interaction, the user: 1. Updates the state of the tree corresponding to the event; 2. Generates a proof of correct state update with that proves the statement $${(T): Signature.Verify(T) = true Tree.Update(T, adi) = T'}$$ Where $T$ and $T'$ are the old and new merkle tree roots, respectively. 3. Sends the proof, $T$ and $T'$ to Brave alongside the event (ad interaction) through an "anonymous" channel. - Brave checks the proof and, if it validates, signs $T'$ and sends it back to the user. - The scheme above is optimized for batching reward proofs. - In order to avoid double spending, Brave needs to maintain extra state (what, exactly?). The proof to avoid double spending should not increase proving time/bandwidth considerably. **Questions** - Re: batching of the proofs - is it correct to say that it should take about 2-10s to generate a prove of 10 updates on the client side? And a size of <60KB per proof? In production, this proof would be generated by the user daily. - As far as we understood, to verify a batch proof would take a few minutes in an amazon ec2 instance. How big would that batch proof be? i.e. are we talking about a few minutes to verify a batched proof of 10000 proofs, or a few minutes to verify a batch with 10 proofs? We'd expect each user to send a batch proof of 10 proofs per day. Can we estimante how much compute time would take for Brave to verify the one batch proof of 10 proofs for 1M users/day on an Amazon instance (how beefy?) - In order to prevent double spending Brave needs to maintain an extra state. What would that state be exactly? - The scheme that we have been discussing refers to the update of the merkelized state of ad interactions that each user keeps locally and commits to Brave every day. This is the first part of THEMIS. The second part consists of the user calculating the BAT rewards based on the latest merkelized state and proof its correctness to Brave. After the reward is calculated and the proof has been generated, the user can request X BAT and Brave can prove its correctness. Eventually we'd like to batch thousands of proofs of reward calculation from multiple users and verify it on L1. How could STARKs and Cairo help here? Do you have any estimates with regards to the proof generation/batching/verification and L1 costs of such a scheme? ### Solana Solana claims that their high throughput and low tx cost blockchain can be leveraged as a messaging bus between the users and Brave to implement the TAA broadcast channel. In addition, verifying the reward proofs in Solana does not require batching, given its scalability and low costs. For the TAA, each ad campaign (or epoch for many ad campaigns) can be maintained by an account. Each account receives the encrypted requests from users. Once the ad campaign (or epoch) ends, it is trivial to decomission the data accumulated by the account over time. - In Solana, transaction fees are not a significant profit source for validator operations, so there is lower pressure to increase the tx fees; "To find lower fees elsewhere would suggest that either hardware is being used more efficiently or that the network is being artificially subsidized." - In order to enable proving proofs based on bilinear-friendly curves on Solana's VM, the Solana team can add new “runtime builtins” (or what Ethereum calls “precompiles”);

    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