You can explore ethereum/learn solidity by going to Ethereum Official wesbsite
If someone wants to rent an apartment, the smart contract is programmed in a way that
if {one pays a certain amount of money under a certain period} {
should be provided with a digital key,
}
if {the key is not provided} {
then refund the money
}
or
if {money is not paid} {
than do not provide the digital key
The example explained does not show the actual code written in solidity but provides a general explanation how smart contract is coded with if statements to execute functions by the trigger of an action.
Another good example will be buying a car using a smart contract. If a car is bought in a traditional way then it takes a lot of time. First of all, the buyer will have to go the person who is selling the car. Then both have to agree on a price. After that in some way the buyer has to pay and then a lot of paper work needs to be done. While using a smart contract a buyer will see a car and pay the price in cryptocurrency and instantly has the ownership as the automated code will do everything for the buyer and seller. They do not have to go anywhere or trust each other. The transaction will be updated on the public ledger. Now everybody is aware that car has been sold and the buyer now has the ownership of the car.
Bitcoin | Ethereum |
---|---|
Bitcoin Blockchain is called “Blockchain” | Ethereum Blockchain is called “Ethereum” and is a different protocol to Bitcoin |
Bitcoin cryptocurrency is called Bitcoin | Ethereum has a different cryptocurrency called “Ether” |
Bitcoin drives on “Proof of work” | Ethereum currently works on proof of work but due to electricity cost of mining, Ethereum is planned to move to Proof of stake. Proof of stake means that the creator of next block is chosen on the basis of wealth or stake. There is no reward for block but a transaction fee is paid. |
The founder of Bitcoin named as Satoshi Nakamoto is unknown | Ethereum’ founder and other real people who run the cryptocurrency are known. Therefore, they can be accessed to talk about Ethereum. |
Bitcoin just replaces a traditional payment system | Ethereum has smart contract that has a lot of real world applications |
Bitcoin is considered a gold currency as it is a good source of storing value. | Ethereum is not considered for storing value but for its decentralized applications and smart contracts. |
Bitcoin is not scalable because of its size | Ethereum is a platform that developers can use to build other decentralized applications |
No Bitcoins are needed to mine | Ether is needed to run the smart contract |
In proof of stake the creator of the next block is chosen by the algorithm or protocol on based of their wealth or stake.
The idea of POS was presented in 2011 on “bitcointalk” forum and Peercoin was the first currency to use POS in 2012.
The proof of work consensus requires a lot of energy. The electricity consumed by one bitcoin transaction is equal to powering 1.57 American households for a day. A research shows that it is estimated by researchers that by 2020 bitcoin transactions will consume the same amount of electricity as Denmark. Therefore, POS is considered a better, environment friendly and cheaper way of verifying transactions as compare to proof of work.
Ethereum is expected to move from proof of work to proof of stake in 2017 by doing a hard fork. The creator of the block in an Ethereum POS is called forger/validator. There is no reward for creating a block however the validator will get a transaction fee.
The POS protocol of Ethereum is called Casper. On the implementation of Casper, a validator pool will be created. Anyone can join the validator pool who wants to be a forger. The forger or validator will have to make a deposit to participate. To increase the security of the system the Casper ensures if a validator makes an invalid block they will lose their deposit they made and will no longer be part of the validator pool. In this way, they will be losing more than gaining making deception worthless .
Contact me
IB279@live.mdx.ac.uk