Zak Cole
    • 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
    # Architectural Overview Document: Privacy Pools on the Ethereum Blockchain --- ## 1. Introduction Privacy Pools aim to enhance transaction privacy on the Ethereum blockchain. Originating from a demo presented at ETH Denver, the goal is to streamline the process of generating exclusion lists and integrating the PrivacyPools.com UI with the ListDAO API. This document is an expansion of the [original Privacy Pool Spec](https://paper.dropbox.com/doc/Shared-Privacy-Pools-Spec-v1-0doxLHuW1o6yyMKRGetNf). More information regarding privacy pools can be referenced in [this whitepaper](https://deliverypdf.ssrn.com/delivery.php?ID=626090113083013000115126087004007104014031023082031066109095073127121008106116065089099038000101119039109118030105097122030093015059068041031118011074105013105118030069092013073102098120026125002106026093072126119090124081085099071105111084066077104122&EXT=pdf&INDEX=TRUE) and [this GitHub repository](https://github.com/ameensol/privacy-pools). ### 1.1 Definitions **Exclusion List**: A canonical list from ListDAO containing flagged deposits. Represents deposits users will typically exclude from their anonymity set. **Inclusion List**: Lists deposit commitments considered "clean" for inclusion in users' anonymity sets. Publishing the inclusion list merkle root hash on-chain offers better operational efficiency, given its less frequent updates compared to the exclusion list. Periodic on-the-hour updates for both lists are recommended, with special considerations for transactions occurring between these hourly marks. --- ## 2. System Overview The Privacy Pools system primarily consists of: - Privacy Pools Smart Contracts - PrivacyPools.com UI (not covered in this document) - ListDAO API --- ## 3. Components Breakdown ### 3.1. Privacy Pools Smart Contracts - Forked from tornado cash contracts. - Introduces an edited withdrawal function to allow ZK-proof-of-exclusion. - Uses a new ZK circuit, distinct from tornado cash. ### 3.2. ListDAO API #### Operation: 1. Monitors incoming deposits to the privacy pool smart contract. - Subscribe to events on contract. - Publish data associated with these events to a database. 3. Maintains a canonical “exclusion list”: - New deposits are added for a week. - Chainalysis API checks determine if deposits stay on the list. - Cronjob pulls from Chainalysis API at periodic intervals to ensure list is up to date. - Non-compliant withdrawals also contribute to the list. #### Canonical Exclusion List Contains: - Deposits from illicit sources (1-week detection period). - All deposits within the last week. - Non-compliant privacypools withdrawals. The API offers: - The canonical exclusion list. - Periodic on-chain publication of the exclusion list's merkle root for validation. --- ## 4. System Build Tasks ### ListDAO Data Processing: - [ ] Monitor and save all new privacy pool contract deposits. ### ListDAO Chainalysis Client: - [ ] Develop an API client to cross-check transactions/deposit addresses. ### ListDAO List Management: - [ ] Add deposits to the exclusion list. - [ ] Query chainalysis for origin validation. - [ ] Recheck uncertain origins after one week. - [ ] Remove verified deposits post one week. - [ ] Flag and add non-compliant withdrawals. ### ListDAO API Endpoints: - [ ] GET /exclusion_list: Returns exclusion list addresses. - [ ] GET /inclusion_list: Returns inclusion list addresses. - [ ] GET /check_address: Validates inclusion/exclusion status. - [ ] GET /check_addresses: Batch validate inclusion/exclusion status. ### ListDAO Blockchain Operations: - [ ] Periodically post the exclusion list's recent merkle root to a smart contract. ## 5. ListDAO API Schema #### 5.1. **Endpoints** - **GET `/exclusion_list`** *Description*: Returns the full exclusion list addresses for a given merkle root. *Parameters*: - `merkle_root` (optional): The root to fetch. If not provided, defaults to the most recent. *Response*: - Array of objects: `{ txhash: string, commitment: string }` --- - **GET `/inclusion_list`** *Description*: Returns the inclusion list addresses. *Response*: - Array of addresses: `[address1, address2, ...]` --- - **GET `/check_address`** *Description*: Validates if a given address is included or excluded. *Parameters*: - `address`: The address to check. - `commitment`: The commitment to check. - `merkle_root` (optional): The merkle root to use. If not provided, defaults to the most recent. *Response*: - `{ is_included: boolean }` --- - **GET `/check_addresses`** *Description*: Batch validate inclusion/exclusion status for addresses. *Parameters*: - `addresses[]`: An array of addresses to check. - `commitments[]`: An array of commitments to check. - `merkle_root` (optional): The merkle root to use. If not provided, defaults to the most recent. *Response*: - Array of booleans: `[true, false, ...]` (where `true` means included and `false` means excluded) --- - **GET `/historical_association_by_merkle`** *Description*: This endpoint retrieves historical association sets for a given merkle root. By providing a specific merkle root, users can see the state of associations (exclusion or inclusion) at that specific point in time. *Parameters*: - `merkle_root`: The merkle root for which the historical association set is desired. *Response*: - An object which includes: - `merkle_root`: The provided merkle root. - `timestamp`: The timestamp when this merkle root was generated. - `association_set`: Array of addresses/commitments associated with this merkle root. - `type`: Specifies whether the association set refers to "exclusion" or "inclusion". --- #### 5.2. **Error Handling** All endpoints should have standardized error handling, returning appropriate HTTP status codes, e.g., `404` for not found, `400` for bad request, etc. An example error response: ``` { "error": true, "message": "Description of what went wrong." } ``` --- #### 5.3. **Security & Authorization** To ensure the API's data integrity and prevent abuse: - Rate-limiting should be applied. - All endpoints could have authorization checks where relevant, perhaps via API tokens or other authentication mechanisms (sign in with Ethereum?). --- #### 5.4. **Response Metadata** It might be useful to include metadata in responses, especially for lists, to give context, e.g., pagination details, timestamps, etc. ``` { "data": [ ... ], "metadata": { "timestamp": "2023-10-01T12:00:00Z", "total_records": 100, ... } } ``` --- #### 5.6. **Caching** Given that some of these endpoints might have heavy loads or could serve similar data frequently, appropriate caching strategies should be implemented to improve performance. --- ## 6.0 TODO - Admin UI - ASP UI is for flagging deposits and deciding whether they belong in the association set -

    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