Raid Guild
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    --- tags: Smart Invoice --- # Smart Invoice w/ Escrow ADR -- Design Document As the first deliverable for this Aragon Conviction Funding [grant](https://conviction.aragon.org/#/proposal/9) [proposal](https://forum.aragon.org/t/dao-payment-escrow-with-aragon-court-arbitration/2269), this document specifies the design for the Smart Invoice w/ Escrow ADR, including integrating Aragon Court. ## Background Raid Guild is a DAO-based web3 freelancer cooperative. Clients hire us to design and build web3 products for them. We recently built a disputable escrow tool that minimizes risk for all parties involved. Clients deposit funds into the escrow contract, then funds are released to us as project milestones are reached. If there’s a dispute over milestone deliverables a dispute can be raised for an alternative dispute resolution (ADR) provider to distribute funds appropriately. Under this proposal, we are adding Aragon Court as an ADR option and generalizing/productizing the tool so that any DAO (or individual) can use it to accept payment from their clients. The benefit to the DAO (service provider) is knowing with certainty that the client can pay before starting any work. The benefit to the client is increased control over the release of funds to the DAO based on receipt of deliverables as specified in the project agreement. The embedded dispute resolution service -- for which Aragon Court will be an option -- ensures that funds will be fairly dispersed even in the event of a dispute. ### Key Questions Phase 1 of our work covered research and design. This document summarizes the result of our research, focusing primarily on how we are addressing the following key questions: 1. How can Aragon Court be added as an arbitration provider / dispute resolver to the existing LexGuildLocker contract? 2. How can the escrow service (contract, front-end, and private back-end) be productized for use by any DAO? 3. How can variable sized milestones be supported? 4. Can / should we enable Aragon Conviction Voting to send to an escrow? ## Design ### Aragon Court Integration > How can Aragon Court be added as an arbitration provider / dispute resolver to the existing LexGuildLocker contract? This shall involve the following changes to the contract: - Add extra parameter in `Locker` struct to identity type of ADR, namely LexDAO or Aragon Court. - Extend `LexGuildLocker` contract to implement necessary methods of Aragon's `IArbitrable` interface. - Enumerate `ruling` possibilities ranging from [0, 100] to [100, 0] distribution of remaining funds. - Update `lock` method - pay the court fees by calling `getDisputeFees()`. - to call `createDispute` method of Aragon Court with number of `ruling` as created in previous step. **Note:** In the case of Aragon Court, the UX will change slightly as there may be extra steps to ensure that the Locker has necessary funds to raise the Dispute with Aragon. <!-- [TODO] - IArbitrable and IArbitrator - enumerate `ruling` possibilities - outstanding question: Aragon Court fee --> ### Productization / General DAO availability > How can the escrow service (contract, front-end, and private back-end) be productized for use by any DAO? The existing Raid Guild escrow app uses a private database (Airtable) to keep project & transaction metadata privately viewable only by Raid Guild and its clients. To maintain this capability in the current design would require replacing the web2 database with a web3-native storage and access control solution. Unfortunately, none of the existing options we researched -- Textile Buckets and Threads; avionDB -- currently meet our specifications for access control. It is likely possible to extend those implementations for our purposes, but that effort falls outside the present scope. Perhaps as technologies mature, we can implement the privacy features in a future version. From a UX perspective, any person can create a Smart Invoice w/ Escrow by providing project and payment data in the UI. The invoice creator must provide a name and link to project agreement (e.g., a text document) to assist with arbitration. Since all data is stored on-chain, users with privacy concerns may opt to obscure project identity by using a codename and link to a document that requires permission to view. ![](https://i.imgur.com/86PziIe.png) #### Single Dapp For the present scope, we will remove the private metadata component. That change allows us to create a single dapp that can be used by any DAO or individual parties. All the code will be open source, so the dapp can be re-implemented or customized to meet specialized needs. #### Front End Application: "Smart Invoice" We envision this single application serving as a tool for DAOs and their counterparties to pay each other for services securely. Traditionally, services rendered are paid for once the service provider invoices the client. With this escrow application, service providers can now send invoices *upfront*, with appropriate payment and dispute resolution supported by ADR. We call these "Smart Invoices". ![](https://i.imgur.com/DV3c0qg.png) With this system, the client is able to control when each payment is released. ![](https://i.imgur.com/0o3fdl0.png) #### DAO usage Managing an escrow requires the ability to make several interactions with the escrow. The service provider needs to be able to Lock funds to trigger a dispute with the client, and the client needs to be able to a) Release funds as milestones are met, and b) Lock funds to trigger a dispute with the service provider. Each of these interactions involves a sending a transaction, which can be difficult for DAOs and multisigs to make via a typical web front end. To allow DAOs to use this app, our front end will generate and display the transaction hex for all relevant transactions. DAO representatives can then use that hex code to create a transaction from their DAO or multisig interface (e.g., Aragon Agent, Moloch Minion, Gnosis Safe). ### Notes and additional details > Can / should we enable Aragon Conviction Funding to send to an escrow? Our recommendation for enabling this capability is that the Aragon Conviction Funding (ACF) module should be extended to enable arbitrary contract calls. There are two main reasons for this: 1. Depositing is not the only instance where ACF would want to be able to interact with the escrow. It would also need to Release funds as the grantee meets the established milestones as well as Lock funds (i.e. send to arbitration) if a dispute with the grantee arises. Those interactions would require contract calls, too. 2. The requisite changes to the existing LexGuildLocker contract would be substantial and fall outside the present scope. > How can variable sized milestones be supported? We will update the `milestones` escrow parameter to take a schedule of arbitrarily-sized payments (i.e. `milestones = uint256[]`) instead of denoting the number of uniform payments.

    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