/** Note data stored inside a Blind Mailbox encrypted blob */ export type BlindMailboxNoteData = { blinding: Uint8Array; leafIndex: number; commitment: Uint8Array; amount: bigint; mintAddress: string; treeId: number; }; /** Encrypted note as returned by the relayer's /api/notes endpoint */ export type BlindMailboxNote = { commitment: string; ephemeralPublicKey: string; encryptedBlob: string; timestamp?: number; blockHeight?: number; txSignature?: string; }; /** Decrypted note data after calling decryptBlindMailboxNote */ export type DecryptedNote = { blinding: Uint8Array; leafIndex: number; commitment: Uint8Array; amount: bigint; timestamp: number; mintAddress?: string; treeId: number; }; /** Derive 32-byte encryption key from a shared secret using SHA-512 truncated. * Must match the production "sha256" helper which uses nacl.hash (SHA-512) [0:32]. * * DO NOT "fix" this to real SHA-256. The name in the sibling implementations * (`sha256ForNotes`) is a misnomer, but the bytes are load-bearing: changing the * KDF makes every historical note undecryptable. * * @internal Exported for `compactNote.ts`. Not part of the stable public API. */ export declare function kdfSHA512_256(secret: Uint8Array): Uint8Array; /** Convert an Ed25519 private seed (32 bytes) to an X25519 scalar. * Equivalent to ed2curve.convertSecretKey(seed). * * @internal Exported for `compactNote.ts`. Not part of the stable public API. */ export declare function ed25519SeedToX25519Private(seed: Uint8Array): Uint8Array; /** Convert an Ed25519 compressed public key (32 bytes) to X25519. * Equivalent to ed2curve.convertPublicKey(pubkey). * Edwards y-coord → Montgomery u via: u = (1 + y) / (1 - y) (mod p). * * @internal Exported for `compactNote.ts`. Not part of the stable public API. */ export declare function ed25519PublicKeyToX25519(pubkey: Uint8Array): Uint8Array; /** * Encrypt a UTXO note for a recipient identified by their Solana wallet public key. * Produces a blob the relayer will store and serve via POST /notes/save. * * @param recipientWalletPubkey 32-byte Ed25519 public key (wallet.publicKey.toBytes()) * @param noteData UTXO details to encrypt */ export declare function encryptBlindMailboxNote(recipientWalletPubkey: Uint8Array, noteData: BlindMailboxNoteData): { ephemeralPublicKey: Uint8Array; encryptedBlob: string; }; /** * Decrypt a Blind Mailbox note using the recipient's Solana wallet private seed. * * @param walletSecretKey Full 64-byte wallet.secretKey — the first 32 bytes are the seed * @param ephemeralPublicKey 32-byte raw public key stored alongside the encrypted blob. * This may be either an Ed25519 pubkey (from Keypair.generate()) * or a raw X25519 pubkey — the decryption path handles both: * if it is an Ed25519 key it is converted; otherwise used directly. * @param encryptedBlob Base64 string as stored by the relayer */ export declare function decryptBlindMailboxNote(walletSecretKey: Uint8Array, ephemeralPublicKey: Uint8Array, encryptedBlob: string): DecryptedNote;