Introduction to Privacy

Introduction to the course and building foundation of blockchain and privacy

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

  • |

Lesson Transcript

  • [00:00 - 00:08] Privacy is a very important concept in blockchains. Writing smart contract is one thing, but designing the privacy aspects of your application is another.

  • [00:09 - 00:23] Using cryptography as a toolbox can be a way to achieve privacy that can yield very good results. For example, hashes with salt have been used for a long time to store user passwords without actually knowing the user passwords.

  • [00:24 - 00:46] And even if the security gets compromised and they are stolen, no user data can be accessed by using the hash without knowing the preimage of the hash. This essentially means that if a website gets hacked and the user use the same password across multiple websites, the hacker never finds out about the password itself.

  • [00:47 - 00:55] So they can't go and hack their other accounts. And this is not safe for then storing this password in plain text.

  • [00:56 - 01:02] Privacy is at the heart of blockchains. Blockchains such as Bitcoin and Ethereum are very public by nature.

  • [01:03 - 01:12] To use them for your applications, you must not put any sensitive data on them because everything will be public. But you have to put something.

  • [01:13 - 01:25] So at a later date, you can prove that the supply chain holds or a product is legitimate. But how do you go about putting data on blockchains without really revealing what the data is?

  • [01:26 - 01:40] The remaining solutions to that problem, for example, a most commonly used one is hashing. A hash function is a deterministic function which takes a preimage and returns a hash, such as the one shown below.

  • [01:41 - 01:54] There are many functions such as KK-56, SHA3, SHA2, SHA1, and so many more. This essentially lets us put the hash on chain without revealing the preimage.

  • [01:55 - 02:03] Anyone who has the preimage can verify on their local machine that it's valid. Well, what if we have many preimages?

  • [02:04 - 02:13] They can all be hash together, like the second line we've shown here. They can just be all written one after the other and the order is important.

  • [02:14 - 02:29] If you change the order of the way you put in the hash function, then the hash will change. And the hash function gives a guarantee that if you give the same preimage, it can always result in the same hash.

  • [02:30 - 02:45] So if someone's password is ALI and you hash that, then the next time you hash ALI, it's gonna be the exact same thing. But if you do not synthesize your inputs, then it will likely change.

  • [02:46 - 03:02] This works fairly well, but there are better ways to do this, such as a Mercle tree. In a Mercle tree, you only have to reveal the relevant parts of the tree and the tree is formed of hashes.

  • [03:03 - 03:16] So even when you reveal certain branches, you're only revealing hashes and not the preimages. Now that you think, now that you may think that's all great, but you don't want to reveal anything but prove that you know a secret.

  • [03:17 - 03:24] This is the fascinating world of zero-knowledge proofs. There are many variants of zero-knowledge proofs, but there are mainly two branches.

  • [03:25 - 03:41] Interactive zero-knowledge proofs and non-interactive zero-knowledge proofs. In this course, we will deep dive into different ways we can achieve privacy without knowing anything about the mathematics behind the cryptography and evaluating the tools within the cryptography tools.

  • [03:42 - 04:12] Even more developing a mindset for building privacy-preserving applications, which are simple, scalable, and can be adopted for both web two and web three applications. Furthermore, we will develop blockchain-based privacy applications such as implementing rock-papers is his own Ethereum with complete privacy for user moves and developing more interesting ideas using linkable ring signatures, Mercle trees, the KSNOCs and many, many more.

Privacy is a very important concept in blockchains. Writing smart contract is one thing, but designing the privacy aspects of your application is another. Using cryptography as a toolbox can be a way to achieve privacy that can yield very good results. For example, hashes with salt have been used for a long time to store user passwords without actually knowing the user passwords. And even if the security gets compromised and they are stolen, no user data can be accessed by using the hash without knowing the preimage of the hash. This essentially means that if a website gets hacked and the user use the same password across multiple websites, the hacker never finds out about the password itself. So they can't go and hack their other accounts. And this is not safe for then storing this password in plain text. Privacy is at the heart of blockchains. Blockchains such as Bitcoin and Ethereum are very public by nature. To use them for your applications, you must not put any sensitive data on them because everything will be public. But you have to put something. So at a later date, you can prove that the supply chain holds or a product is legitimate. But how do you go about putting data on blockchains without really revealing what the data is? The remaining solutions to that problem, for example, a most commonly used one is hashing. A hash function is a deterministic function which takes a preimage and returns a hash, such as the one shown below. There are many functions such as KK-56, SHA3, SHA2, SHA1, and so many more. This essentially lets us put the hash on chain without revealing the preimage. Anyone who has the preimage can verify on their local machine that it's valid. Well, what if we have many preimages? They can all be hash together, like the second line we've shown here. They can just be all written one after the other and the order is important. If you change the order of the way you put in the hash function, then the hash will change. And the hash function gives a guarantee that if you give the same preimage, it can always result in the same hash. So if someone's password is ALI and you hash that, then the next time you hash ALI, it's gonna be the exact same thing. But if you do not synthesize your inputs, then it will likely change. This works fairly well, but there are better ways to do this, such as a Mercle tree. In a Mercle tree, you only have to reveal the relevant parts of the tree and the tree is formed of hashes. So even when you reveal certain branches, you're only revealing hashes and not the preimages. Now that you think, now that you may think that's all great, but you don't want to reveal anything but prove that you know a secret. This is the fascinating world of zero-knowledge proofs. There are many variants of zero-knowledge proofs, but there are mainly two branches. Interactive zero-knowledge proofs and non-interactive zero-knowledge proofs. In this course, we will deep dive into different ways we can achieve privacy without knowing anything about the mathematics behind the cryptography and evaluating the tools within the cryptography tools. Even more developing a mindset for building privacy-preserving applications, which are simple, scalable, and can be adopted for both web two and web three applications. Furthermore, we will develop blockchain-based privacy applications such as implementing rock-papers is his own Ethereum with complete privacy for user moves and developing more interesting ideas using linkable ring signatures, Mercle trees, the KSNOCs and many, many more.