Sponsors & Fee Payers
Two-party escrows can be sponsored: a third party pays the transaction fees and account rent so the depositor doesn't have to hold SOL. This concept page explains how the sponsor and the fee payer relate.
The fee payer
Every escrow instruction has an explicit fee_payer account that pays the transaction fee and any rent. In the program client this is the payer: argument — it is set as the transaction fee payer, wired into the instruction as fee_payer, and always signs (see Conventions).
For an unsponsored deposit, the depositor is simply the payer:
program.deposit(
payer: depositor, # depositor pays
mint: mint_address,
depositor: depositor,
claim_authority: claim_authority.address,
amount: 1_000_000
)Sponsored deposits
A sponsor is an account recorded on the EscrowDeposit that subsidizes the escrow. The deposit itself just records the sponsor — it doesn't check the fee payer. The rule that the fee payer must be the sponsor is enforced later, at claim time: the escrow closes to the fee payer, so when a sponsor is recorded the claim's fee payer must be that sponsor (otherwise InvalidCloseAuthority). In practice the sponsor pays throughout: pass it as the payer (it signs and pays) and as sponsor: (it's recorded on the deposit):
program.deposit(
payer: sponsor, # the sponsor pays + signs
mint: mint_address,
depositor: depositor, # still signs (authorizes the lock)
claim_authority: claim_authority.address,
amount: 1_000_000,
sponsor: sponsor.address # recorded on the EscrowDeposit
)The recorded sponsor also matters at close time: on reclaim, either the depositor or the sponsor may sign and receive the returned rent. The sponsor field is stored on the EscrowDeposit account (see Account Types) and is nil for unsponsored deposits.
Mediated escrows
Mediated escrows don't use a sponsor field. Instead they have a rent collector (who receives the closed-account rent on release) and an optional expiry. See Expiry & Reclaim and Mediated Deposit.