Horus Design principle is based on a commitment-nullifier scheme: anyone who deposits a token uses a private secret key - S. User locally computes the commitment - ”leaf" L=hash(S,1), which gets published on-chain and becomes part of the state, and N=hash(S,2), which is called the nullifier. The state gets stored in a Merkle tree. This allows us to simultaneously solve privacy and the double spending problem.

In Horus Protocol, we utilize a clever system called a commitment-nullifier scheme to ensure both privacy and prevent double-spending. Let's break it down:

Commitment: When a user wants to deposit a token, they generate a private secret key, denoted as S. Using this secret key, the user locally computes a commitment called the "leaf," represented by L=hash(S,1). The leaf is a unique cryptographic representation of the user's deposit, and it remains hidden from external observers.

**Nullifier:** Simultaneously, the user computes another value called the nullifier, denoted as N=hash(S,2). The nullifier acts as a proof that the user has spent their token and prevents double spending. Like the leaf, the nullifier is derived from the user's secret key and remains confidential.

State and Merkle Tree: The computed leaf value, L, is published on the blockchain, becoming part of the Horus Protocol's state. This state is organized and stored using a data structure called a Merkle tree. The Merkle tree enables efficient verification and retrieval of data stored on the blockchain.

By employing this commitment-nullifier scheme and leveraging the power of the Merkle tree, Horus Protocol achieves two crucial objectives simultaneously: privacy and prevention of double spending. Users can transact with confidence, knowing that their transactions remain private and secure while ensuring the integrity of the overall system.

To help visualize the process, here are three flowchart images illustrating how zk-SNARKs are constructed and implemented in the Horus Protocol:

<aside> 💡 Fig1: Horus Cash Flowchart Base Diagram

</aside>

Fig1 Horus Cash Flowchart Base Diagram.png

<aside> 💡 Fig2: Horus Cash Flowchart Deposit Diagram

</aside>

Fig2 Horus Cash Flowchart Deposit Diagram.png

<aside> 💡 Fig3: Horus Cash Flowchart Transaction Diagram

</aside>

Fig3 Horus Cash Flowchart Transaction Diagram.png