Introduction
A session gives a temporary Ed25519 key access to a role after its original authority approves it.- Use when: an app needs repeated operations without prompting the original signer each time.
- For: interactive apps and services with time-limited delegated access.
How it works
- Add a session-capable authority with a maximum duration and scoped permissions.
- Have the original authority approve a temporary key and a duration within that maximum.
- Use the temporary key to sign operations through the same role.
- Let the session expire, replace it through the original authority, or remove its role to revoke access.
Session authorities
- Durations and expiry use slots. Choose a positive duration within the configured maximum.
- A session shares the role’s permissions and remaining budget. Opening a new session does not reset spending limits.
- Adding a session-capable role alone does not activate a session.
SDK example
Open a session
UsecreateEd25519SessionAuthorityInfo(ownerPublicKey, 1_000n) with Add a role first. This example opens a 500-slot session on that role; the owner approves it and pays the fee.
Use the session
- Refetch the wallet after confirmation.
- Locate the role with
findRoleBySessionKey(sessionKey.publicKey). - Pass that role ID to Signing.
- Sign with
sessionKeyand the payer, then send the transaction.
role.isSessionBased() before reading role.authority.expirySlot. Replacing the session key invalidates the previous session. Deleting a key locally does not revoke it on-chain; role removal revokes the role subject to its removal restrictions.
