Raid Guild
Published in

Raid Guild

Introducing Smart Invoice

A new way to get paid for services, built by Raid Guild

Here at Raid Guild, clients pay us to slay their web3 product demons. This sounds like a simple transaction — do work, get paid — but it is complicated by the fact that our projects (“raids” in our vernacular) take time to complete and our services are far from standardized commodities. These conditions create what we call the invoice dilemma: how do we ensure that we are paid for the work we do while simultaneously ensuring that our clients receive the value they’re paying for?

Raid Guild could ensure we get paid by charging our clients before we start, but then the client would be taking a risk by paying before seeing any work. Or clients could ensure they get what they expect by paying us only after the raid is over, but then Raid Guild would be working on spec.

Invoice problem #1: how does the service provider ensure that they are paid for the work they do?

Invoice problem #2: how does the client ensure that they are receiving the expected value they are paying for?

We started tackling these problems for ourselves by doing what we do best: building. We quickly realized that others could benefit from the same tools, so we set out to make it work for freelancers and DAOs everywhere. We received grants from Aragon (more on this later) and STAKEhaus to build out our solution for DAOs and to deploy it on the xDAI network.

After much work toiling in the mines of web3, Smart Invoice was born!

Traditional Invoices

Before we get into the fun part about what Smart Invoice is and does, we need to spend some time talking about traditional invoices. If you’re already familiar with what’s wrong with traditional invoices, feel free to skip to the next section; but we encourage you to read the whole thing.

Traditional invoices work like this: a service provider completes some agreed-upon work, and then bills the client by sending them an invoice. The invoice includes the amount to be paid for each element of work delivered (and sometimes expenses), instructions for how it should be paid (e.g. a mailing address, bank account routing number, etc.), and a deadline.

The period after the invoice is sent and the deadline — called “net D”, where D is the number of days — is part of the initial agreement between the client and service provider, and typically follows industry standard periods. These periods are long — invoices often come with net 10, net 30, or sometimes even net 90 payment terms!

In the traditional world, there are some legitimate reasons for such long payment terms. First, clients need time to evaluate the quality of the work that’s been delivered before agreeing to pay (invoice problem #2), and, second, many clients have long, bureaucratic approval processes. Third, in the traditional world payments can take multiple days to clear.

But these long periods end up creating a number of problems. Most obviously, service providers often have to wait a very long time to get paid, which also means that they have to trust that the client has the money to pay them (invoice problem #1). Conversely, if a client agrees to make an upfront payment (even if partial), the long processing time can greatly delay the start of the project.

These delays also have knock-on effects that impact the broader economy. Since many service providers are also clients in other capacities, if they have to wait 60 days to receive payment, they may not have enough money to pay their own service providers until even later. These delays and liquidity crunches cascade, gumming up the economic works and creating the need for epicycle-like solutions such as cash flow financing, which is highly susceptible to fraud.

There’s another problem with traditional invoices. In web3, a sizable and growing portion of economic activity is commissioned and performed by DAOs and other on-chain organizations. How are these organizations — whose administrative operations run primarily on smart contracts — supposed to send (or pay!) a traditional invoice?

Smart Invoice

Smart Invoice flips traditional invoices on their head with a combination of escrow, milestone payments, and arbitration — all facilitated by smart contracts. With escrow, instead of billing the client after the work is done, a service provider sends a Smart Invoice before they start work. Instead of waiting 30+ days to be 100% sure that they’ll get paid, service providers can see that clients have deposited funds into Smart Invoice’s escrow before getting started.

With milestone payments, service providers and clients have maximum flexibility to structure their project in a way that works for both of them. For example, ambitious projects can be de-risked with escalating milestones, lowering the barrier for both clients and service providers to enter into high-upside engagements. Or multi-phased milestones can be paid in conjunction with each phase. As long as both sides are happy with the arrangement — i.e. the client has deposited enough money to cover the next milestone — work and payment can continue.

With arbitration, both clients and service providers can be confident that they will get a fair outcome. If there is a dispute, funds currently in escrow are locked and the selected arbitration provider, based on the evidence provided by both parties, distributes the funds back to the parties according to their judgement.

In the traditional business world, payments are slow and escrow and arbitration services are exceedingly expensive. But with Smart Invoice — built on smart contracts — payments are nearly instant, arbitration is much cheaper, and escrow is even cheaper still. All together, Smart Invoice represents a step change in how clients pay service providers, creating better conditions for clients, service providers, and the broader economy.

An example Smart Invoice with 4 milestones, in progress (client view)

Benefits for Service Providers

Such as freelancers, contract workers, DAOs, etc.

  • Guarantee that quality work will be paid for
  • Break up projects into multiple milestones and get paid after each one
  • Get paid fast (no waiting for mail or wire transfers)
  • Less admin to deal with (the app keeps track of everything)

Benefits for Clients

  • Guarantee that payment will only be sent if the service provider delivers
  • Deposit funds to cover the next milestone payment only (don’t have to lock up the entire budget at once)
  • Tip the service provider, if desired

Check it out!

Smart Invoice is ready for you try right now! You can find it at, and it works both on xDAI (real money!) and Rinkeby (test money).

For a detailed overview of how to use Smart Invoice, take a look at our documentation and instructions.

We’d love for you to test it out and and let us know what you think over in the Raid Guild discord’s product testing/feedback channel (aka the #🍷-wine-cellar). Or if you have questions, you can ask them in our product support channel ⚔️.

Finally, you can find all of our code and tests in our monorepo on Github.

While we have rigorously tested and reviewed our code, the Smart Invoice contracts have not been formally audited. Please treat this as beta software.

Where do we go from here?

We’re excited to have people and DAOs start using Smart Invoice. We’ll keep a close eye on how they’re using it; almost certainly we’ll learn something new that we didn’t anticipate.

That said, we do have a few ideas for potential improvements:

  • Better in-app tools to support the arbitration process
  • Explore private data sharing/storage between client and provider (and resolver as needed)
  • More arbitration providers (Kleros Court, Aragon Protocol, 1Hive’s Celeste, etc)
  • Streaming payments (Superfluid)
  • Escrowed funds earning yield in DeFi
  • Support for multiple networks (rollups, etc.)
  • Some ability to change total invoice and/or milestone amounts
  • Tokenized invoices

Can you think of anything else?

Appendix: That Aragon Thing

Astute readers will notice that even though we received a grant from Aragon, Smart Invoice does not integrate any Aragon components. This was not for lack of trying! Our original goal, as outlined in our grant proposal to Aragon’s Conviction Funding round, was to integrate Aragon Court as a second arbitration provider alongside LexDAO.

Unfortunately, after we finished an initial implementation and were starting to test, Aragon’s support for their Court product waned and we weren’t able complete the testing necessary to finish our work. Soon after, when Aragon announced Court’s (still-ongoing) transition into Aragon Protocol, we understood why. We look forward to integrating Aragon Protocol into Smart Invoice once it is live.

Special thanks to Bau, Taekikz, Lucas, Plor, and other Raid Guild members for their contributions to this post. And massive props to dan13ram, Jaqi, and saimano for their phenomenal buidling.




A Decentralized Collective of Mercenaries Ready to Slay Your Web3 Product Demons

Recommended from Medium

CSV Importer Pro + JetEngine: Import Export Data


Dagger 2 for in Kotlin

CS50: Near The End And A Final Project

25 Github Repositories Every Software Engineer Should Follow:

The Cheat Sheet I Wish I had before Building our Zapier Integration

Virtual personal assistant in the digital workplace. Result.

How Flux cut merchant integrations from weeks to minutes

Hacktober 2020 is coming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Spencer Graham

Spencer Graham

More from Medium

Iris: A next-gen Decentralized Storage Layer (Part 3)

Upgradeable Contracts with OpenZeppelin + Hardhat + VeChain

Basic NFT Contract configured with OpenZeppelin

Build your first DeFi Application — My experience

Glow of the Canopy #1 🌱: Nourishing the Filecoin Virtual Machine with help from Forest 🌲