Developer
Integrate multiasset notes, local proofs and mainnet transactions.
lib/v3 · TypeScriptEncrypted notes.
Encrypted notes.
Local proofs.
Create accounts, recover notes from the shared pool and submit through an EVM wallet.
import { parseUnits } from 'viem';
import { makeNote, parsePrivacyAddress, prepareTransition,
selectNotes } from './lib/v3/crypto';
import { sync, submitTransaction } from './lib/v3/chain';
import { generateProof } from './lib/v3/prover';
const state = await sync(rpc, manifest, account);
const amount = parseUnits('1.25', 18);
const fee = state.state.fee;
const inputs = selectNotes(state.notes, amount + fee);
const change = inputs.reduce((s, n) => s + n.note.amount, 0n)
- amount - fee;
const outputs = [makeNote(amount, parsePrivacyAddress(recipient))];
if (change) outputs.push(makeNote(change, account.publicKey));
const prepared = prepareTransition({
context: state.context, tree: state.tree,
operation: 1, sender: account, inputs, outputs,
protocolFee: fee, protocolRecipient: state.state.treasury,
deadline: (await rpc.getBlock()).timestamp + 900n
});
// Display amount, fee, self-relay gas and expiry; obtain approval.
const proof = await generateProof(prepared, manifest);
const hash = await submitTransaction(
rpc, ethereum, manifest, evmAddress, prepared, proof
);Integration paths
Privacy detailsv3 modules
- Local Groth16 proof generation.
- Shared tree with token-specific notes.
- Exact allowance and wallet submission.
Before submission
- Verify the chain, pool and selected token.
- Read the current root, fee and deadline.
- Review the amount and wallet-paid ETH gas.
HTTP API
API referenceGET/api/v3/assetsOfficial tokens and registrationsGET/api/v3/deployment?asset=NVDAToken-specific multiasset manifestGET/api/v3/asset?asset=NVDAOfficial token identity checkGET/api/v3/statusv3 availabilityPOST/api/v3/rpcRead-only mainnet RPC