Skip to content

@armada/sdk / index / tryDecryptShield

Function: tryDecryptShield()

tryDecryptShield(commitment, receiver): Promise<OwnedNote | undefined>

Defined in: src/sync/shield-crypto.ts:26

Try to claim a shield commitment as owned by the wallet. Shields carry a plaintext value/token in the preimage; ownership is proven by ECDH against the ephemeral shieldKey: derive the shared key, decrypt random, recompute npk = poseidon(myMasterPublicKey, random), and match it to the preimage npk. Returns the owned note (canonical tokenHash + value) or undefined if not ours.

Parameters

commitment

DecodedShieldCommitment

receiver

ReceiverNoteKeys

Returns

Promise<OwnedNote | undefined>