Checking Registration Status
UsegetUserAccountQuerierFunction from @umbra-privacy/sdk/query to inspect an account’s current registration state without triggering any transactions:
When to Register
Register once, at account setup time. Check state before callingregister() so you avoid unnecessary transaction prompts for users who are already fully set up:
Pre-check the recipient before a receiver-burnable create
This is the most common integration footgun. A receiver-burnable Stealth Pool Note encrypts the unlocker against the recipient’suserCommitment, so the recipient must have all three flags (isInitialised, isUserAccountX25519KeyRegistered, isUserCommitmentRegistered) set before you write the note. Pre-check at the API boundary and either error with a clear message or fall back to a self-burnable create:
Registration state fields
Thedata object returned when result.state === "exists":
isInitialised— the baseEncryptedUserAccountPDA has been created.isUserAccountX25519KeyRegistered— the X25519 token-encryption pubkey has been stored on-chain (Confidential-usage sub-step complete). Required for Shared-mode ETAs.isUserCommitmentRegistered— the Poseidon user commitment has been stored (Anonymous-usage sub-step complete). Required to receive receiver-burnable notes.isActiveForAnonymousUsage— the account is active and cleared for anonymous usage (both sub-steps complete and valid).x25519PublicKey— the registered X25519 public key bytes, if the confidential sub-step is complete.userCommitment— the registered Poseidon commitment, if the anonymous sub-step is complete.generationIndex— monotonic counter used for nonce derivation. Use this to derive the next note nonce — never invent your own.randomGenerationSeed— entropy bytes mixed into nonces.
For the full type reference see Query.