Skip to main content

Introduction

Adding a role gives an authority a separate set of permissions on an existing wallet.
  • Use when: you need to grant access to another signer, application, session, or guardian.
  • For: apps managing user and service access to a shared wallet.

How it works

  1. Fetch the wallet and select an administrator role with All or ManageAuthority.
  2. Construct the new authority and its permission set.
  3. Build and submit the add-role instructions with the administrator and payer.
  4. Refetch confirmed state and identify the new role by its authority and permissions.

SDK example

Give an Ed25519 signer a total 0.1 SOL budget and System Program access. The administrator also pays the fee; the new signer does not need to sign its addition.
  • Select the intended returned role by its permissions. One signer can have several roles.
  • Record its on-chain id; role IDs are not array positions.
  • Use the same builder with Secp256r1, Secp256k1, ProgramExec, or a session authority.
  • An administrator using Secp256r1 or Secp256k1 supplies the signing callback and current slot described in Signing.