{
  "id": 5186246,
  "title": "Building Sybil-Resistant Anonymous Systems on Midnight: Mastering Historic Merkle Trees and Domain-Separated Nullifiers in Compact",
  "url": "https://urgent.news/2026/09/02/building-sybil-resistant-anonymous-systems-on-midnight-mastering",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-02T22:21:37.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/efek/building-sybil-resistant-anonymous-systems-on-midnight-mastering-historic-merkle-trees-and-130a"
  },
  "original_language": "en",
  "account": "In the world of decentralized applications built on Ethereum and other EVM-compatible chains, access control and state tracking are vital components. Traditional EVM-based systems operate on public ledgers, where every transaction permanently records the caller's address (msg.sender) on the blockchain. This lack of privacy makes it challenging to verify eligibility criteria or prevent double spending while maintaining user anonymity. Midnight Network offers a different approach, allowing smart contracts written in Compact to execute inside local Zero-Knowledge (ZK) circuits on the user's device before interacting with the network. This paradigm shift presents a fundamental challenge: how to prevent users from voting multiple times, claiming airdrops repeatedly, or double-spending confidential vouchers when their identities remain completely private. To address this, we will build a production-grade, Sybil-resistant anonymous action engine on Midnight, exploring the Anonymous Membership Accumulator, the Nullifier Pattern, and the Compact Witness Taint System. The Anonymous Membership Accumulator utilizes the HistoricMerkleTree to solve asynchronous race conditions, which standard Merkle trees fail to handle effectively. This approach ensures that generating a ZK proof on the user's machine, which typically takes 2–5 seconds, does not lead to stale root errors due to concurrent registrations. The Nullifier Pattern introduces deterministic, domain-separated cryptographic nullifiers that prevent double-actions without revealing the user's identity on-chain. By linking the nullifier with a specific poll_id, we ensure unlinkability, making it computationally infeasible to invert the nullifier and discover the user's secret key (sk) or link it to the registration commitment. Finally, the Compact Witness Taint System explains why the compiler requires disclose() and why disclosing the nullifier does not compromise voter privacy. By integrating these components and providing an end-to-end TypeScript SDK, developers can seamlessly build and deploy anonymous voting systems on the Midnight Network.",
  "summary": "If you have built decentralized applications on Ethereum or other EVM-compatible chains, you are intimately familiar with access control and state tracking: // Traditional EVM Pattern: Zero Privacy mapping(address => bool) public hasVoted; function vote(uint256 proposalId, bool support) external { require(!hasVoted[msg.sender], \"Already voted\"); hasVoted[msg.sender] = true; // ... } In the EVM,…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}