Friday, 22 September 2017

Warning! Technical jargon... Part 2

In this part we're going to talk about Blockchain Cryptography, that secret sauce that powers this whole concept. Again, we are going to mostly use Bitcoin as reference here. 

Blockchain cryptography is in the form of a Secure Hash Algorithm (SHA) to hash addresses and encrypt information. An address is where you store and perform your Blockchain transactions. A Bitcoin address is essentially your wallet where you store, receive and send coins. The Blockchain uses this address to identify you and other person's that you are dealing with.

This is a an example of a Bitcoin address: 
mw9WcW3VCuLrsgB1dKV77rvry6e35SYzmW

No please don't send any coins there, its just a demo account - on a side note, if you want to donate to us, please send me an email first :)

This address was hashed from combination of a private key, a public key and sometimes a network key. In Bitcoin, there are test networks (TestNet) which you can generate addresses for and perform transactions, just that the coins in the TestNet are not worth anything, they exist for geeks like us to learn, experiment and test new things.

Now to the Blockchain, this 'address' means nothing. It is not the location within the block per se. It is merely a representation or a hash of the actual location within the block. The 'address' plus a public key which holds ownership conditions will point to the actual location within the Blockchain.

A 256-bit private key is the first key that needs to be generated. It must remain secret or else your coins can be stolen! In most of today's public wallets such as Blockchain.Info they do not even let you keep or even know your private keys. Try to download and register for a wallet from Blockchain.info and you will see that generating your private keys have become an extremely complex and sometimes tedious process.

The second step is to generate a public key. As mentioned, this public key is used to verify the signature of a transaction because it holds essentially ownership information. This public key is a 512-bit key generated from the private key via an 'Elliptic Curve DSA Algorithm'.

Digression:
What is an Elliptic Curve DSA Algorithm you might ask? 
I have three answers for you:

too cold - 

Just Nice - 

Too HOT - 
(Ok I didn't buy this document, just sharing a link with you guys)

Now you decide which is best suited for your tastes.

The third step is to generate the wallet address from this public key. 512-bits is an extremely large value, so in Bitcoin, this value it is reduced to a more manageable 160-bits by applying SHA-256 and RIPEMD hash algorithms. The 160-bit value is then encoded into an ASCII based value by applying a custom Base58Check encoding to produce a (debatable) more human readable value address.




In real world Bitcoin wallets, the addresses are further represented by a QR Code. Third party wallets use smart phones to scan these QR Codes and perform transactions.

So that's the basic setup of Bitcoin cryptography. 

As I mentioned, other Blockchain frameworks may use slightly different methodologies to essentially achieve the same results. So if you ever register for a unified wallet, your Bitcoin address will look different from other cryptocurrency addresses.

No comments:

Post a Comment

Popular Posts