July 14, 2023

Intents and where to find them

tldr

  • Intents are partial transactions. They’re useful when you lack the information to construct a complete transaction, and you want help filling in the gaps.
  • You can use intents to: find counterparties, set up triggers to on-chain events, access hidden information, or construct multi-party commitment trades.
  • Intents make the complex stuff easier and open entirely new efficiencies through trustlessly coordinating multiple parties in single txs.

To learn about some interesting uses for intents, read on.

Introduction

There’s lots of noise about intents. But what precisely are they? And what exactly can they do that “normal” transactions can’t?

This article answers these questions. We’ll explain intents in simple terms, and go over how you already use intents today, and many ways how you might use them in the future.

First, let's see how intents differ from "normal" everyday transactions.

Intents are partial transactions

A good way to understand intents is as partial transactions. You commit to something – your intent – but that alone isn’t enough for a full transaction.

Something is missing to complete a valid transaction. And you let someone else add the missing part.

Intents only become valid transactions when someone else adds the missing part.

So intents are partial transactions that need someone else’s help. For what types of transactions is this useful?

Where you can use intents

As partial txs, intents are particularly useful when you simply can’t create a full transaction.

Maybe you don’t want to invest the time, or you don’t know how to find the missing information, or the missing information simply isn’t available to you.

Here are 3 types of situations in which this tends to happen:

Counterparty Selection

It’s hard to find and choose the best counterparty. But, it’s much easier to just define what you want and let someone else evaluate and choose the counterparty for you.

By outsourcing, you can also get access to deals and counterparties you wouldn’t otherwise have had – for example through CowSwap you pay less fees on Balancer.

A transaction from our Solver that combined 4 orders into a single route. Without intents, the 4 traders in this swap would have gotten a worse price.

Automation

Whenever you need to monitor events precisely, react quickly or complete many trades, doing it yourself is a pain. Intents help you specify your goal and conditions once, then let a third party handle execution. 

Intents let you define conditions, that can trigger one or many transactions precisely when you want them to.

Multiparty commitments

One or several other parties need to commit to validate your transaction. Intents are a great way to coordinate multi-party commitments.

Intents are not as new as they might seem – some dApps have used intents for a while.

Where you use intents already

Intents are already around in special-purpose applications. Some examples:

  • GitCoin Matching Funds: Users pre-commit to donate to the winning projects, without knowing which they will be.
  • Limit Orders & Batch Auctions: Limit orders – e.g., on CowSwap or 1inch – are partial transactions. Solvers compete to find the best arrangement of counterparties (e.g. splitting through multiple DEX pools) to fill at the best price.
  • SmartOrders: With CowSwap Smart Orders - you can already add arbitrary execution conditions to your swaps today.
  • Multisig: Multisig transactions begin as intent commitments by multisig members, until they reach a quorum and can settle the tx.
  • OTC trades: OTC trades are essentially a multisig swap – signed by the opposing parties, and settled after both submit their intent.

But the promise of intents is far greater.

Intents in the future

Here are some interesting ways you might be able to use intents soon:

Organizing a trip

The transaction only executes when all parties commit and all conditions are simultaneously fulfilled.

You book a trip with friends, but only want to pay the Airbnb, flights and car if they’re all within budget, and you all agree on the same option. To make that work you need commitments from the Airbnb host, the airline, the car rental firm, and your friends. Once all commitments are in, and they are within the budget, they can all settle at once in a single tx.

This can get arbitrarily more complex: For example, you could open a bidding war between the airlines to give you a group discount, or offer to pay more if the host let’s you cancel for free until 4 weeks before the trip.

This example is lifted directly from the even nicer example in the Anoma Whitepaper; look for “Multiparty, multivariate private bartering”.

Private OTC sale

I’ll sell my bag to anyone willing to buy it all and pay above current market price. Someone else might be willing to offer above market, because liquidity is thin on the open market. But both our intents are private – and they are filled automatically when there’s a match.

Global private bartering

Taking the above to the extreme: I express all my intents, so does everyone else, and we find win-win coincidence of wants (CoWs), even involving n-party CoWs. You have the boat I want to rent this weekend, I have the apartment your friend wants next month, and your friend has the ticket you want for the festival next year. Our respective resources would go unused, but now we can all get what we want.

Escrow

The payment is released automatically after a certain condition is satisfied – say, a delivery company confirms signed delivery for a package. This gives suppliers and buyers more confidence at no extra cost.

Dynamic Payment

You could add more logic to the escrow above, e.g. by committing to pay 1% more for every day the shipment arrives early.

Specify an arbitrary payoff function that maps to what you value.


Attestation-based rebates

I’ll trade with you differently if you have certain attestations. For example, if you can prove you’re a retail trader, you can pay lower fees on my DEX. Or if you’re a friend, you can rent my apartment for a lower price.

Portfolio optimization

Let’s say I want to optimize yield on my stablecoins, and only accept "conservative" options. Solvers can compete to find the allocation with the highest yield between fitting pools. The pools could be vetted with a risk attestation by a source I trust for risk-assessment (e.g., TrailOfBits).

Whenever a solver can prove that moving to another allocation will improve yields (at acceptable gas) they can switch my position.

Cross-Chain Bridging

Bridging is a UX nightmare at the moment. It takes far to much research and time to select an option, and risks are hard to understand. Intents let you define what you want and what risks you are willing to accept or not – and someone else will take care of the bridging for you.

More ideas for intents

These are just some examples, but numerous other use cases are already evident.

  • Peer2Peer: Declare intents that others can fill directly, cutting out the middleman and improving prices for you and your trading partners. For trades, lending, insurance, hedging etc.
  • Safe Exit: Sell a token when certain conditions are reached. For example, when a stablecoin is 0.5% below peg, or a protocol’s treasury has some suspicious activity.
  • Deadman switch: Allow your friend to claim your assets if there’s no trade on your wallet in six months.
  • Conditional trading: You declare specific market conditions for a trade (e.g., "I intend to sell X asset if its price reaches Y") and the trade executes automatically when the conditions are met.
  • Automated trading: For example dollar-cost average into a token or rebalance a portfolio automatically.
  • Security Screening: Only allow interactions with smart contracts that have certain proofs (e.g., proof that a particular contract is signed off by two whitelisted audit teams).
  • Low fee execution: I only want to execute the transaction when the gas fees are less than 0.1% of the transaction value.
  • Insurance: Insurance pre-commits to pay defined amounts under defined conditions that can be verified by third parties.
  • Captcha rebate: You can get a trade rebate if you prove you’re a human and not a bot.
  • Crowdfunding: I’ll only contribute to the project if it reaches the funding goal.
  • Private token sales: Commit to a purchase before the token is issued.
  • Zero-fee trades: I’m willing to make the trade if someone covers my gas. Or if they pay the gas and I pay the in-token.
  • Overlapping options: Commit to options you support, and the trade settles on the option upon which everyone’s preferences overlap (e.g., meeting, holiday choice).

Conclusion

Intents simplify complex transactions by outsourcing the hard part to third parties. 

This makes defi safer and more accessible, and it will make new types of transactions possible.

Intents have already brought us valuable innovations (e.g., CowSwap). But most applications are still to come and intent-centric chains like Anoma will really open the design space for intents. 

Thanks

Thanks @cwgoes for your review and helpful input, and the whole Anoma team @awasunyin and @Adrian_Brink for pushing intents forward and making it easy to grasp in their Whitepaper (must-read).

And to the CowSwap team for the rapid innovation and already supporting many important uses of intents today (e.g. check out how to add arbitrary conditions to your trades with Smart Orders).

Keep Reading

MEV is disappearing

The tools to eliminate most MEV at the wallet and dapp level already exist; we just need to use them.
Read More

Returning MEV to users and dapps

Solving MEV on the level of dapps and wallets is more valuable to users.
Read More