📔KALIUM Smart Contract: Shield()

KALIUM Smart Contract: Shielding

When a user wants to make their cryptocurrency transactions private, they use a function called shield() in the KALIUM smart contract. This function takes care of all the steps needed to keep these assets private within the KALIUM system. This includes using a special Poseidon function to hide transaction details. Also, the smart contract stores a Merkle Tree where new data is kept, and this is managed by another contract called Commitments.sol.

Once the shield() function completes its work, it creates a Shield event. This event contains some data. But thanks to the strong privacy measures used in KALIUM, this data can only be read by someone who has the Spending Key or Viewing Key. This ensures that every time the smart contract is used, the privacy of the user is protected.

For developers who are using the KALIUM SDK, you won't need to worry about integrating the shield() function or anything related to keeping transactions private. The SDK is designed to handle all the complex parts of encryption and transaction creation, making it easier to develop with KALIUM.

Merkle Tree Data Structure in KALIUM's Privacy System

In KALIUM's privacy system, the Merkle tree data structure plays a pivotal role in safeguarding the privacy of assets on public blockchains. When assets undergo shielding using the cryptographic methods previously described, they are seamlessly incorporated into an anonymized pool managed by the KALIUM smart contract.

KALIUM's system includes an internally efficient implementation of a batch incremental Merkle Tree. With every shield transaction, a new note is generated, creating a fresh Root/Leaf within the Merkle Tree. It's worth noting that all assets within the KALIUM system share this same Merkle Tree, and every transaction responsible for altering the state of the Merkle Tree produces a new Merkle Root/Leaf. These new nodes are meticulously hashed and fortified by the zk-SNARK circuits, ensuring the utmost level of privacy and security for all assets within the KALIUM ecosystem.

In essence, the Merkle Tree in KALIUM's privacy system stands as a robust guardian of asset privacy on public blockchains, enabling efficient state updates while preserving user anonymity and security.

Last updated