Skip to content

Tutorial

In this section, we describe how to use the pallet for privacy-preserving transactions.

You can check Frequent Errors when the error happens.

Abstract

The privacy-preserving transactions consists of several pallet components. We roughly explain what kind of role for each pallet has.

pallet-plonk

plonk is a zk-Snarks scheme and allows us to prove that the computation was done correctly. We perform transaction on off-chain and generate the proof. The blockchain verifies the proof and approve the transaction. We define the constraints circuit for confidential transfers and confidential smart contracts by this pallet.

pallet-encrypted-balance

Users balances are encrypted by default. We use additive homomorphic arithmetic to hide the integer in transaction. Combining original pallet-balance and ElGamal encryption and we implemented pallet-encrypted-balance. This pallet can't be used only by this self, because this doesn't check the validity of additive homomorphic arithmetic.

confidential_transfer

Users can transfer without being known actual amount by others with this pallet. plonk checks the confidential transfer constraints and pallet-encrypted-balance performs the additive homomorphic state transition.