Here is a great video explain smart contracts and how they work on the blockchain technology.