Shield with the SDK
Use ShieldedWallet.shield to create note material locally, transfer classic SPL tokens and persist the note.
ShieldedWallet.shield accepts a pool, one of its mint addresses and a positive bigint amount in base units. The SDK derives owner commitment and randomness, builds the encrypted note envelope and appends the commitment using the active page archive.
const result = await shielded.shield({
pool,
mint: tokenAMint,
amount: 25_000_000n,
});
// The SDK persists the note in the configured NoteStore.
// Keep result.note private; it contains note witness material.
console.log("Finalized Shield signature:", result.signature);The returned object is { signature, note }. The source wallet and the ShieldedNoteAppended amount are public. Core charges a separate 5 bps Shield fee, floored in base units, in addition to the note amount.
The SDK creates/validates the depositor's associated token accounts, prepares the needed archive account addresses and tracks operation state in the store. Shield itself does not require a Groth16 proof, but a production shieldedWallet still requires an explicit persistent NoteStore.
After Shield
The note includes pool, asset, amount, owner commitment, randomness and commitment as well as local generation/leaf metadata after authenticated finalization. Do not print or transmit it. Later privateSwap and unshield calls use the local note and a witness provider.
See Shield protocol flow and Note security.