Blockchain, Etherium..and dApps
As a huge proponent of de-centralization, and as I was learning about blockchain technology, Ethereum definitely caught my eye. Like all other blockchains, it is a "public ledger". Specifically, anyone with sufficient hard disk space can have the entire ledger on their own machine and can view all transactions as much as they please.
And this is where the beauty of decentralization arrives. With crypto-currencies you write transactions to the ledger and retrieve receipts. This posting requires a fee, and with the transaction you can write some text.
One of the most important lessons we developers understand is their is really no difference between "data" and "code". The machine does not care, you point it to data and tell it here is some code it will 'execute it'. Which is why buffer overruns are huge security vulnerabilities. Put 'code' in the 'data' area, overflow the buffer and viola, you gain control of the system.
Building on this idea, with the Ethereum block chain, the data you write into a transaction can be code. In Ethereum terms this is called a 'contract'. That 'contract' can expose functions that other clients can call (eg: javascript in HTML) as an ajax function. The key difference of course is that it will cost $$ to preform the transaction (or "GAS" in Ethereum terms). So every I/O operation will have some (albeit small at the moment) charge for using it.
Okay, so you publish your contract (ie: 'server side code') to the blockchain (where it is immutable and can never change by the way!!). You write some client code that interacts with it. Since the blockchain (containing your code) is replicated by all people participating in the network, the server is effectively 'decentralized'. The browser is effectively connecting to the users 'local copy' of the ledger, and the 'state' of the variables within the server are stored / retrieved as part of the transaction.
This is (in theory) similar to 'cloud computing' (though in technology terms quite different) in the sense that the 'server' you are interacting with is in the cloud and you have no idea who or what machine it is executing it on. Typically you pay a provider (eg: AWS) a recurring fee for the service, with Ethereum you are paying the network (a large group of your fellow developers) to share a portion of their machine instead.
In a previous article I spoke about the history of spam, sending an email costs nothing. Sending a transition on a blockchain costs crypto currency. Why do you have to pay a fee? - This is how to avoid spam. If email cost $0.01 for every email sent, spam would quickly drop to zero, because sending 5 million emails would cause a very upsetting bill to the spammer. By setting a minimum transaction fee you can be confident the network will have very little spam.
You can surf the 'de-centralized' web with a dApp browser essentially this connects your crypto-wallet to the website and confirms any purchase price. You can also use an extension called MetaMask which works for this as well.
It would not be a post about dApps, if I did not mention cryptokitties. One of the first dApp game on the Ethereum network. This app almost brought the network to a halt with people collecting their own kitties. So one of the potential problems of running apps on the blockchain, it may not be able to scale well to mass adoption!
Comments
Post a Comment