Skip to main content

Overview

DynamicSvmWalletClient::sponsorTransaction is the lower-level primitive behind sponsored transactions. It takes the serialized message of an unsigned transaction and returns the sponsor-signed wire envelope — the sponsor’s signature is pre-filled in slot 0, the user signature slots are zeroed, and the original message is appended. Most apps don’t need this directly — use sendTransaction(...).sponsor(true) for the one-shot sign + sponsor + broadcast flow. Reach for sponsorTransaction when you want to:
  • Have the user sign the sponsor-prepped envelope on a separate path (client-side wallet, hardware wallet)
  • Inspect or audit the sponsor signature before adding the user signature
  • Batch sponsorship outside Dynamic’s broadcast path
Gas sponsorship must be enabled for your environment in the Dynamic dashboard before calls succeed.

Prerequisites

sponsoredWire layout:
The sponsor signature occupies slot 0; every other signature slot is zeroed and waiting for the corresponding signer.

Filling in the User Signature

If your wallet’s account index is idx (typically 1 for a single user signer after the sponsor), overwrite that 64-byte slot with the user’s Ed25519 signature, then push to RPC:
To compute the offset of slot idx:

Pairing with the MPC Signer

The most common pattern: sponsor first (no MPC needed), then run signTransaction over the same messageBytes to get the user’s Ed25519 signature, then splice it into the sponsored envelope:
For the streamlined version of this — sponsor + sign + broadcast in a single SDK call — see sendTransaction with sponsor=true.

Next Steps

Last modified on May 25, 2026