官术网_书友最值得收藏!

Cryptography

The most popular use of blockchain is to create a cryptocurrency. As the word crypto is in cryptocurrency, you would expect that you need to master cryptography in order to become a blockchain programmer. That is not true. You only need to know two things about cryptography:

  • Private key and public key (asymmetric cryptography)
  • Hashing

These two have been explained in the previous part of this chapter. You don't need to know how to design a hashing algorithm or private key and public key algorithm. You only need to get an intuitive understanding of how they work and the implications of these technologies.

The implication of private keys and public keys is that it enables decentralized accounts. In a normal application, you have a username and password. These two fields enable someone to access their account. But having a private key and public key enables someone to have an account in a decentralized manner.

For hashing, it is a one-way function, meaning that given an input, you can get the output easily. But given an output, you couldn't get the input. A simple version of a one-way function would be this:

This is an addition process. If I tell you one of the outputs of this function is 999, and I ask you what the inputs are, you couldn't guess the answer. It could be anything from 1 and 998 to 500 and 499. A hashing function is something like that. The algorithm is clear as sky (you can read the algorithm of any hashing function on the internet), but it's hard to reverse the algorithm.

So, all you need to know about hashing is this: given input input you get this SHA-256 output (in hexadecimal): c96c6d5be8d08a12e7b5cdc1b207fa6b2430974c86803d8891675e76fd992c20. If you don't know the input, you couldn't get the input based on this output alone. Say you know the input input it is very prohibitive to find another input that produces the same output. We wouldn't even know whether such input exists or not.

That is all you need to know about cryptography when you become a blockchain developer. But that's only true if you become a certain type of blockchain developer, who creates a program on top of Ethereum. 

主站蜘蛛池模板: 招远市| 长白| 牟定县| 砚山县| 乐昌市| 九寨沟县| 东山县| 雷山县| 正宁县| 若羌县| 江永县| 洞口县| 保定市| 宜良县| 道孚县| 林口县| 洛浦县| 社旗县| 宣恩县| 阳江市| 靖安县| 云南省| 伽师县| 陕西省| 前郭尔| 五常市| 北海市| 株洲县| 平南县| 平乐县| 蕲春县| 辽源市| 阿巴嘎旗| 丽水市| 东阳市| 神池县| 奎屯市| 靖江市| 大英县| 荣成市| 噶尔县|