Smart contracts is the technology used by Ethereum and many other altcoins. Smart contracts play a role of an immutable digital notary that proves the ownership of any document without any third-party governance.
In today’s article we’d like to look in details at what is a smart contract and how it works for Ethereum.
Exchange BTC to ETH at BestRate.org
Pioneer of decentralized payments
When bitcoin was implemented into our lives, it proved that it’s really possible to exchange goods over the internet without any third-party governance and that we can really do without a bank to transfer money. What made this possible was the specific data structure called blockchain that distributes trust across many nodes.
Each node stores the data about every transaction that has ever occured in the network. It uses the Proof-of-work algorithm that is quite secure and can’t be hacked.
Since then quite many more alternative cryptocurrencies have appeared, each of them adding something else on top of bitcoin’s technology extending its functionality. However, Ethereum remains one of the most popular cryptocurrencies (moved down from the 2nd to the 3rd place by Ripple recently) with very interesting potential.
The difference between Ethereum and Bitcoin
Ethereum can also be exchanged without any governance, but it’s also got its own turing-complete programming language that allows you to build smart contracts.
When you buy any coins in the bitcoin network, they are sent to a unique address. This address is used not for storing the coins, but as a unique identifier like a bank account number that calculates the total of all the transactions that pass through this address. The nearest analogy in the material world is the ledger that records all the deposits and withdrawals from the account. When a transaction occurs the old balance is reduced by some amount and another balance is increased by the same amount, but no physical value is ever moved.
Ethereum is different. It keeps your coins at an address that is named smart contract. In fact, it is is just a piece of code that is kept on the blockchain network. It defines the conditions that all the members of the network agree upon so as to execute some actions when these conditions are met. With such technology no third-party governance is needed to make a transaction.
Gas that fuels the transactions
As the layout of the network is scarce, there must be some mechanism that limits resources used by each contract. Every transaction that occurs within the network is simultaneously executed at every node of the network, and this is where gas is needed.
Gas can only be used within the network to calculate the price of a transaction in Ether a limit the resources. It can’t be purchased or sold. Gas can be used for such operations as data read’s and write’s, making calls to other contracts, doing expensive computations like using cryptographic primitives, etc. The cost of each operation is measured in gas and must be paid based on a Gas to Ether price which changes dynamically.
With Ethereum you pay for each transaction instead of a monthly fee that you pay to some central provider such as bank. Gas is also a good motivator for developers to write efficient code that would require less gas for its execution.
Smart contract example
Smart contracts can be used for supply chain and logistics. They let you track how the product moves from the factory where it was produced to the store where you can purchase it. IoT devices can send new data about the product directly to the smart contract and thus provide full transparency and reduce the risk of fraud.
Another example of how smart contracts can be used is related with insurance policies. Typically, the claims process takes too much time in this area as there are many manual operations to be executed. Eventually, a customer has to pay more for all this stuff. But all these operations can be automated with the help of smart contracts and thus reduce costs.
Conclusion
In the past, we could only make transactions with each other with the help of some third-party authority that governed the deal. Now with the new technology of Ethereum smart contracts we can easily make payments directly from one person to another.