To prevent double-spending, zkAPI publishes a unique cryptographic identifier called a nullifier for each transaction, which exposes duplicate spending attempts while maintaining user anonymity.