Kyle Charbonnet
    • 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
    • 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 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
    # FLAX Front-End Design This doc focuses on the design of the front end for FLAX. It focuses on any component that users will have to interact with directly. The back-end/contract logic can be found here - https://hackmd.io/m7Hx1375Rwad6_9xRAoLEg?view So far, we plan to create 3 major components for the front-end: 1. Chrome/Brave Extension with Ethereum Provider API - https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md 3. Mobile app (similar to the extension) 4. DApp specific web pages - Ex. a FLAX-Uniswap page where users can quickly anonymously swap tokens via Uniswap These peices will allow users to sign and send FLAX transactions from their computer or phone. It also allows DApp developers to build their DApp such that FLAX wallet holders can still interact. ## Extension + Ethereum Provider API ### Goals The extension and Ethereum provider API aim to achieve the following goals: * Allow users to view in browser all of their owned assets stored in the FLAX Vault * Secure storage of FLAX addresses and keys * Allow DApp developers to easily integrate their front-end with the FLAX extension via the Ethereum Provider API * Sign tx data * Custom functions that allow easy creation of spend and refund objects? (easy creation of any objects needed for FLAX transactions, basically an SDK?) * Will also include zk proof generation ### Note Scanning For detailed explanations of the cryptography, see the back-end design doc: https://hackmd.io/m7Hx1375Rwad6_9xRAoLEg?edit A FLAX address consists of three uint256 values: ```javavascript= struct FLAXAddress { uint256 H1; // Compressed Babyjub point h1 uint256 H2; // Compressed Babyjub point h2 uint256 H3; // Compressed Babyjub point h3 } ``` * `pk` - FLAXAddress as shown above * `vk` - Viewing / nullifier key * `sk` - Spending / validating key $$ (vk \cdot H_1 = H_2) \mbox{ and } (sk \cdot H_1 = H_3)$$ The public key (pk) will be visible on-chain to the public. However, every time a user adds funds to the Vault (via makeDeposit or through a refund), they will use a randomized public key. A randomized public key can be chosen by randomly choosing a randomizer `r` and computing $(r \cdot H_1, r \cdot H_2, r \cdot H_3)$. Every time a new note is added to the Vault, an event will be emitted that contains the FLAX address of that note. This will allow the extension (which holds the viewing key `vk`) to scan all events for which notes belong to the user signed in. The extension will need to: * Securely store `vk` and `sk` * Randomly generate a new rerandomized address for every FLAX deposit/refund * Follow events from the FLAX contracts to see which new notes are for the user that is signed in * If a new note has public key: K1, K2, and K3, the wallet will need to check: $$(vk \cdot K_1 == K_2)$$ * If so, then this new note detected does belong to the user signed in. ### Secure Storage ... ### Ethereum / FLAX Provider API #### Concrete next steps 1. Go through Web3.js and Ethers.js APIs and categorize by what we can or cannot keep / directly emulate. 2. For those that we cannot stay compatible with, design new APIs that offer dapps the same functionality. Tentative list: any address-based read and write access to chain require new APIs. 3. Add new APIs to submit transactions to a Flax sequencer. ## Mobile App The mobile app's main purpose is to allow users to interact with FLAX via their phone. This opens anonymous DeFi to mobile users. The mobile app functionality can be based off of the chrome extension. ## DApp Specific Web Pages Since there are some limitations to using FLAX for all of a user's DeFi transactions (ex. handling return data), it might make sense to have FLAX supported web pages for the most popular DeFi applications. These web pages will be custom designed to make user interaction with these services as simple as possible, and as close to the service's own web page (in terms of functionality) as well. Popular services that could benefit from their own custom web page: * Uniswap - would allow for easier handling of liquidity position NFTs * ... ## Appendix ### Other Wallet Extensions Here are other projects working on building EVM wallet extensions. These may be helpful to reference when building ours out. * BLS-Wallet - https://github.com/web3well/bls-wallet/tree/main/extension * Somewhat similar to what we are trying to do since this wallet secures BLS keys (corresponds to FLAX keys) and they rollup transactions by sending them to an aggregator * Block Wallet - https://github.com/block-wallet/block-extension-dev-docs/tree/main/provider * MetaMask - https://github.com/MetaMask * Rainbow Wallet (React native app) - https://github.com/rainbow-me/rainbow

    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