--- tags: Smart Invoice --- # Escrow Write-Up ## Internal How-To ### What? A means for clients to deposit payment into an escrow account, with any disputes arbitrated by LexDAO. ### Why? - So raid parties can be sure that the client has the money to pay for the raid - So the client has some protection in case we don't deliver on our promise - Automates the process of paying spoils back to the Guild so individual raiders don't have to do it themselves ### How? ##### Happy path 1. Raid party lead (i.e., Cleric or Monk) creates an escrow account for the raid, with the following info: - Raid party multisig address - Total payment amount - Number of milestones (a typical raid will have 2). Currently, milestones must have uniform payments. Future versions may allow different payment amounts per milestone. - Safety valve withdrawal date. This is the date past which the client can withdraw any remaining funds in escrow, on the assumption that the raid has not delivered on its promise. Make sure to leave plenty of buffer after the expected end of the raid. 2. Raid party lead sends the client the raid ID (from airtable) or the url to the raid escrow 3. Client deposits total raid payment 4. Client releases first milestone payment 5. Raid commences 6. Once next milestone is reach, client releases next next payment 7. Repeat 6 until all milestones have been completed and all money has been released > Note: currently, the escrow contract requires that clients deposit the entire payment amount at once. For larger raids, this may be burdensome for clients. Future versions will allow clients to deposit enough to cover the next milestone and top up as milestones are finished. For now, this escrow service may be best applied to smaller raids or where clients already have all funds on hand. ##### In case of dispute - If the client loses confidence in the raid party at any time, they may `Lock` the remaining funds in escrow. - If the client has not released funds once a milestone has been completed, the raid party may `Lock` the remaining funds in escrow. In both cases, the `Lock` triggers the arbitration provider (i.e., LexDAO) to review the dispute. Based on their review, the arbitration provider will decide which party should receive what amount of funds, and will send a transaction to the escrow contract that will transfer the resulting amounts to each party. ## Client Explanation / Instructions Hello, and welcome to the Raid Guild family -- we're excited to be working with you! This is an overview of how payments to Raid Guild work. ### Escrow Raid Guild uses a non-custodial escrow service to handle payments and protect both the Guild and our clients. The benefit for the Guild is that we can be confident that funding for the raid exists. The benefit for our clients is that they can retain their funds if, for whatever reason, the Guild does not deliver on the raid as promised. Any disagreements are handled in arbitration by LexDAO, which is built into the escrow smart contract. #### Here's how it works: 1. You (the client) and the raid party agree on a project scope, budget/payment, expected timing, etc. They will ask you for the Ethereum address you will use for payment. 2. A member of the raid party will set up an escrow account with the information from (1) and send you a URL to that escrow account. 3. You visit that URL and, if everything looks correct, make your deposit. It's as easy as clicking `Deposit` and submitting the resulting transaction with your chosen wallet (e.g. Metamask). Only the address established in (1) may be used for payment, so make sure you can access that account from your browser. 4. When your first milestone payment is due (typically before work commences), return to that same URL and click `Release` to release that milestone's funds to Raid Guild. 5. Repeat (4) for each milestone. #### If there are any disputes: While we do everything we can do avoid issues or disputes (it's in our interest to deliver excellent work for you!), we want to be prepared just in case something does happen. To that end, the escrow contract enables both the Guild and our clients to `Lock` funds at any time. *Locked* funds cannot be released or withdrawn, and can only be removed from the escrow contract by the arbitration provider, so it only makes sense to do so if there is an actual issue. *Locking* funds will initiate an arbitration process run by LexDAO. LexDAO will review any relevant details from both parties and make a decision on a fair distribution based on the facts. They will then trigger the escrow contract to transfer funds to both parties according to that resulting distribution. For their services, LexDAO takes a fee of 5% of the funds in dispute. #### Client privacy As we start handling more of Raid Guild's client-facing operations on chain, we've worked hard to ensure that our client's information stays private. For example, no information about the client or the nature of the raid will ever be added to the escrow contract. Instead, we use randomly generated IDs to represent a raid (this is the ID in the URL we send you for the escrow app). We use an internal private database to populate the escrow app with relevant details (client name, raid name a description, etc.) based on the randomly generated ID. In the future, we will likely be moving to a distributed, encrypted data store based on 3box/Ceramic technology to keep data even more private. The only people who can see those details are those who have the randomly generated ID. All Raid Guild's clients (and in fact, anybody with an internet connection) can access the escrow app, but only people with the correct ID will be able to see the details for that raid. #### Other details - The Safety Valve Withdrawal Date is the date past which you (the client) can withdraw any remaining *unlocked* funds. We don't ever expect this to be needed, but its there as an additional protection. If that date does pass without all payment being released, then you will see a `Withdraw` button in the escrow app. ## External Announcement ### State of the Raid One of the biggest challenges in freelancing is payment. Short term contracts don't have the benefit of ongoing relationships to develop mutual trust between client and service provider, which creates a tension between clients needing to ensure that they get what they're paying for and freelancings needing to ensure that they will get paid for that work. One way to balance these needs is to structure payment half up front and half upon completion, and this is how most of our raids were paid. But with web3 and smart contracts, we can do better. So we built an escrow service that ensures that clients only pay if the Guild's raiders deliver and that raiders get paid for their work. In case of a dispute, the legal engineers at LexDAO handle the arbitration, distributing the disputed funds to the appropriate party based on the facts.