import { PublicKey } from "@solana/web3.js"; import type { SerializedUTXO } from "./model.js"; /** * Encrypted UTXO note — can be broadcast alongside a transaction so the * recipient can recover their note without a server. */ export type EncryptedNote = { /** 24-byte NaCl box nonce */ nonce: Uint8Array; /** Ciphertext containing amount + blinding + privateKey */ ciphertext: Uint8Array; /** Sender's ephemeral 32-byte X25519 public key */ senderEphemeralPubkey: Uint8Array; }; /** * Derive a NaCl X25519 encryption keypair from a UTXO private key. * The keypair is deterministic: same privateKey always yields the same pair. */ export declare function deriveEncryptionKeypair(privateKey: bigint): { publicKey: Uint8Array; secretKey: Uint8Array; }; /** * Encrypt a UTXO so the recipient can recover it from on-chain events. * * Plaintext layout (72 bytes): * [0..8] amount — 8-byte little-endian u64 * [8..40] blinding — 32-byte big-endian field element * [40..72] privateKey — 32-byte big-endian field element * * Uses ephemeral-key NaCl box so the sender key is single-use. */ export declare function encryptUTXONote(utxo: SerializedUTXO & { privateKey: bigint; }, recipientEncPubkey: Uint8Array): EncryptedNote; /** * Try to decrypt an encrypted UTXO note using the recipient's private key. * Returns the SerializedUTXO if decryption succeeds and the commitment * matches, or `null` if the note was not intended for this key. */ export declare function decryptUTXONote(note: EncryptedNote, recipientPrivateKey: bigint, commitment: Uint8Array, mintAddress: PublicKey): SerializedUTXO | null;