A smart contract is a piece of code that will run when conditions that are specifically defined are met. The uses of a smart contract are virtually limitless, especially where the result required is exchange. Many companies are now using these smart contracts in the supply chain to ensure the quality of their products and the dispatch of them.
A smart contract is a contract that has been written in computer code and uploaded by the creator to the blockchain. Whenever a contract is executed, every computer on the network runs it because it is stored on the blockchain and is, in theory, tamper-proof.
If you understand computer programming, you will understand me when I say that a smart contract is a structured if…then statement. Provided specific conditions are met, the terms of the contract will be carried out. An example would be if you wanted to rent a vehicle and the company uses Ethereum. A smart contract would be drawn up and generated – the condition would be that you send a specified amount of funds. When that is met, a digital key is sent to you so that you can unlock the car.
This is all done on the blockchain so that when the Ether tokens are sent the whole network sees what has happened. In the same way, that network can also see that the key has been sent to you. Another condition could be added to this contract – one that says if the key is not sent to you then your tokens will be refunded. This transaction cannot be tampered with because everyone can see it. Each program that is on Ethereum needs to use a certain amount of processing power and because this is all run by the network nodes, superfluous activities need to be kept to an absolute minimum. Because of this, every program and every contract on Ethereum is provided with a cost of gas. This is a measurement of the amount of processing power needed for the contract or program – the higher the requirement in gas, the more it will cost the user in Ether tokens.
The higher the requirement in gas, the more it will cost the user in Ether tokens
The smart contract effectively removes the need for intermediaries like banks, notaries or lawyers which mean no fees to pay and this is important for those who reside in countries where the legal system is inefficient or downright corrupt. One downside to this is that if something went wrong such as a bug in the coding, the contract terms would still be carried out and this could cause problems. That said, things are improving all the time and work on Ethereum is ongoing. It is still one of the safest ways to carry out a transaction and set up a contract.