Lectura rápida
Empieza por la explicación más corta y útil antes de profundizar.
ElGamal encryption is a public-key cryptosystem based on the Diffie-Hellman problem over an elliptic curve group, providing additive homomorphism — meaning the encryption of a sum of values equals the product of their individual ciphertexts — which makes it suitable for confidential token balance accounting where balances can be updated without decrypting them. On Solana, the Token-2022 Confidential Transfers extension uses Twisted ElGamal encryption over the Ristretto255 curve to encrypt token balances in token accounts, so transfers update encrypted balances homomorphically while zero-knowledge range proofs (proving a balance is non-negative and a transfer amount is within bounds) prevent overdrafts without revealing any amounts. Each confidential token account stores a pending encrypted incoming balance and an available encrypted balance, and the account owner uses their ElGamal private key to decrypt and rotate balances via ZK-proof-accompanied instructions.