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, polling the relayer.
This is the same pattern @solana/kit uses for its instruction builders:
Naming Conventions (V18)
Names are long, but they spell out the exact data flow.-
Deposit family (
@umbra-privacy/sdk/deposit)getATAIntoETADirectDepositorFunction— ATA → ETA.getATAIntoSelfBurnableStealthPoolNoteCreatorFunction— ATA → self-burnable Stealth Pool Note.getATAIntoReceiverBurnableStealthPoolNoteCreatorFunction— ATA → receiver-burnable Stealth Pool Note.getETAIntoSelfBurnableStealthPoolNoteCreatorFunction— ETA → self-burnable Stealth Pool Note (MPC).getETAIntoReceiverBurnableStealthPoolNoteCreatorFunction— ETA → receiver-burnable Stealth Pool Note (MPC).
-
Withdrawal family (
@umbra-privacy/sdk/withdrawal)getETAIntoATAWithdrawerFunction— ETA → ATA.
-
Burn family (
@umbra-privacy/sdk/burn)getBurnableStealthPoolNoteScannerFunction— zero-arg scanner, cursor inclient.utxoDataStore.getReceiverBurnableStealthPoolNoteIntoETABurnerFunction— receiver-burnable → ETA.getSelfBurnableStealthPoolNoteIntoETABurnerFunction— self-burnable → ETA.getSelfBurnableStealthPoolNoteIntoATABurnerFunction— self-burnable → ATA.- (Receiver-burnable → ATA exists on-chain but is not yet shipped in the SDK.)
-
Registration (
@umbra-privacy/sdk/registration) —getUserRegistrationFunction. -
Query (
@umbra-privacy/sdk/query) —getUserAccountQuerierFunction,getEncryptedBalanceQuerierFunction. -
Conversion (
@umbra-privacy/sdk/conversion) —getNetworkEncryptionToSharedEncryptionConverterFunction. -
Compliance (
@umbra-privacy/sdk/compliance) — grant issuer / revoker / re-encryptors / queriers. -
Account (
@umbra-privacy/sdk/account) — staged-token recoverers (getStagedSplRecovererFunction,getStagedSolRecovererFunction), key rotators, maintenance helpers.
[verb] from [source] (into|to) [destination] or [verb] [object]. Factory names use the abbreviations ATA (AssociatedTokenAccount) and ETA (EncryptedTokenAccount) — e.g. getATAIntoETADirectDepositorFunction — so they stay short while remaining searchable and self-describing in code.
V18 vocabulary
- Stealth Pool Note replaces V13’s “UTXO” in factory names and types. The wire protocol and on-chain instructions retain
claim_*/utxo_*spellings for compatibility. - Burn replaces V13’s “claim” in factory names. The relayer endpoint is still
/v1/claims, and the burner factory’srelayerdep takes{ submitBurn, pollBurnStatus, getRelayerAddress }—submitBurnandpollBurnStatusare TypeScript aliases ofsubmitClaimandpollClaimStatus, so the relayer client’s existing methods plug in unchanged under the renamed property names.
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, ZK prover, and relayer adapter used internally. Alldepsfields have sensible defaults derived from theclient. The only exceptions are ZK provers and the burner factoryrelayeradapter, which have no built-in defaults 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.