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

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. 

主站蜘蛛池模板: 双流县| 唐山市| 集贤县| 延寿县| 佳木斯市| 唐河县| 南澳县| 海阳市| 建瓯市| 建德市| 巴马| 灵武市| 思南县| 上杭县| 永登县| 延吉市| 金昌市| 同德县| 甘南县| 清流县| 鲁甸县| 婺源县| 丹江口市| 攀枝花市| 通许县| 砚山县| 义马市| 湟源县| 肥乡县| 曲阜市| 关岭| 高安市| 樟树市| 房产| 灵川县| 洛南县| 顺义区| 炉霍县| 舒城县| 衡山县| 桦甸市|