A traditional contract contains legal language on vast documents and rely on third parties for enforcement. If it goes wrong, you are relying on a third party — probably the courts — which takes time and money to deal with.
A Smart Contract defines the rules and consequences of an agreement in the same way you would with a traditional paper-based contract. Except with the blockchain, the obligations, benefits and penalties which apply to all the parties in various circumstances, are automatically executed by a distributed ledger system.
A Smart Contract behaves in a predefined way. When X happens, do Y and then when Y is completed do Z and so on if required. This is the automated part.
A distributed ledger?Blockchain relies on a network of computers not controlled by any one entity. The contract is encrypted for security. The key is that as multiple computers will hold the contract (though the individual owners have no access to that contract directly, so it is private) you will have multiple points of verification.
The various systems in the distributed ledger will then come to an individual agreement as to the terms of the contract and await notification of performance of the terms. No one party can manipulate the system, because you will require multiple verifications of the contract having been fulfilled before the reward part of the agreement is triggered.
Step by step- Define your smart contract. It can be a simple task that performs one operation and get the benefits for that. Do not perform the one task and get the penalty. If you need multiple steps, then you can have those as well.
- Have the distributed ledger transmit the contract details.
- Have the distributed ledger execute the agreement for you and confirm either that it has been performed or not.