How it works

The purpose of Daimo Pay is to offer the best, highest-converting way to pay or deposit crypto. This page explains how our smart contracts accomplish this.

Seamless cross-chain, any-token payments have been a long-standing technical challenge. Existing automated bridging and swapping solutions are plagued with issues, such as lost funds, clunky UX, and bad tech.

We've built what we believe is the gold standard for cross-chain payments: fast, UX-friendly, secure, and trust-minimized.

Motivation

Here are the design goals for our contract system:

  • Any coin, any chain. If Alice has enough crypto anywhere, she should be able to pay or use your dapp in one click. Swapping and bridging is entirely abstracted.
  • One click. Only one wallet pop-up to transfer funds. This feels smoother than the typical approve-then-send double popup, and works with CEX transfers directly. One click, no spinners.
  • Max speed. Payments should feel immediate. As soon as Alice’s payment lands, a liquidity provider completes the transaction on the destination chain, typically two seconds or less.
  • Trustless. The simplest way to achieve 1-3 would be for Alice to simply send funds to the LP, trusting them. We designed our system without a need for trusted custodians.
  • COMING SOON Gasless. Daimo Pay is already gasless in the sense that a user does not need to swap, bridge, or acquire destination chain gas. In future, we’ll support paying even if you don’t hold gas funds on the source chain, with a single permit signature.
  • COMING SOON Recurring. Subscriptions, initiated in a single wallet action.

Intent Addresses

This is a lot to a do in a single wallet click! We achieve this using intent addresses.

An intent address is a smart contract that serves as a receiving address: it accomplishes a specific goal just by sending assets to it. Using Ethereum’s CREATE2, we can make one address that works on all EVM chains. Daimo Pay encodes all the parameters of the action, including amount, destination chain, and contract calls, into the intent address.

Intent address

This accomplishes our goals above. Alice performs a single transfer and the LP triggers the action immediately. The intent address guarantees Alice's intended action triggers, and the LP takes minimal settlement risk to instantly yet trustlessly complete the action in exchange for a fee specified in the intent.

Bridging

Daimo Pay uses USDC via CCTP as the underlying bridge for cross-chain payments. CCTP is free, simple, and requires no additional counterparty risk since it is operated directly by Circle, the issuer of USDC.

Neither Daimo nor LPs ever control user funds. The contract only allows the exact flow illustrated above: from the moment Alice sends funds to the intent address, those funds are guaranteed to end up with Bob. The LP takes some reorg and bridge settlement risk by finishing the transfer immediately in exchange for a fee specified in the intent, but if no LP shows up, Alice or Bob can complete the intent permissionlessly themselves. In short, LPs only provide speed and convenience, not trust.

Swapping

Similarly, the intent commits to the exact amount to bridge, and the exact amount of the destination transfer. This protects the payer, vendor, and the LP. By swapping to a nonvolatile token such as USDC (on the source chain) and completing immediately (on the destination chain), the LP avoids price risk during the time it takes to bridge.

This lets Daimo Pay offers a convenient interface for apps and vendors. You generate a checkout link for X token on Y chain. Your users can pay with any token on any chain.

Was this page helpful?