Skip to main content
Rhinestone lets you cover the fees for your users with a single onchain deposit. You can deposit USDC on Base, and subsidise gas, bridge fees, and swap fees across all chains.

Fee Types

You can sponsor user fees in three ways:
  1. Cover the transaction gas
  2. Cover the bridging fee
  3. Cover the swap fee (when using swaps)
Sponsorship can be applied to all transactions or handled on a case-by-case basis. You can sponsor both cross-chain and same-chain transactions.

How it Works

When your users make transactions, you can select which (if any) fees you are willing to sponsor. Rather than charging the user these costs, the Orchestrator instead applies them against your sponsorship balance. You can sponsor up to their deposited amount, after which point, fees will be applied to your users’ intents, ensuring continuity should you run out of funds. The sponsored amount is calculated in USD at the time of the intent, based on the cumulative fees that would otherwise be charged to the user.

Setup

You can test fee sponsorship on testnets out of the box. Reach out to us if you need to set this up for production use. We will provide you with a wallet address to deposit to. Once you deposit, your sponsorship balance will automatically increase. Currently, we accept USDC deposits on Base. Reach out to us if you want to use fiat deposits.

Usage

To sponsor a transaction:
const transactionData = await rhinestoneAccount.prepareTransaction({
  sourceChains: [sourceChain],
  targetChain,
  calls: [
    {
      to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
      value: 0n,
      data: '0xdeadbeef',
    },
  ],
  sponsored: true,
})
You can also choose which fee types to sponsor individually:
const transactionData = await rhinestoneAccount.prepareTransaction({
  sourceChains: [sourceChain],
  targetChain,
  calls: [
    {
      to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
      value: 0n,
      data: '0xdeadbeef',
    },
  ],
  sponsored: {
    gas: true,
    bridging: true,
    swaps: false,
  },
})

Sponsorship Policies

Currently, the SDK doesn’t provide any policies out of the box. You can implement bespoke, flexible policies on your backend. Here’s one example, where we only sponsor transactions that interact with a specific contract:
// Sponsors a transaction only if it interacts with our app
function isSponsored(
  sourceChains: Chain[],
  targetChain: Chain,
  calls: {
    to: string
    value: bigint
    data: string
  }[],
): boolean {
  const appContractAddress = '0xbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef'
  return calls.some((call) => call.to === appContractAddress)
}
You can then use that function when handling the user’s transaction request:
const calls = [
  {
    to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045' as Address,
    value: 0n,
    data: '0xdeadbeef' as Hex,
  },
]
const transactionData = await rhinestoneAccount.prepareTransaction({
  sourceChains: [sourceChain],
  targetChain,
  calls,
  sponsored: isSponsored([sourceChain], targetChain, calls),
})