My Personal Experience: How Does The Ethereum Blockchain Work?
The Ethereum’s blockchain is a complex topic that requires programming knowledge to fully understand it. Because the majority of us don’t have that level of knowledge, I’ll explain it in basic terms without going too deep into the details, from my experience as an Ethereum developer with more than 4 projects completed and 6+ months working on Smart Contracts:
First I’ll explain you the purpose of the Ethereum’s blockchain to understand why it exists and what problem it solves.
Then we’ll go to into specific use cases of what’s possible.
Let’s start with an example:
Traditionally, when 2 people want to buy something or perform a transaction of some kind in the online world, they have to trust an intermediary that will move the money from an account to the other.
So for example, if Mary who lives in Australia wants to buy a backpack from Joe who lives in China using Joe’s Backpacks Shop, she’ll have to pay for the product using an intermediary like Paypal or her bank.
Then that intermediary will move the money from Mary’s account to Joe’s account.
On one hand, the bank usually takes a few days because it must carefully verify that it was a secure transaction. This is slow and risky.
On the other hand, Paypal is fast but they take an important fee for every transaction.
What if the bank goes bankrupt and loses everybody’s money? What if the bank decides that Mary can’t send money to Joe because they live in different countries?
Why do we have to trust some middleman to take care of a personal transaction and lose time and money paying random fees?
Fortunately, there’s a better solution using the Ethereum’s blockchain.
The blockchain is a public database where all the transactions are store and anybody can see them.
That database stores new information on top of the old one so every time something is added, it remains there forever and the size of the database grows larger. It’s like adding a brick on top of the others.
Also, this amazing database is able to execute programs called Smart Contracts. Those programs can be executed by anybody.
The good thing about Smart Contracts is that they use the blockchain to store their function’s data. They use the public database as their computer. That’s why their code is also public, because they live in the Ethereum’s blockchain.
So how those Smart Contracts and the public database called blockchain can help us make secure transactions without trusting any middleman?
Good question. Smart Contracts are able to deal with a new currency called Ether that can be easily converted to fiat money so they can move money from one user to another. This allows Mary to pay for the backpacks from Joe’s store without having other people’s interest in the middle.
They can exchange money in a couple of minutes, securely and without fees from middlemen because their code can’t be modified once they are deployed to the blockchain and everybody is able to see what a contract does exactly.
Anyone can see your compiled code on the blockchain, but in order to understand how it works they need a human readable code usually. If you don’t publish the “human-version” they will only see the compiled code. Altough if you have a web app using that smart contract, everybody will be able to see how you use the contract.
Smart Contracts are very powerful because they allow you to make almost any kind of transaction, without middleman. It’s like replacing them with robots that just do what they are told without judgement or interests in mind.
Even though they are well used for transactions with money, they can be used for things like:
- Voting for a fair election where the votes are public and completely secure for everybody.
- Digital identities to allow people to decide what data to disclose to counterparties. That way companies won’t have sensitive data. They won’t be able to know who are you and use that data against you like the advertisiments companies do. This reduces liability and improves personal privacy.
- Basically anything that requires a traditional contract can now be programmed with smart contracts. Like buying a house, taking a loan, dealing with your car’s insurance and so on.
If you know how the internet works, Ethereum can be understood as the blockchain being the database, the Smart Contracts being the server code and the client code being the same as it is now.
One of the most interesting uses cases of these kind of descentralized innovations is IPFS.
IPFS is a system that allows anybody to upload files to the public blockchain where you can access files online freely.
When you upload something, say an image to ipfs it returns a hash address like “QmsWfosdnWiuehKSBfhiwuEYHkasbfkSF”. You can access the file with that address going to gateway.ipfs.io/ipfs/<address>.
Everything is public. And if you upload 2 identical files, the address will be the same because there are no repeated data in IPFS. 2 same files have the same address which makes content easy to find and maintain.
Remember that the addresses depend on the content inside. Different files will have different addresses so you can’t modify files, you add new ones.
People upload data and others keep it alive by setting up a node. This allows you to store files without depending on servers or paid storage, also the data can’t be taken down as long as there’s people maintaining it.
But isn’t this the same as downloading torrent files?
Good question. They’re similar protocols but IPFS has several advantages like:
- The fact that you can access a chunk of data of a folder instead of downloading an entire folder. For example if you want an image from a pack of images, you can whatever file you want. While with torrent you would have to get all those images.
- You can use IPNS which is having a permanent address like “QmdfUAShfuienkfbsiFKDSjksdf” for a folder. That means that you can update the content of the folder and the address will be the same. It’s like a link to changing data. Useful because data changes all the time and the only way to maintain a consistent address is IPNS.
The key distinguishing factor is the fact that IPFS allows you to use any hash, of any content or any subset of content, as an identifier. You can use that hash to ask the network who has that exact content.
Contrast this with bittorrent’s reliance on torrent files, which bundle data together according to however that torrent file was originally structured by its creator