Constructs a new TransactNote instance.
The transact 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 ERC20 outbound TransactNote addressed to the receiver. Derives the note public key from the receiver master public key and the note random, generating a fresh 16-byte random when one is not supplied. A hidden sender gets a fresh 15-byte sender random. A shown sender gets MEMO_SENDER_RANDOM_NULL.
The creation parameters
A new TransactNote instance ready to encrypt
Serializes the transact note to a Uint8Array using msgpack encoding. Output shape matches TransactNoteSerialized.
The serialized transact note
StaticdeserializeDeserializes a transact note from a Uint8Array. Resolves tokenHash to full TokenData via tokenDataGetter.
The serialized transact note data
The TXID version
The chain this note belongs to
Resolves token hashes to full token data
A new TransactNote instance
StaticfromCreates a TransactNote from pre-decrypted commitment fields. Use decryptCommitment to obtain the fields from an encrypted commitment. NOTE: Requires cryptography libraries to be initialized first via initializeCryptographyLibs()
Random value (16 bytes hex string)
Note public key (hex string)
Note value (bigint)
Token data
Receiver address data
OptionalsenderAddressData: AddressData
Optional sender address data
A new TransactNote instance
Serializes a transact note in legacy format (for backward compatibility). Legacy format uses encrypted random field instead of plain random. The random is encrypted directly with the viewing private key (no ECDH). Output shape matches LegacyTransactNoteSerialized.
Viewing private key for encryption (32 bytes)
The serialized legacy transact note
StaticdeserializeDeserializes a legacy transact note. The random is decrypted directly with the viewing private key (no ECDH). Legacy notes are always ERC20.
The serialized legacy note data
Viewing private key for decryption (32 bytes)
A new TransactNote instance, or null if decryption fails (wrong viewing key)
StaticisChecks if a serialized note is in legacy format.
The serialized note data
True if legacy format, false otherwise
AES-256-GCM encrypts this outbound note for the V2 transact circuit, using the shared symmetric key derived between the sender and the receiver. The encrypted memo is split off the ciphertext data but stays under the same GCM tag, matching the contract's CommitmentCiphertext layout. The annotation data carries the output type, sender random, and wallet source, readable only by the sender's viewing key. Matches the community engine encryptV2.
32-byte shared symmetric key between sender and receiver
Sender master public key, used to encode the MPK when senderRandom is unset
Sender viewing private key, encrypts the annotation data
The note ciphertext (3 data blocks), the encrypted memo bytes, and the annotation data
StaticciphertextConverts ciphertext to encrypted random data format [ivTag, data].
The ciphertext object
Tuple of [ivTag, data]
StaticencryptedConverts encrypted random data format to ciphertext object.
Tuple of [ivTag, data]
Ciphertext object
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 note hash as a bigint
Receiver address data
Optional sender address data
Optional output type
Optional wallet source
Optional sender random value
Optional memo text
Optional shield fee
Optional block number
Represents a Transact note for private-to-private transfers. These notes move value between wallets without ever exposing assets on-chain, carrying receiver/sender address data, a Poseidon hash, and optional metadata such as memoText, outputType, and shieldFee. Extends Note with transaction-specific fields.
Supports both a modern msgpack serialization format and a legacy format that encrypts the random value with AES-GCM using the viewing private key directly (see TransactNote.serializeLegacy).
Can be created directly, deserialized from either format, or reconstructed from on-chain commitment data (TransactCommitment or EncryptedCommitment).