How Transactions Are Kept Private on Public Blockchains with Cryptography

Public blockchains are open networks that allow anyone to join, verify, and record transactions without intermediaries. They offer many advantages such as trustlessness, immutability, and censorship resistance. However, they also pose challenges to privacy, as anyone can view the transaction amounts and the addresses involved. If the address owners become known, they lose their anonymity and expose their financial activities to the public. Moreover, public blockchains may attract malicious actors who may try to manipulate or exploit the information on the ledger for their own benefit.

Fortunately, there are cryptographic techniques that can enhance transaction privacy on public blockchains without compromising their security and functionality. These techniques aim to hide or obfuscate the identities of the senders and receivers, the amounts of the transactions, or both. In this article, we will explore some of the most prominent techniques and their applications.

How Transactions are kept Private on Public Blockchains with Cryptography
How Transactions are Kept Private on Public Blockchains with Cryptography. Image by Freepik

Confidential transactions

Confidential transactions are a way of hiding the amounts of transactions on a public blockchain. For example, a sender can encrypt their transaction amount with a secret key, and send it to the receiver. The receiver can then decrypt it with the same secret key, but no one else can see the amount. Confidential transactions also use cryptographic proofs to ensure that the transactions are valid and do not create or destroy coins.

Bitcoin is a cryptocurrency that does not support confidential transactions by default. For example, Oasis Network confidential smart contracts are smart contracts that can execute in a trusted execution environment and use encrypted storage and end-to-end encryption to protect the privacy of the contract data and transactions.

Mixing services

Mixing services are a way of hiding the identities of the senders and receivers on a public blockchain. For example, a sender can send their coins to a mixing service, which pools them with coins from other users. The mixing service then sends back coins of the same value to the sender but from different addresses. The receiver can verify that the coins are valid, but cannot trace them back to the sender.

Mixing services rely on cryptographic protocols such as CoinJoin and CoinSwap. CoinJoin is a way of combining multiple transactions into one, such that it is impossible to tell which input corresponds to which output. CoinSwap is a way of swapping coins between users without revealing their addresses.

Dash is a cryptocurrency that supports mixing services by default, using a feature called PrivateSend. PrivateSend uses CoinJoin to mix coins from users who opt-in to the service. Zcoin is another cryptocurrency that supports mixing services using a feature called Sigma. Sigma uses CoinSwap to swap coins between users who opt-in to the service.

Trusted execution environments (TEEs)

A trusted execution environment (TEE) is a hardware-based secure computing model that isolates and protects the data and codes inside a region of the processor from the rest of the system. A TEE can provide confidentiality and integrity guarantees for the data and code within it, even if the operating system, hypervisor, or other applications are compromised or malicious.

A TEE can be used to enable secure data and computation on public platforms by creating a secure enclave that runs a trusted application. The trusted application can receive encrypted data from an external source, decrypt it inside the enclave, process it confidentially, encrypt the result, and send it back to the source. The source can verify that the trusted application has been executed correctly by checking a cryptographic attestation that is generated by the TEE.

Some of the use cases of TEEs are:

  • Cloud computing: TEEs can enable cloud users to outsource their sensitive data and computation to cloud providers without trusting them. For example, Oasis Network is a privacy-first platform for Web3 that enables confidential smart contracts using TEEs.
  • Blockchain: TEEs can enable blockchain users to perform off-chain computation that is verifiable on-chain. For example, Ekiden is a project that uses TEEs to enable scalable and private smart contracts on Ethereum.
  • Edge computing: TEEs can enable edge devices to process local data securely and efficiently without relying on centralized servers. For example, Intel SGX is a TEE technology that supports edge computing applications such as IoT, AI, and 5G.

Zero-knowledge proofs (ZKPs)

A zero-knowledge proof (ZKP) is a cryptographic mechanism that allows one party (the prover) to convince another party (the verifier) that they know a secret (such as a private key or a password) or that a statement is true (such as a transaction is valid) without revealing any information about it. The verifier can check the proof without learning anything about the secret or the statement.

A ZKP can be used to enable secure data and computation on public platforms by creating proof that attests to the correctness of a computation without revealing its inputs or outputs. The proof can be verified by anyone who has access to the public parameters of the computation, such as the code or the circuit. The proof can also be succinct, meaning it is much smaller than the computation itself.

Some of the use cases of ZKPs are:

  • Blockchain: ZKPs can enable blockchain users to perform private transactions that hide the identities and amounts of the parties involved. For example, Zcash is a cryptocurrency that uses ZKPs to enable shielded transactions on a public blockchain.
  • Decentralized applications: ZKPs can enable decentralized applications that require verifiable computation without disclosing sensitive data. For example, ZEXE is a protocol that uses ZKPs to enable confidential smart contracts on public blockchains.
  • Identity management: ZKPs can enable identity management applications that require selective disclosure of personal information without compromising privacy. For example, Idemix is a project that uses ZKPs to enable anonymous credentials on public platforms.

Homomorphic encryption

Homomorphic encryption is a way of performing computations on encrypted data without decrypting it. For example, a sender can encrypt their data with a public key, and send it to a receiver. The receiver can then perform operations on the encrypted data, such as addition or multiplication, without knowing its content. The sender can then decrypt the result with their private key.

Homomorphic encryption can be used to enable secure data and computation on public platforms by allowing users to outsource their encrypted data and computation to untrusted parties without losing control over them. The untrusted parties can perform computations on the encrypted data and return encrypted results to the users. The users can then decrypt the results and verify their correctness.

Some of the use cases of homomorphic encryption are:

  • Cloud computing: Homomorphic encryption can enable cloud users to store and process their encrypted data on cloud servers without trusting them. For example, Duality is a company that provides homomorphic encryption solutions for cloud computing applications such as data analytics, machine learning, and health care.
  • Blockchain: Homomorphic encryption can enable blockchain users to perform confidential transactions that hide the amounts of the transactions. For example, Dusk Network is a platform that uses homomorphic encryption to enable confidential transactions on a public blockchain.
  • Data sharing: Homomorphic encryption can enable data-sharing applications that require secure aggregation and analysis of encrypted data from multiple sources. For example, TFHE is a library that uses homomorphic encryption to enable secure remote computing on encrypted data.

Conclusion

These are some examples of how cryptographic techniques can achieve transaction privacy on public blockchains. However, these techniques also have trade-offs and limitations, such as computational complexity, scalability issues, and regulatory compliance. Therefore, users and developers should carefully evaluate their needs and preferences before choosing a privacy solution for their blockchain applications.

Personal Note From MEXC Team

Check out our MEXC trading page and find out what we have to offer! There are also a ton of interesting articles to get you up to speed with the crypto world. Lastly, join our MEXC Creators project and share your opinion about everything crypto! Happy trading!

Join MEXC Creators Project or start your travel on MEXC

This article was contributed by our guest writer. Want to share something unique with over 10 million users? Check out the MEXC Creators program.

Join MEXC Creators
Register on MEXC Exchange
Obed Obed

Obed is a crypto writer, researcher, and content creator with a passion for promoting the adoption of blockchain technology. With experience as an Ambassador for several projects, including Aptos Pontem, Polkadot, Ankr, Cardano, and Oasis, he produces high-quality content that resonates with readers. Obed is committed to excellence and is always excited to help clients achieve their goals through compelling blog posts, articles, and other types of content.

Share your love to MEXC
Default image
Obed Obed
Obed is a crypto writer, researcher, and content creator with a passion for promoting the adoption of blockchain technology. With experience as an Ambassador for several projects, including Aptos Pontem, Polkadot, Ankr, Cardano, and Oasis, he produces high-quality content that resonates with readers. Obed is committed to excellence and is always excited to help clients achieve their goals through compelling blog posts, articles, and other types of content.