Debugging & Inspection
Privacy is notoriously hard to debug. When a transaction fails in a ZK circuit, the error is often an opaque ProofVerificationFailed or a silent timeout.
You cannot "inspect" a private transaction on a block explorer because, by definition, the data is hidden.
The "Inspect" Pattern
Veil solves this by treating "No Privacy" as a valid privacy state for development.
During local development or debugging sessions, you force Veil to use the NoopPrivacyAdapter.
// In your development config
const isDev = process.env.NODE_ENV === 'development';
const veil = createVeil({
wallet,
// Force Noop in dev to see actual instruction logs
adapter: isDev ? new NoopPrivacyAdapter() : undefined
});Why this is necessary
When you run veil.send() with the NoopPrivacyAdapter:
- Visibility: The transaction executes as a standard SPL transfer. You can see the exact token accounts, amounts, and signers in the Solana Explorer.
- Logic Verification: You verify that your app is deriving the correct recipient addresses and amounts before introducing the complexity of proof generation.
- Speed: You don't wait 5-30 seconds for a ZK proof to generate on your laptop.
The Debug Workflow
- Build with Noop: Implement your entire UI and flow using the transparent adapter. Ensure balances update and receipts render.
- Switch to Testnet Privacy: Swap the adapter configuration to the real privacy provider's Devnet adapter.
- Verify Proofs: Now you are only debugging the cryptography/network layer, because you know the business logic (amounts, recipients) is correct.
This separation prevents "debugging two things at once"—a common trap where developers aren't sure if their code is broken or if the privacy circuit is rejecting the proof.