Constructs a new UnshieldNote instance.
The unshield note parameters
StaticassertProtected StaticassertValidates the caller input of an outbound note factory.
The value, token data, optional random, and optional master public key
The token types the factory accepts
StaticgetComputes the note hash from npk, token hash, and value.
The note public key as a Uint8Array
The token hash as a Uint8Array
The note value as a bigint
The note hash as a Uint8Array
StaticcomputeComputes the note public key (NPK) from a master public key and random value. NPK = poseidon(masterPublicKey, random)
The receiver's master public key as a Uint8Array
The note random value as a Uint8Array (16 bytes)
The note public key as a Uint8Array
StaticcomputeComputes the nullifier for a note at a given leaf index. The nullifier uniquely identifies a note when it is spent.
The wallet's nullifying key as a Uint8Array
The note's position in the merkle tree
The nullifier as a Uint8Array
StaticcreateCreates a new UnshieldNote that sends an ERC20 value to a public address. The note public key of an unshield note is the destination address. Generates a fresh 16-byte random when one is not supplied.
The creation parameters. value is the full pre-fee value.
A new UnshieldNote instance
Serializes the unshield note to a Uint8Array using msgpack encoding.
The serialized unshield note
StaticdeserializeDeserializes an unshield note from a Uint8Array.
The serialized unshield note data
A new UnshieldNote instance
StaticfromCreates an UnshieldNote from unshield data. The note hash is computed from amount + fee combined, matching the engine's behavior. NOTE: Requires cryptography libraries to be initialized first via initializeCryptographyLibs()
The Unshield object
Random value (16 bytes hex string)
A new UnshieldNote instance
StaticgetComputes the amount and fee from a total value and fee basis points.
The total value (amount + fee)
The fee in basis points (e.g. 25 = 0.25%)
The amount and fee
The note public key (npk) as a hex string
The note value as a bigint
The token data containing address, type, and subID
The token hash as a hex string
Random value (16 bytes hex string)
The destination address for unshielding
The note hash as a bigint
Whether to allow override
Represents an Unshield note for converting private RAILGUN notes back into public assets. This is the exit point for funds leaving the privacy system, sending tokens to a public destination address on-chain. Extends Note with a toAddress, a Poseidon hash, and an allowOverride flag.
Can be created directly, deserialized from msgpack-encoded bytes, or constructed from on-chain unshield data via UnshieldNote.fromUnshield.