Explore the cryptographic techniques that power NINJA's confidential transfers and privacy features.
NINJA leverages Solana's Confidential Transfer Extension, which is part of the Token-2022 standard. This extension enables private token transfers by utilizing advanced cryptography and zero-knowledge proofs. Here's how it works at a high level:
These cryptographic systems work together to create a secure, verifiable, and private token transfer system on Solana.
ElGamal encryption is a public-key cryptosystem used to encrypt token balances on the blockchain. It has the unique property of being additively homomorphic, which means mathematical operations can be performed on encrypted values without decrypting them.
In NINJA, ElGamal encryption protects the confidentiality of token balances while still allowing the verification of transactions. When you deposit tokens into your confidential account, your balance is encrypted and stored on-chain in this format.
Zero-knowledge proofs (ZKPs) are cryptographic methods that allow one party to prove to another that a statement is true without revealing any additional information beyond the validity of the statement itself.
NINJA uses ZKPs to:
The specific ZKP implementation used in Solana's confidential transfers is a variant of Bulletproofs, which are efficiently verifiable and don't require a trusted setup.
Pedersen commitments are cryptographic primitives that allow you to commit to a value while keeping it hidden, with the ability to reveal it later. They have two key properties:
In NINJA, Pedersen commitments are used as part of the ZKP system to create secure and verifiable representations of transaction amounts without revealing the actual values.
The Solana Confidential Transfer Extension includes optional auditor functionality. This feature allows designated entities (auditors) to decrypt and view encrypted balances and transfer amounts, which can be useful for regulatory compliance.
Key aspects of the auditor system:
NINJA implementation allows for this functionality but makes it optional, putting privacy control in the hands of users.
Ninja Mode enhances privacy by adding path obfuscation on top of confidential transfers. This is achieved through a combination of techniques:
Even with path obfuscation, sophisticated statistical analysis of blockchain data might still potentially identify patterns that could link some transactions. Ninja Mode significantly increases privacy but does not guarantee absolute unlinkability against advanced analysis.
The path obfuscation in Ninja Mode operates on the application layer rather than the protocol layer, allowing it to leverage Solana's underlying confidential transfer capabilities while adding additional privacy features.
Looking for more technical details on Solana's confidential transfers?