Smart sessions let your dapp act on the user’s behalf within an explicit policy: a set of allowed contracts, function selectors, and an expiry. The user signs once to grant the session; afterwards every UserOperation that fits inside the policy can be executed by a session signer without prompting the user again. Smart sessions are implemented as an ERC-7579 validator module. The Startale AA SDK ships first-party helpers around the Rhinestone Smart Sessions module so you can install it and grant permissions through the sameDocumentation Index
Fetch the complete documentation index at: https://docs.startale.com/llms.txt
Use this file to discover all available pages before exploring further.
StartaleAccountClient you already use.
Source:
StartaleGroup/scs-aa-sdk. The flow below mirrors the production integration in the Startale super-app.How it fits together
Two artefacts come out of the granting step:- A permission id that identifies the policy onchain.
- A session key keypair. The public key is committed to the policy; the private key is used by your backend or browser to sign UserOperations within scope.
1. Check whether the module is installed
getSmartSessionsValidator builds the validator descriptor. The module is keyed by its onchain address, so you can call isModuleInstalled on the account client to check status before installing.
| Symbol | Source | Role |
|---|---|---|
getSmartSessionsValidator | @startale-scs/aa-sdk | Returns a validator descriptor pre-wired for the Smart Sessions module. |
isModuleInstalled | StartaleAccountClient (ERC-7579 actions) | Reads the account’s installed validators onchain. |
2. Install the module (one-time per account)
If the module is not installed, install it once. Installation is itself a UserOperation, so it goes through your bundler and (optionally) your paymaster.| Symbol | Source | Role |
|---|---|---|
installModule | StartaleAccountClient (ERC-7579 actions) | Sends a UserOperation that installs the module on the account. |
waitForUserOperationReceipt | StartaleAccountClient | Polls the bundler for the receipt. |
3. Define the permission scope
A session scope is a list ofCreateSessionDataParams. Each entry binds the session key to a contract and a function selector, with optional onchain policies.
| Field | Type | Notes |
|---|---|---|
sessionPublicKey | Address | The public key of the session signer. The corresponding private key signs UserOperations within scope. |
actionPoliciesInfo[].contractAddress | Address | Contract the session is allowed to call. |
actionPoliciesInfo[].functionSelector | Hex | The 4-byte selector the session is allowed to call on that contract. |
actionPoliciesInfo[].sudo | boolean | When true, allows any arguments. Set to false and add granular policies (spending caps, allowlists) for tighter control. |
4. Grant the permission
Granting the permission is also a UserOperation, signed once by the account owner. UsesmartSessionCreateActions to extend the account client with the granting action, then call grantPermission.
| Symbol | Source | Role |
|---|---|---|
toSmartSessionsValidator | @startale-scs/aa-sdk | Builds the per-session validator object bound to the account and the session signer. |
smartSessionCreateActions | @startale-scs/aa-sdk | Extends StartaleAccountClient with grantPermission. |
grantPermission | extended client action | Sends a UserOperation that registers the policy and returns one permission id per sessionRequestedInfo entry. |
5. Execute UserOperations under the session
Once granted, build a separateStartaleAccountClient whose signer is the session key. UserOperations from this client are validated by the Smart Sessions module instead of the account’s default validator.
Operational guidance
| Concern | Recommendation |
|---|---|
| Storage | Backend KMS, secure enclave, or sealed browser storage. |
| Rotation | Issue short sessions (minutes-to-hours for high-risk flows, days for low-risk). |
| Revocation | Revoke a permission id by calling the module’s revocation flow when a session is compromised. |
| Auditing | Persist permission ids alongside userOpHash so you can correlate signed sessions with onchain activity. |
Next steps
Social recovery
Combine sessions with a guardian-based recovery module.
Sponsored paymaster
Sponsor every session UserOperation through the SCS paymaster.
Parallel transactions
Run independent session UserOperations concurrently.
Smart account setup
Refresh the underlying account and client setup.