Oskar
    • 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
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
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
  • 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Project AAMO **anon-aadhaar x mopro collab.** ## Updates *This document was last updated 2024-02-21.* *Update: 2024-02-21: We have now derisked things with MoPerf and feel confident to resume this work. See [MoPerf](https://hackmd.io/5ItB2D50QcavF18cWIrmfQ?view=) for more details.* *Update 2024-01-25: Due to high technical risks and uncertainties with performance for significantly increased constraints (currently ~160k to 1.7m from last PoC; at least ~1m constraints needed for Anon-Aadhaar to be useful) we decided to do a performance due diligence bet first before resuming Showcase App.* ## Problem There are two main problems we want to address. One, right now it isn't easy for programmers who want to use anon-aadhaar to build for mobile. This is primarily because (i) the tooling is currently too complex (ii) performance in mobile browsers is so bad that it either takes a very long time to do proofs (old circuits) or isn't possible at all (new circuits). Two, ZK projects that rely on client-side proving want to build for mobile, but currently it is quite complex and tooling isn't robust and performant enough. This is primarily because there are no good production-grade libraries for doing client-side proving on mobile, that are easy to use and with robust performance. ### User stories Another way of phrasing the above is as user stories. For clarity and consistency, we write user stories below on the form: As a {role}, I want to {action}, so that {benefit}. **Anon-Aadhaar SDK user:** As a programmer with an interest in using anon-aadhaar, I want to see an example showcase app, using the anon-aadhaar SDK, that is convincing from a UX and performance POV, that is easy to understand and build on, so that I have confidence that I can make my own successful anon-aadhaar app on top. **Mopro user:** As a programmer working on a ZK protocol with client side proving (e.g. anon-aadhaar), I want to use a tool that makes it easy for me to create and verify proofs on mobile, it should easy to understand and get started with, it should be fast, it should be robust, it should work for many platforms, it should allow me to use my existing skills as opposed to learning too many new things, so that I can create a great anon-aadhaar SDK for my users. ### Secondary user stories These are secondary user stories to cover the whole range, from people working on tooling to end user. They should not be the primary focus, because it'll dilute the effort, but they are useful to keep in mind. **End user (prover):** As an event attendee, I want to be able to prove I have a valid Aadhaar identity, without revealing anything else, and to do so from my mobile phone, in a fast and fluid manner, so that I can authenticate in real life, without risking data loss. **End user (verifier):** As an event organizer, I want to able to verify that a user has a valid Adhaar, and to do so from my mobile phone, in a fast and fluid manner, with reasonable security guarantees, so that I can be sure only people with a valid Aadhaar gets access. **mopro developer:** As a programmer working on mopro, I want to have a concrete artifact to build for, with specific requirements and constraints, so that I can build a great tool for people with an interest in doing client-side proving on mobile. ### Current status This is the baseline and what we want to address. **anon-aadhaar:** Currently the primary way to use anon-aadhaar is through a web browser. This has problems when it comes to performance (slow proving time), persistence (keeping your ID around for a long time), as well as security (process isolation, user trust issues). With recent changes to the circuits to increase affordances (prove things about specific parts of your digital identity), performance (primarily proving time, but also key size) is currently a bottleneck for users who want to build on anon-aadhaar. Specifically, it now takes around 60 sec time to create proofs on MacBook Pro M1 Pro (16 GB RAM) hardware/environment. There have been many interesting hackathon projects targeting anon-aadhaar, but very few have targeted mobile specifically. This is likely because of (i) complexity of building for mobile (ii) lack of a good tool, e.g. a mobile SDK. There exists a very rough PoC built with mopro called pocket-aadhaar (created by Yanis and Oskar), but it is very rough and far from production-ready. **mopro:** Mopro is a new library that aims to make it simple and fast to create proofs on mobile. While some PoCs have been built, and performance improvements demonstrated, it is still lacking in terms of usability, robustness and performance. It is too hard to get started, you can't create a project without working inside the repo, the API is rough, there are bugs, working on real-world devices needs to be more robust, and there are some low-hanging fruit to further improve performance. Additionally, there doesn't exist a good "showcase app" that shows how mopro can be used to build real production-grade applications. The lack of this makes it harder for ZK teams to justify effort to use mopro due to the perceived risk of a new tool. ## Appetite We want to constraint the problem such that we can solve it in five weeks. ~Feb 22 - Mar 29. Because we are addressing two problems, we can imagine these are two tracks, working closely together and feeding into each other. Since this is a cross-team collaboration, fixing the time period makes it easier to coordinate and to ship something valuable in time. We imagine the two tracks consisting of ~2-3 people each. On anon-aadhaar side, two programmers and one PM/designer. On mopro side, two programmers. Specifically, Yanis, Vivian and Oskar. ## Solution We divide the solution into two parts, app and tool. The first is the ZK ID Showcase App and the second is the mopro MVP. ![image](https://hackmd.io/_uploads/HkWPVMm3p.png) ### ZK ID Showcase App Solution for this has three components: App Performance UX, DevEx. The goal is to integrate Anon Aadhaar on mobile with the aim of enabling other developers to replicate this functionality. Based on what developers have asked for, building a React Native (RN) library for npm publication seems like a practical. The goal is to leverage Mopro's native performances and wrap with RN. #### App ![image](https://hackmd.io/_uploads/HJ7iNf7ha.png) - Create a basic app using Anon-Aaadhaar that interact with the main Anon Aadhaar component - This main Anon Aadhaar component will be imported from RN Anon Aadhaar library and will have the following features: * Scan an Aadhaar secure QR code * Create proof from the QR code data * Verify this same proof * Update user state (`identity-proven`: true | false) * Don't need a lot of bells and whistle but should feel polished/native * Example app part of RN lib repo w #### Performance UX ![image](https://hackmd.io/_uploads/r17gBfX3T.png) - Smooth UX from a performance POV (from end user perspective) - ~30s proving time on modern devices - Background loading of assets if possible - Possibly proving in background if supported (investigate) - A lot of this should be enabled from mopro, but some work might be required #### DevEx ![image](https://hackmd.io/_uploads/HJvNHGmhp.png) - Should be easy to work on and deploy by developers - Working on Android and iOS (using mopro bindings for both) - React Native library support (one code base) - `@anon-aadhaar/react-native` as npm module - Handles circuit inputs from QR code scan - Provides UI components - RN lib should abstract native bindings and Anon Aadhaar setup, devs should import one main component from RN lib - Interact with Mopro's native components for verify/generate proofs - Native modules to link to Android and iOS - Requires ObjC bridge (collaborative effort with mopro) - (Bonus: Expo support? For easier development) Things to derisk early: - Making proving of new circuits work end to end with new circuits - React Native bindings ### Mopro MVP (v0.1) We divide the solution into three main parts: CLI, Robustness and Performance. #### CLI ![image](https://hackmd.io/_uploads/r1KUrf7hT.png) - Create a `mopro` CLI as the main way of interacting with mopro - As opposed to ad hoc scripts and instructions; should feel similar to something like Foundry - `init` to initialize a project without having to work inside the mopro monorepo - Should create a new project with example code to run circuit on platforms - Options possible: `--platform ios,android,pwa,desktop --language circom <MyProject>` (not all have to be implemented) - Very rough start [here](https://github.com/oskarth/mopro/tree/main/mopro-cli) with Clap - `prepare` to install dependencies - basically prepare.sh script - can shell out - `build` to build all necessary dependencies - Options: `--plaform itos,android,pwa` - `update` to update bindings - `test` to run tests - More options might be added; basically a minimal surface area that makes mopro users productive quickly #### Robustness ![image](https://hackmd.io/_uploads/ryKwSMQnT.png) - Make sure it works seamlessly on real device for both Android and iOS - iOS support requires fixing dylib integration - Android support is new and might require more work (?) - Easy to understand API - Clear single API to use - No random gotchas like hardcoded arkzkey etc - React Native module - Swift extension - Objective C header - New additional scope: cross-team effort to implement this #### Performance ![image](https://hackmd.io/_uploads/BkTFBz72T.png) - We want to have a reasonable prover time, ~30s, for big circuits on modern phones - Prover should work on recent phones up ~1.7m constraints - Debug this - Improve zkey load time (zero-copy serialization to make this very fast, and/or do in background) - Try Circom native witness generation library in Rust (currently this is in wasm and is 80% of prover time) - If we do this we don't need to dylib anymore - Possibly more performance work needed for smooth UX #### Public release ![image](https://hackmd.io/_uploads/Hk59rf7ha.png) With the above three done to a level satisfactory for the showcase app, we should be able to release a v0.1: - v0.1 as first public release - Works on recent Android and iPhone - Enable fast performance - Clean API example usage - Artifacts published for new users to use Things to clarify: - React Native support - Expo (optional) Things to derisk early: - Get end to end working early (Semaphore easy example) - Including with React Native - Try to fix performance bottlenecks early ## Rabbit holes - Chasing performance too much (timeboxed bets for low-hanging fruit OK) - Going for too much generality as opposed to one specific showcase app ## No-gos - Fundamentally changing proving stack

    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