Overview
Ephemeral Signers are keys expected to sign a transaction and be discarded immediately after. They present challenges for Smart Wallets that don’t execute transactions immediately.Problem
An Ephemeral Signer (ES) is a key that signs a transaction and is then discarded. A common example is theSystemProgram.createAccount instruction, which requires the new account to be a signer to verify authority.
The Keypair.generate() method is typically used by app developers to create ephemeral signers, but this mechanism doesn’t work with Smart Wallets that don’t execute transactions immediately. The ephemeral keypair will not be available to sign the “execute” transaction because it has already been lost.
Solution 1: Use createAccountWithSeed
Avoid Ephemeral Signers by usingSystemProgram.createAccountWithSeed instead of SystemProgram.createAccount. The difference is that the latter requires the new account’s signature, whereas the former doesn’t because the new account is “controlled” by the basePubkey.
Example for wrapping SOL via an auxiliary token account:
Solution 2: Use getEphemeralSigners API
If Solution 1 doesn’t fit your needs and you require a second signer, SquadsX exposes thegetEphemeralSigners API. This allows apps to request ephemeral signers from the wallet. The wallet returns an array of account addresses for use in transactions.
The API is exposed via the Wallet Standard feature detection mechanism:
getEphemeralSigners(1, 2) for the second transaction, getEphemeralSigners(1, 3) for the third.
fuse:getEphemeralSigners is specific to SquadsX. It was proposed for the Wallet Standard in sRFC 00019 but has not been adopted.