> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://viem-2dgktz01f-wevm.vercel.app/api/mcp` to find what you need.

# Sponsor Multisig Fees

## Overview

Choose how the transaction gets its fee-payer signature:

* **[Relay](#relay):** Use a relay when a separate service controls the fee-payer key or applies
  sponsorship policy for many clients. Set `feePayer: true`; the relay signs and broadcasts the
  transaction after the multisig reaches quorum.
* **[Local account](#local-account):** Use a local account when the current trusted process
  controls the fee-payer key. Pass that account as `feePayer`, and Viem adds its signature to the
  transaction that every multisig owner approves.

## Recipes

### Relay

Use [`withRelay`](/tempo/transports/withRelay) to send approvals to a relay that coordinates the
multisig and sponsors its fees. The owners approve a request with `feePayer: true`. After quorum,
the relay signs and broadcasts the final transaction.

:::code-group
```ts twoslash [example.ts]
import { Account } from 'viem/tempo'
import { client } from './relay.config'

// 1. Create the independent owners and multisig.
const owner_1 = Account.fromSecp256k1(
  '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
)
const owner_2 = Account.fromSecp256k1(
  '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'
)
const multisig = Account.fromMultisig({
  address: 'infer',
  owners: [owner_1.address, owner_2.address],
  threshold: 2,
})

// 2. Store the first owner approval with a relay fee payer.
const pending = await client.sendTransactionSync({
  account: multisig,
  calls: [{ data: '0xdeadbeef', to: '0xcafebabecafebabecafebabecafebabecafebabe' }],
  feePayer: true,
  owner: owner_1,
})

// 3. Reach quorum and let the relay sponsor the final transaction.
const receipt = await client.sendTransactionSync({
  account: multisig,
  hash: pending.transactionHash,
  owner: owner_2,
})
```

```ts twoslash [relay.config.ts] filename="relay.config.ts"
import { createClient, http, withRelay } from 'viem/tempo'

// 1. Use the relay for coordination and fee sponsorship.
export const client = createClient({
  transport: withRelay(http(), http('https://relay.example.com')),
})
```
:::

The relay owns the shared multisig store. The client does not need `experimental_multisig` when
`withRelay` points to a relay that handles multisig coordination.

### Local Account

Pass a local fee-payer account when the application or service already controls the fee-payer key
and does not need a separate sponsorship service. Viem adds its signature before storing the
operation, and later owners approve that same operation by hash.

:::code-group
```ts twoslash [example.ts]
import { Account } from 'viem/tempo'
import { client } from './viem.config'

// 1. Create the owners, fee payer, and multisig.
const owner_1 = Account.fromSecp256k1(
  '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
)
const owner_2 = Account.fromSecp256k1(
  '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'
)
const feePayer = Account.fromSecp256k1(
  '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a'
)
const multisig = Account.fromMultisig({
  address: 'infer',
  owners: [owner_1.address, owner_2.address],
  threshold: 2,
})

// 2. Store the first approval with the local fee payer.
const pending = await client.sendTransactionSync({
  account: multisig,
  calls: [{ data: '0xdeadbeef', to: '0xcafebabecafebabecafebabecafebabecafebabe' }],
  feePayer,
  owner: owner_1,
})

// 3. Approve the fee-paid operation with the second owner.
const receipt = await client.sendTransactionSync({
  account: multisig,
  hash: pending.transactionHash,
  owner: owner_2,
})
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/tempo/multisig.config.ts:setup]
```
:::

## Best Practices

### Keep the Operation Immutable

Owner and fee-payer signatures cover the prepared transaction fields. Do not change gas, fees,
nonce, validity window, calls, or fee payer after either party signs. Later owners should pass the
same multisig account, the operation hash, and their owner signer.

## See More

<Cards>
  <Card icon="lucide:hand-coins" title="Sponsor User Fees" description="Integrate a remote fee-payer service." to="/tempo/guides/sponsor-fees" />

  <Card icon="lucide:send" title="Send Transactions" description="Coordinate independent multisig approvals." to="/tempo/guides/multisig/send" />

  <Card icon="lucide:receipt" title="Tempo Transactions" description="Learn how Tempo transaction fees and fee payers work." to="/tempo/transactions" />
</Cards>
