Luminar Logo
BACK TO JOURNALEngineering

Under the Hood: Integrating Freighter Wallet with ZK Circuits

A developer walkthrough of binding private keys to anonymous zero-knowledge commitments using the Freighter browser API.

AS
Ashish
May 29, 202610 min read
FREIGHTER BINDINGREADY
const signature = await signAuthEntry(entry);
const witness = generateWitness(signature);
// private commitments
User Address reduced to field element:
19827384910283748291038472910382918...

Integrating browser-based wallets with zero-knowledge circuits requires bridging two distinct cryptographic environments. In this developer guide, we walk through how Luminar utilizes the Freighter Wallet browser API to obtain a secure signature, which is then used as a private seed within the client-side Noir circuit.

This seed generates the Poseidon2 nullifier and user commitments. We detail the mechanics of Freighter's API calls, the modular conversion of Ed25519 public keys to BN254 field elements, and how to verify that the generated ZK witness matches the user's connected wallet address without revealing it.

Cryptographic Bridge Stellar uses Ed25519 public keys, which do not map natively to the BN254 curves used by Aztec's UltraHonk verifiers. To bridge this, we implement a modular reduction technique on the client, transforming the wallet public key into a valid field element inside the circuit, ensuring secure linkage without sacrificing cryptographic integrity.