Design by contract
Also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software.
According to Design by Contract theory, a software system can be viewed as a collection of components that interact with each other based on the precise definition of the covenants in the "contract", a conceptual metaphor with the conditions and obligations of business contracts.
Smart contract
Smart Contract is a term that describes a set of special protocols capable of automatically implementing terms and agreements between the parties to the contract (in this case, the computer system) thanks to the support of Blockchain technology. The entire operation of Smart Contract is performed automatically and without outside intervention, or through an intermediary third party. Transactions made using smart contracts are transparent, easily traceable, and cannot be tampered with or reversed. The terms in a Smart Contract are equivalent to a legal contract and are written in the programming language.
How it works
First, the terms of the contract will be written in a programming language, then encrypted and transferred into a block of the Blockchain. After moving into the block, this Smart Contract will be distributed and replicated by the active nodes on that platform. After receiving the deployment order, the contract will be deployed according to the predetermined terms. At the same time, Smart Contract will also automatically check the implementation of the commitments and terms stated in the contract.