A blockchain is a digital ledger that records and stores transactions in a secure and immutable way. It is a distributed, decentralized system that allows for secure peer-to-peer transactions without the need for a third-party intermediary. A blockchain is essentially a public database of all transactions that have ever occurred on the network.
A smart contract is a computer protocol that facilitates, verifies, and enforces the negotiation and performance of a contract. Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. This code is stored on the blockchain and is enforced by the network.
For example, a smart contract could be used to facilitate a real estate transaction. The buyer and seller could agree to the terms of the contract, which would be written into a smart contract. This contract would then be stored on the blockchain, and the transaction would be automatically executed when the conditions of the contract are met. This would eliminate the need for a third-party intermediary and ensure that the transaction is secure and immutable.