A midnight affair: My encounter with the emerging heroes

Ammar bin Ayaz
9 min readDec 27, 2017

Let me tell you about a very interesting talk I had with bitcoin and blockchain. The conversation was very enlightening for me so I thought of sharing it with everyone.

One morning I got a call from my dad asking me to transfer some money to my brother’s account who at that time was living in London. As I was doing a cross border transaction a significant amount of money was charged in the name of transaction fee. Moreover, I also noticed that my bank was giving a higher exchange rate. As transferring the money was the priority I didn’t give it much thought albeit these points were present somewhere in my mind. Next evening as I came back from office I received a message from my bank that the transaction I had done the day before failed due to technical reasons. I was still calm assuming that the money will be credited back into my account immediately but that was not the case. My bank informed me (only after I inquired) that it will take 7 working days for the money to be refunded. Already facing a month-end monetary crisis this additional loss of money although temporary had really exasperated me. So I just decided to umm. Well I decided to go and sleep.

I do most of the thinking or I can say brainstorming just before I fall asleep. So when I lied down I said to myself what if we could remove the dependency on the banks for doing transactions. Just to do one cross border transaction I had to trust my bank that it will transfer the money from my account to my brothers account and then my brothers bank will reflect the transaction and add the money into his account. On top of that I had to pay a large transaction fees and had to accept the exchange rate decided by my bank. Just when I was lost in these thoughts I heard a voice saying “OLA! OLA!” I got scared. With a shaky voice I asked “Who is this? Please introduce yourself.” The voice introduced itself to be bitcoin. And here’s the rest of the conversation:

Me: Bitcoin? A bit more of description would be nice.

Bitcoin: I am bitcoin, a digital crypto currency, The solution to your problem.

Me: There are a lot of problems in my life. Which one are you referring to?

Bitcoin: The problem you were thinking about right now. The one you faced while transferring money to your brother.

Me: How do you know? Ok wait lets leave that. How do you plan on solving my problem.?

Bitcoin: I am a digital crypto currency a decentralized one which means I am in control of no centralized organization. My price is consistent through out the world so you will not get any difference of rate while making a transfer and one more thing, you will also not be charged a large transaction fee when you transfer me.

Me: So you are a digital cryptocurrency. Then you must be aware that you have a double spending problem due to which you have not been accepted yet although your concept has been floating around for a long time.

Bitcoin: Oh please don’t bring up my dark history. For your information I have solved the double spending problem.

Me: What? Really? Congratulations on the distinguished feat! Were you able to do it all by yourself?

Bitcoin: I will tell you all about it. But first let me explain what you meant by double spending problem. I felt you forgot about that. Let me cite an example here to explain. Suppose you have some digital currency and you use it to buy something. Then who is going to stop you from making a copy of the same digital currency and use it to buy something else.

Me: Ok now enough with the explanation, Tell me how you solved the double spending problem.

Bitcoin: I managed to solve the problem by implementing a confirmation mechanism and maintaining a ledger of all the transactions, which I share with everyone participating in the network. This shared ledger technology is known as block chain. Block chain keeps all the transactions in a chronological order and shares the ledger with everyone participating in the network.

Me: Now you have started showing off. Presuming that I would know about block chain.

Bitcoin: Sorry I got carried away. So block chain is one of my friends who helped me solve the double spending the problem.

[Unrecognized voice]: Hey bitcoin, let me introduce myself, you have already done enough.

Me: Who are you? Stop scaring me like this.

Blockchain: Hey I am the friend bitcoin was telling you about. I am block chain technology.

Me: And what is this block chain technology may I know?

Blockchain: Simply put I am a shared ledger. Meaning I keep the record of all the transactions happening between nodes. Nodes are nothing but computers. All the nodes keep my copy locally. The transactions are digital so we need computers or mobile device to do a transaction.

Me: So why are you called a block chain? Why not node chain instead? Ha ha.

Blockchain: It wasn’t really funny. Anyways, I am basically a concept. My task is to keep the record of all the transactions that happen between nodes, I keep a transaction in the form of a block, a block contains all the information related to a transaction. All these blocks are saved in a chronological order so virtually connected by a chain. Therefore, I am called blockchain.

Me: I am getting a gist of what you mean. If you could tell me a little bit about nodes then that would be great.

Blockchain: Node can be anyone participating in the transactions and maintaining a copy of all the transactions in the form of a blockchain. Node has one more task which I will tell you about later.

Me: Thanks for the explanation but I think we have digressed a bit from the topic. Now I am curious to know how you solved the double spending problem.

Blockchain: Let me elaborate it to you using an example. Suppose you have 5 bitcoins and you try to spend it twice. First you sent the bitcoins to a person using his public key. (Public key is nothing but a person’s identification just like your name or account number). Then again you use the same bitcoins and try to send it to someone else. So in this case what happens is that both the transactions are added to the unconfirmed pool of transactions. But there is a verification mechanism where-in nodes of the blockchain verify the transaction and when the transaction gets confirmation then only it is added to the blockchain. But if the transaction doesn’t get enough confirmations it is removed from the blockchain. Here confirmation means when the same account requests the same transaction using the same bitcoins then two chains are created and when a new block has to be added on the chain the nodes verify the transactions on both the chains and then add the block. So after a fixed amount of time the whole blockchain is checked and the chain which is longer meaning that nodes have added the blocks on that blockchain is kept and the other one is removed. This is handled by the bitcoin protocol. The process of adding a block to the blockchain is called mining and it is done by the nodes of the blockchain. So when I told you that nodes have one more task to handle I was talking about mining. Just to buy or sell bitcoins you don’t have to participate as a node, you can interact with the blockchain externally but the part of verification, mining and adding the block to the block chain is done by a node.

Me: Mining seems interesting. Can you explain to me how it is done? How do you confirm whether the person raising a request is the owner of the account he/she is claiming to be the owner of? How do you check whether the person has enough bitcoins to make the transfer? How can one protect his/her bitcoins from being claimed by someone else?

Blockchain: I am happy to see your curiosity. So let’s dig deeper in to the process of transaction. So an electronic wallet is assigned to the account and one protects the account using their private key. Think of private key as a password which protects your bitcoins. Now suppose you want to send some money to another account you need to announce the same using a message and you are going to create a unique signature using your private key and the message. To send the money you will need three things the signature you just created, the amount of bitcoin you want to transfer and the public key of the receiver which you can think of as account number. Once you announce the message to do the verifications, miners use the signature that is created using the message and your private key. So it solves two purposes first it verifies the account and second it hides your private key. So there is a way by which private key, public key and signature is generated which is called hashing. So when we hash private key and message together it creates a new hash which is completely different from the private key. The miners use a cryptographic technique to verify the account using the signature. You can look it up I am not discussing it here because it is very technical. To confirm whether an account has the amount it is trying to send, the nodes trace back all the transactions that have happened on the blockchain and confirm whether the account has enough bitcoins. The whole blockchain is visible to all the nodes thanks to the decentralized nature of the blockchain. Once it is done the final step of adding the transaction to the blockchain is done where the money is deducted from the sender’s account and added to that of the receiver’s. And then the block is created having all the details of the transaction in the form of a hash. This whole step is called mining and whichever node mines the transaction successfully is rewarded with newly created bitcoins.

Me: It doesn’t seem difficult for a computer with good computing power. Then the limit of the bitcoin which is 21 million will be crossed very soon.

Blockchain: I get your point but the bitcoin protocol makes the process a bit difficult. The main purpose for the difficluty is to slow down the process of bitcoin creation. As the mining process is rewarding, every node in the network races to complete the process of adding the block to the block chain. To do so they have to solve a puzzle, And the node which solves the puzzle first gets the reward. The complexity of the puzzle is adjusted by the bitcoin protocol such that it takes 10 minutes to be solved, independent of the number of nodes trying to solve the puzzle.

Me: OK I understood almost the whole concept but allow me one last question. Am I right in saying that only bitcoin block chain is available in the world?

Blockhain: Oh no no. I am just a concept. It is true that bitcoin is the first real implementation of me, but my use is just not limited to cryptocurrency. You can use me to verify legal contracts, doing real estate transactions, there is one more very common implementation of me known as ethereum which uses me to develop smart contracts. More on my other implementations later buddy! Time to get some sleep.

Me: Yeah! Thanks for explaining the whole thing. It really does seem to be the solution to my problem I mean to everyone’s for that matter. It was an enlightening episode I am glad you showed up tonight but please don’t scare me like this again. You can just knock the door and I will let you in. This goes for you Mr bitcoin as well.

[Both together]: OK. Will knock from next time onwards.

Me: I will try to gather the remaining information from the internet and if I have any doubts I will give you a call. But hey! How will I do that? Can I have your contact information?

WHOOSH! [Both vanished]

I was startled by the sound of my clock that struck three. Well bitcoin and blockchain had disappeared as alarmingly as they had appeared. And they had also left me unable to sleep so I got up and decided to write the whole thing for you people. Well I pondered a lot over it later and realized there were many questions and doubts that people might find,I weighed several pros and cons and drafted many different conclusions that I obviously can’t write here.

After thinking a lot I decided that it would be better if I interact with you guys in the comments section.

So If you have any query please feel free to post them. I would be more than happy to answer your queries.

--

--

Ammar bin Ayaz

Currently pursuing MS in computer science from NYU with a focus on AI and everything around it.