Design Philosophy
The Umbra SDK is written in the same functional, dependency-injected style as Anza’s@solana/kit. Every capability is either a pure function or a factory that returns one. There are no classes with internal state, no singletons, and no implicit globals. Dependencies are explicit, injectable, and testable.
This mirrors the architecture of @solana/kit itself - functions like getTransferSolInstruction and createSolanaRpc follow the same closure-based factory pattern you will find throughout the Umbra SDK.
The Factory Pattern
Every SDK operation follows the same two-step pattern:get*Function) is cheap. It binds configuration and resolves defaults. The returned function is what does the actual async work - sending transactions, generating proofs, querying the indexer.
This is the same pattern @solana/kit uses for its instruction builders:
Naming Conventions
All factory functions use a consistentget[Verb][Subject]Function scheme. The verb tells you what the returned function does:
getDirectDeposit...- credits tokens to an encrypted accountgetDirectWithdraw...- debits tokens from an encrypted account to a public accountgetCreate...- creates a new on-chain entity (UTXO, grant)getClaim...- redeems an on-chain entity (UTXO, staged funds)getFetch...- queries off-chain data (indexer)getQuery...- queries on-chain state (RPC)getRotate...- replaces a registered keygetConvert...- migrates an account between protocol modesgetReencrypt...- re-encrypts ciphertexts under a new keygetUpdate...- mutates account metadatagetUserRegistration...- the full registration flow
args and deps
Every factory accepts two arguments:args- required. Always containsclient: IUmbraClientand any fixed configuration for this operation (e.g. a specific mint).deps- optional. Contains every infrastructure provider, key generator, and ZK prover used internally. Alldepsfields have sensible defaults derived from theclient. The only exceptions are ZK provers, which have no default and must always be supplied explicitly.
deps override client-level deps. Client-level deps override built-in defaults.
The Advanced section covers dependency injection internals, key generators, ZK provers, transaction callbacks, and key rotation in depth. Most applications do not need those details to get started.